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

fixed text display criteria

This commit is contained in:
Fedor Katurov 2019-10-31 14:05:29 +07:00
parent 48cce8f127
commit 5edcfaf4e2
2 changed files with 14 additions and 7 deletions

View file

@ -29,8 +29,11 @@ const Cell: FC<IProps> = ({
}, [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<IProps> = ({
</div>
<div className={styles.menu_content}>
<Icon icon="text" onClick={toggleViewDescription} />
<div className={styles.menu_sep} />
{has_description && (
<>
<Icon icon="text" onClick={toggleViewDescription} />
<div className={styles.menu_sep} />
</>
)}
<Icon icon="cell-single" onClick={setViewSingle} />
<Icon icon="cell-double-h" onClick={setViewHorizontal} />
<Icon icon="cell-double-v" onClick={setViewVertical} />