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]);
|
||||
|
||||
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} />
|
||||
|
|
|
@ -182,9 +182,9 @@
|
|||
.vertical > &.has_text {
|
||||
top: auto;
|
||||
bottom: 0;
|
||||
height: 50%;
|
||||
max-height: 50%;
|
||||
max-width: 100%;
|
||||
// height: auto;
|
||||
height: auto;
|
||||
width: auto;
|
||||
padding: ($grid_line / 2) $grid_line $grid_line $grid_line;
|
||||
}
|
||||
|
@ -203,9 +203,9 @@
|
|||
.quadro > &.has_text {
|
||||
padding: ($grid_line / 2) ($grid_line / 2) $grid_line $grid_line;
|
||||
top: auto;
|
||||
height: 50%;
|
||||
max-height: 50%;
|
||||
max-width: 50%;
|
||||
// height: auto;
|
||||
height: auto;
|
||||
width: auto;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue