1 parent
d700543eba
commit
9612a7bfb2
7 files changed
+174
-57
No files matched your search
@@ -3,13 +3,14 @@ import { type ReactNode } from 'react'
|
||||
import { t } from '../../i18n'
|
||||
import { useScrollLock } from '../../lib/scrollLock'
|
||||
import { useEscape } from '../../lib/escape'
|
||||
import { cx } from '../../lib/utils'
|
||||
|
||||
/** Écran plein (profil, recherche…) avec en-tête et bouton fermer. */
|
||||
export default function Sheet({ title, onClose, right, children, label }: { title: ReactNode; onClose: () => void; right?: ReactNode; children: ReactNode; label: string }) {
|
||||
export default function Sheet({ title, onClose, right, children, label, elevated }: { title: ReactNode; onClose: () => void; right?: ReactNode; children: ReactNode; label: string; elevated?: boolean }) {
|
||||
useScrollLock()
|
||||
useEscape(onClose)
|
||||
return (
|
||||
<div className="sheet-in fixed inset-0 z-50 flex flex-col bg-bg" role="dialog" aria-modal="true" aria-label={label}>
|
||||
<div className={cx('sheet-in fixed inset-0 flex flex-col bg-bg', elevated ? 'z-[70]' : 'z-50')} role="dialog" aria-modal="true" aria-label={label}>
|
||||
<header className="safe-top border-b border-line">
|
||||
<div className="mx-auto flex max-w-2xl items-center gap-2 px-3 py-2.5">
|
||||
<button onClick={onClose} className="grid size-10 place-items-center rounded-full text-ink-2" aria-label={t('common.close')}>
|
||||
|
||||
Reference in new issue
Block a user