From 44633fb17faa7fbc6060903846c9dda9cdbfe2bc Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 14 Oct 2024 12:13:49 +1300 Subject: [PATCH] only remove blurred background for mobile --- .../desktop-client/src/components/common/Modal.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/desktop-client/src/components/common/Modal.tsx b/packages/desktop-client/src/components/common/Modal.tsx index e2291658e84..f4c6e2d89fd 100644 --- a/packages/desktop-client/src/components/common/Modal.tsx +++ b/packages/desktop-client/src/components/common/Modal.tsx @@ -21,6 +21,7 @@ import { useModalState } from '../../hooks/useModalState'; import { AnimatedLoading } from '../../icons/AnimatedLoading'; import { SvgLogo } from '../../icons/logo'; import { SvgDelete } from '../../icons/v0'; +import { useResponsive } from '../../ResponsiveProvider'; import { type CSSProperties, styles, theme } from '../../style'; import { tokens } from '../../tokens'; @@ -51,6 +52,7 @@ export const Modal = ({ containerProps, ...props }: ModalProps) => { + const { isNarrowWidth } = useResponsive(); const { enableScope, disableScope } = useHotkeysContext(); // This deactivates any key handlers in the "app" scope @@ -81,8 +83,15 @@ export const Modal = ({ alignItems: 'center', justifyContent: 'center', fontSize: 14, - backgroundColor: 'rgba(0, 0, 0, 0.2)', willChange: 'transform', + // on mobile, we disable the blurred background for performance reasons + ...(isNarrowWidth + ? { + backgroundColor: 'rgba(0, 0, 0, 0.3)', + } + : { + backdropFilter: 'blur(1px) brightness(0.9)', + }), ...style, }} {...props}