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

fixed mobile appearance of dialogs

This commit is contained in:
Fedor Katurov 2022-07-14 13:26:53 +07:00
parent 4483d7a0f5
commit 042f238590
8 changed files with 25 additions and 19 deletions

View file

@ -39,7 +39,7 @@ const FlowCell: FC<Props> = ({
canEdit = false,
onChangeCellView,
}) => {
const { innerWidth } = useWindowSize();
const { isMobile } = useWindowSize();
const withText =
((!!flow.display && flow.display !== 'single') || !image) && flow.show_description && !!text;
@ -54,11 +54,11 @@ const FlowCell: FC<Props> = ({
const { isActive: isMenuActive, activate, ref, deactivate } = useClickOutsideFocus();
const shadeSize = useMemo(() => {
const min = innerWidth < 768 ? 10 : 15;
const max = innerWidth < 768 ? 20 : 50;
const min = isMobile ? 10 : 15;
const max = isMobile ? 20 : 50;
return withText ? min : max;
}, [withText, innerWidth]);
}, [withText, isMobile]);
return (
<div className={classNames(styles.cell, styles[flow.display || 'single'])} ref={ref as any}>