diff --git a/src/components/flow/Cell/index.tsx b/src/components/flow/Cell/index.tsx index 6f4c2adf..0e80c541 100644 --- a/src/components/flow/Cell/index.tsx +++ b/src/components/flow/Cell/index.tsx @@ -4,7 +4,6 @@ import { getURL } from '~/utils/dom'; import classNames from 'classnames'; import * as styles from './styles.scss'; -import path from 'ramda/es/path'; import { Icon } from '~/components/input/Icon'; import { flowSetCellView } from '~/redux/flow/actions'; @@ -18,7 +17,7 @@ interface IProps { } const Cell: FC = ({ - node: { id, title, thumbnail, type, blocks, flow }, + node: { id, title, thumbnail, type, flow, description }, can_edit, onSelect, onChangeCellView, @@ -29,12 +28,12 @@ const Cell: FC = ({ setIsLoaded(true); }, [setIsLoaded]); - const onClick = useCallback(() => onSelect(id, type), [onSelect, id]); + const onClick = useCallback(() => onSelect(id, type), [onSelect, id, type]); - const text = path([0, 'text'], blocks); + const text = (((flow && !!flow.show_description) || type === 'text') && description) || null; const toggleViewDescription = useCallback(() => { - const show_description = flow && !flow.show_description; + const show_description = !(flow && flow.show_description); const display = (flow && flow.display) || 'single'; onChangeCellView(id, { show_description, display }); }, [id, flow, onChangeCellView]); @@ -70,7 +69,7 @@ const Cell: FC = ({
- +
diff --git a/src/components/flow/Cell/styles.scss b/src/components/flow/Cell/styles.scss index c0f29a43..dc9563f2 100644 --- a/src/components/flow/Cell/styles.scss +++ b/src/components/flow/Cell/styles.scss @@ -138,22 +138,18 @@ .menu { position: absolute; - top: 0; - right: 0; - // height: 100%; - // width: 80px; + top: -$gap; + right: -$gap; z-index: 4; border-radius: $radius; - // opacity: 0; pointer-events: none; touch-action: none; transition: opacity 0.5s; box-sizing: border-box; - // display: none; - // padding: $gap; display: flex; align-items: stretch; justify-content: center; + padding: $gap; &:hover { opacity: 1;