File
Blob: src/client/components/ui/mobile-drawer.tsx
| 1 | import type { ReactNode } from "react"; |
| 2 | |
| 3 | interface MobileDrawerProps { |
| 4 | open: boolean; |
| 5 | onClose: () => void; |
| 6 | children: ReactNode; |
| 7 | } |
| 8 | |
| 9 | export function MobileDrawer({ open, onClose, children }: MobileDrawerProps) { |
| 10 | return ( |
| 11 | <> |
| 12 | <div className="hidden md:contents">{children}</div> |
| 13 | {open && ( |
| 14 | <div className="fixed inset-0 z-[80] flex md:hidden" role="presentation" onClick={onClose}> |
| 15 | <div className="fixed inset-0 bg-zinc-950/60" aria-hidden="true" /> |
| 16 | <div className="animate-slide-up relative z-10 h-full bg-zinc-900" onClick={(e) => e.stopPropagation()}> |
| 17 | {children} |
| 18 | </div> |
| 19 | </div> |
| 20 | )} |
| 21 | </> |
| 22 | ); |
| 23 | } |