mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-04 22:40:29 +03:00
Add bottom sheet menu in
This commit is contained in:
parent
511a16eedc
commit
460d77d40c
1 changed files with 54 additions and 0 deletions
|
|
@ -285,3 +285,57 @@ export function MessageOptionsMenu({
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function BottomSheetMenu({
|
||||
isOpen,
|
||||
onClose,
|
||||
children,
|
||||
}: {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
style={{ position: 'fixed', inset: 0, zIndex: 1000, pointerEvents: isOpen ? 'auto' : 'none' }}
|
||||
>
|
||||
<div
|
||||
className={classNames(css.menuBackdrop, { [css.menuBackdropOpen]: isOpen })}
|
||||
onClick={onClose}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<div
|
||||
className={classNames(css.menuSheet, { [css.menuSheetOpen]: isOpen })}
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function MenuItemButton({
|
||||
label,
|
||||
onClick,
|
||||
destructive = false,
|
||||
}: {
|
||||
label: string;
|
||||
onClick: () => void;
|
||||
destructive?: boolean;
|
||||
}) {
|
||||
return (
|
||||
<Box
|
||||
as="button"
|
||||
onClick={onClick}
|
||||
alignItems="Center"
|
||||
gap="400"
|
||||
className={classNames(css.menuItem, { [css.menuItemDestructive]: destructive })}
|
||||
>
|
||||
<Icon src={Icons.Alphabet} size="100" />
|
||||
<Text size="B300" style={{ color: 'inherit' }}>
|
||||
{label}
|
||||
</Text>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue