From 5edcfaf4e28ce0d2d44a9ce333999d322894f394 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Thu, 31 Oct 2019 14:05:29 +0700 Subject: [PATCH] fixed text display criteria --- src/components/flow/Cell/index.tsx | 13 ++++++++++--- src/components/flow/Cell/styles.scss | 8 ++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/flow/Cell/index.tsx b/src/components/flow/Cell/index.tsx index d389f9b4..4d6e69bd 100644 --- a/src/components/flow/Cell/index.tsx +++ b/src/components/flow/Cell/index.tsx @@ -29,8 +29,11 @@ const Cell: FC = ({ }, [setIsLoaded]); const onClick = useCallback(() => onSelect(id, type), [onSelect, id, type]); + const has_description = description && description.length > 160; - const text = (((flow && !!flow.show_description) || type === 'text') && description) || null; + const text = + (((flow && !!flow.show_description) || type === 'text') && has_description && description) || + null; const toggleViewDescription = useCallback(() => { const show_description = !(flow && flow.show_description); @@ -71,8 +74,12 @@ const Cell: FC = ({
- -
+ {has_description && ( + <> + +
+ + )} diff --git a/src/components/flow/Cell/styles.scss b/src/components/flow/Cell/styles.scss index 91d9253c..65ea50de 100644 --- a/src/components/flow/Cell/styles.scss +++ b/src/components/flow/Cell/styles.scss @@ -182,9 +182,9 @@ .vertical > &.has_text { top: auto; bottom: 0; - height: 50%; + max-height: 50%; max-width: 100%; - // height: auto; + height: auto; width: auto; padding: ($grid_line / 2) $grid_line $grid_line $grid_line; } @@ -203,9 +203,9 @@ .quadro > &.has_text { padding: ($grid_line / 2) ($grid_line / 2) $grid_line $grid_line; top: auto; - height: 50%; + max-height: 50%; max-width: 50%; - // height: auto; + height: auto; width: auto; bottom: 0; left: 0;