176d5d0bb7
Completes the mobile fullscreen modal pass — adds useModalStyle to DeviceVerificationSetup, DeviceVerificationReset, AddExistingModal, RoomEncryption prompt, RoomUpgradeDialog, Modal500, ReadReceiptAvatars, and RoomTopicViewer. All floating Dialog/Modal components now go fullscreen on mobile (≤750px). UIAFlowOverlay was already fullscreen via <Overlay>; JoinRulesSwitcher/RoomNotificationSwitcher are dropdowns. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
950 B
TypeScript
32 lines
950 B
TypeScript
import React, { ReactNode } from 'react';
|
|
import FocusTrap from 'focus-trap-react';
|
|
import { Modal, Overlay, OverlayBackdrop, OverlayCenter } from 'folds';
|
|
import { stopPropagation } from '../utils/keyboard';
|
|
import { useModalStyle } from '../hooks/useModalStyle';
|
|
|
|
type Modal500Props = {
|
|
requestClose: () => void;
|
|
children: ReactNode;
|
|
};
|
|
export function Modal500({ requestClose, children }: Modal500Props) {
|
|
const modalStyle = useModalStyle(560);
|
|
return (
|
|
<Overlay open backdrop={<OverlayBackdrop />}>
|
|
<OverlayCenter>
|
|
<FocusTrap
|
|
focusTrapOptions={{
|
|
initialFocus: false,
|
|
clickOutsideDeactivates: true,
|
|
onDeactivate: requestClose,
|
|
escapeDeactivates: stopPropagation,
|
|
}}
|
|
>
|
|
<Modal size="500" variant="Background" style={modalStyle}>
|
|
{children}
|
|
</Modal>
|
|
</FocusTrap>
|
|
</OverlayCenter>
|
|
</Overlay>
|
|
);
|
|
}
|