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:
parent
48cce8f127
commit
5edcfaf4e2
2 changed files with 14 additions and 7 deletions
|
@ -29,8 +29,11 @@ const Cell: FC<IProps> = ({
|
||||||
}, [setIsLoaded]);
|
}, [setIsLoaded]);
|
||||||
|
|
||||||
const onClick = useCallback(() => onSelect(id, type), [onSelect, id, type]);
|
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 toggleViewDescription = useCallback(() => {
|
||||||
const show_description = !(flow && flow.show_description);
|
const show_description = !(flow && flow.show_description);
|
||||||
|
@ -71,8 +74,12 @@ const Cell: FC<IProps> = ({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.menu_content}>
|
<div className={styles.menu_content}>
|
||||||
|
{has_description && (
|
||||||
|
<>
|
||||||
<Icon icon="text" onClick={toggleViewDescription} />
|
<Icon icon="text" onClick={toggleViewDescription} />
|
||||||
<div className={styles.menu_sep} />
|
<div className={styles.menu_sep} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<Icon icon="cell-single" onClick={setViewSingle} />
|
<Icon icon="cell-single" onClick={setViewSingle} />
|
||||||
<Icon icon="cell-double-h" onClick={setViewHorizontal} />
|
<Icon icon="cell-double-h" onClick={setViewHorizontal} />
|
||||||
<Icon icon="cell-double-v" onClick={setViewVertical} />
|
<Icon icon="cell-double-v" onClick={setViewVertical} />
|
||||||
|
|
|
@ -182,9 +182,9 @@
|
||||||
.vertical > &.has_text {
|
.vertical > &.has_text {
|
||||||
top: auto;
|
top: auto;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
height: 50%;
|
max-height: 50%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
// height: auto;
|
height: auto;
|
||||||
width: auto;
|
width: auto;
|
||||||
padding: ($grid_line / 2) $grid_line $grid_line $grid_line;
|
padding: ($grid_line / 2) $grid_line $grid_line $grid_line;
|
||||||
}
|
}
|
||||||
|
@ -203,9 +203,9 @@
|
||||||
.quadro > &.has_text {
|
.quadro > &.has_text {
|
||||||
padding: ($grid_line / 2) ($grid_line / 2) $grid_line $grid_line;
|
padding: ($grid_line / 2) ($grid_line / 2) $grid_line $grid_line;
|
||||||
top: auto;
|
top: auto;
|
||||||
height: 50%;
|
max-height: 50%;
|
||||||
max-width: 50%;
|
max-width: 50%;
|
||||||
// height: auto;
|
height: auto;
|
||||||
width: auto;
|
width: auto;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue