correcition

This commit is contained in:
Romain committed 2026-10-02 20:51:12 +02:00
1 parent d723078d89
commit 1dde1311a3
15 files changed
+100 -55

No files matched your search

+3 -6
View File
@@ -1,18 +1,15 @@
import { X } from 'lucide-react'
import { useEffect, type ReactNode } from 'react'
import { t } from '../../i18n'
import { useScrollLock } from '../../lib/scrollLock'
/** É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 }) {
useScrollLock()
useEffect(() => {
const prev = document.body.style.overflow
document.body.style.overflow = 'hidden'
const onKey = (e: KeyboardEvent) => e.key === 'Escape' && onClose()
window.addEventListener('keydown', onKey)
return () => {
document.body.style.overflow = prev
window.removeEventListener('keydown', onKey)
}
return () => window.removeEventListener('keydown', onKey)
}, [onClose])
return (
<div className="sheet-in fixed inset-0 z-50 flex flex-col bg-bg" role="dialog" aria-modal="true" aria-label={label}>