Skip to content

Commit

Permalink
only remove blurred background for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Oct 13, 2024
1 parent 9a48d56 commit 44633fb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/desktop-client/src/components/common/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 44633fb

Please sign in to comment.