From 4930be5acfa8ac80f48c00461c558bf1bae5024a Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Fri, 8 Oct 2021 11:33:01 +0700 Subject: [PATCH] fixed cell text on flow --- .../flow/CellShade/styles.module.scss | 4 --- src/components/flow/FlowCell/index.tsx | 9 +++-- .../flow/FlowCell/styles.module.scss | 36 ++++++++++++++----- src/components/flow/FlowCellText/index.tsx | 8 ++--- .../flow/FlowCellText/styles.module.scss | 7 ++-- 5 files changed, 42 insertions(+), 22 deletions(-) diff --git a/src/components/flow/CellShade/styles.module.scss b/src/components/flow/CellShade/styles.module.scss index 2a37fb11..054a6051 100644 --- a/src/components/flow/CellShade/styles.module.scss +++ b/src/components/flow/CellShade/styles.module.scss @@ -14,8 +14,4 @@ height: 10px; background-color: blue; } - - @include tablet { - opacity: 0.7; - } } diff --git a/src/components/flow/FlowCell/index.tsx b/src/components/flow/FlowCell/index.tsx index ac442e0e..afc65ed1 100644 --- a/src/components/flow/FlowCell/index.tsx +++ b/src/components/flow/FlowCell/index.tsx @@ -22,7 +22,7 @@ const FlowCell: FC = ({ color, to, image, display = 'single', text, title return ( {withText && ( - + {title}}> {text!} )} @@ -37,7 +37,12 @@ const FlowCell: FC = ({ color, to, image, display = 'single', text, title )} - {!withText &&

{title}

} + + {!withText && ( +
+

{title}

+
+ )}
); }; diff --git a/src/components/flow/FlowCell/styles.module.scss b/src/components/flow/FlowCell/styles.module.scss index af45437b..5c47fc92 100644 --- a/src/components/flow/FlowCell/styles.module.scss +++ b/src/components/flow/FlowCell/styles.module.scss @@ -32,6 +32,7 @@ .shade { @include outer_shadow; + position: absolute; top: 0; left: 0; @@ -42,15 +43,26 @@ .text { position: absolute; - bottom: 10px; - left: 10px; + bottom: 5px; + left: 5px; z-index: 1; overflow: hidden; border-radius: $radius; - max-height: calc(100% - 20px); - max-width: calc(100% - 20px); + max-height: calc(100% - 10px); + max-width: calc(100% - 10px); box-sizing: border-box; + font: $font_16_regular; + @include tablet { + font: $font_14_regular; + left: 5px; + bottom: 5px; + } + + & :global(.grey) { + color: inherit; + opacity: 0.5; + } .quadro &, .horizontal & { @@ -65,13 +77,21 @@ } } -.title { - font: $font_cell_title; - position: absolute; +.title_wrapper { bottom: 0; left: 0; width: 100%; z-index: 10; padding: $gap; - text-transform: uppercase; + position: absolute; +} + +.title { + font: $font_cell_title; + text-transform: uppercase; + word-break: break-word; + + @include tablet { + font: $font_18_semibold; + } } diff --git a/src/components/flow/FlowCellText/index.tsx b/src/components/flow/FlowCellText/index.tsx index 695ba4be..26b6ffd1 100644 --- a/src/components/flow/FlowCellText/index.tsx +++ b/src/components/flow/FlowCellText/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import React, { FC, ReactElement } from 'react'; import { Markdown } from '~/components/containers/Markdown'; import { DivProps } from '~/utils/types'; import classNames from 'classnames'; @@ -7,12 +7,12 @@ import { formatText } from '~/utils/dom'; interface Props extends DivProps { children: string; - title: string; + heading: string | ReactElement; } -const FlowCellText: FC = ({ children, title, ...rest }) => ( +const FlowCellText: FC = ({ children, heading, ...rest }) => (
- {title &&

{title}

} + {heading &&
{heading}
}