1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

better appearance for text only nodes

This commit is contained in:
Fedor Katurov 2019-11-18 12:25:11 +07:00
parent d4eb186d20
commit f440a5f4c3
3 changed files with 98 additions and 70 deletions

View file

@ -8,6 +8,7 @@ import { Icon } from "~/components/input/Icon";
import { flowSetCellView } from "~/redux/flow/actions";
import { PRESETS } from "~/constants/urls";
import { debounce } from "throttle-debounce";
import { NODE_TYPES } from "~/redux/node/constants";
interface IProps {
node: INode;
@ -64,12 +65,11 @@ const Cell: FC<IProps> = ({
}, [setIsLoaded]);
const onClick = useCallback(() => onSelect(id, type), [onSelect, id, type]);
const has_description = description && description.length > 160;
const has_description = description && description.length > 32;
const text =
(((flow && !!flow.show_description) || type === "text") &&
has_description &&
description) ||
(type === NODE_TYPES.TEXT && description) ||
(flow && flow.show_description && has_description && description) ||
null;
const toggleViewDescription = useCallback(() => {