From 8ad5576983b0f969b990fc48d65e9a0651c37278 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Wed, 8 Apr 2020 15:39:28 +0700 Subject: [PATCH] fixed empty title error --- src/components/node/NodeRelatedItem/index.tsx | 4 +++- src/components/node/NodeRelatedItem/styles.scss | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/node/NodeRelatedItem/index.tsx b/src/components/node/NodeRelatedItem/index.tsx index 26597050..ebdfbdf8 100644 --- a/src/components/node/NodeRelatedItem/index.tsx +++ b/src/components/node/NodeRelatedItem/index.tsx @@ -11,7 +11,9 @@ type IProps = RouteComponentProps & { }; const getTitleLetters = (title: string): string => { - const words = title.split(' '); + const words = (title && title.split(' ')) || []; + + if (!words.length) return ''; return words.length > 1 ? words diff --git a/src/components/node/NodeRelatedItem/styles.scss b/src/components/node/NodeRelatedItem/styles.scss index 84974ef7..eccc8b81 100644 --- a/src/components/node/NodeRelatedItem/styles.scss +++ b/src/components/node/NodeRelatedItem/styles.scss @@ -40,5 +40,6 @@ width: 100%; height: 100%; font: $font_24_semibold; - opacity: 0.2; + // opacity: 0.2; + color: #444444; }