fix(ux-audit): landing next/image + confirm AlertDialog + search-modal i18n
Some checks failed
CI / Deploy production (on server) (push) Has been cancelled
CI / Lint, Unit Tests & Build (push) Has been cancelled

Landing page:
- <img> → next/image avec width/height (CLS fix)
- padding nav responsive px-4 sm:px-8

note-card:
- confirm() natif → AlertDialog (non-bloquant, stylable)
- showLeaveDialog state + dialog component

search-modal (20 chaînes FR → i18n):
- useLanguage ajouté
- 20 strings FR hardcoded → t('searchModal.*')
- Clés ajoutées dans en.json + fr.json
This commit is contained in:
Antigravity
2026-07-04 21:49:24 +00:00
parent e72ca26f97
commit 03a3fb7411
5 changed files with 94 additions and 29 deletions

View File

@@ -185,6 +185,7 @@ export const NoteCard = memo(function NoteCard({
const [isDeleting, setIsDeleting] = useState(false)
const [isHidden, setIsHidden] = useState(false)
const [showDeleteDialog, setShowDeleteDialog] = useState(false)
const [showLeaveDialog, setShowLeaveDialog] = useState(false)
const [showCollaboratorDialog, setShowCollaboratorDialog] = useState(false)
const [collaborators, setCollaborators] = useState<any[]>([])
const [owner, setOwner] = useState<any>(null)
@@ -408,14 +409,13 @@ export const NoteCard = memo(function NoteCard({
}
const handleLeaveShare = async () => {
if (confirm(t('notes.confirmLeaveShare'))) {
try {
await leaveSharedNote(note.id)
setIsDeleting(true) // Hide the note from view
} catch (error) {
console.error('Failed to leave share:', error)
}
try {
await leaveSharedNote(note.id)
setIsDeleting(true)
} catch (error) {
console.error('Failed to leave share:', error)
}
setShowLeaveDialog(false)
}
const handleRemoveFusedBadge = async (e: React.MouseEvent) => {
@@ -657,7 +657,7 @@ export const NoteCard = memo(function NoteCard({
className="h-6 px-2 text-xs text-gray-500 hover:text-red-600 dark:hover:text-red-400"
onClick={(e) => {
e.stopPropagation()
handleLeaveShare()
setShowLeaveDialog(true)
}}
>
<LogOut className="h-3 w-3 me-1" />
@@ -885,6 +885,24 @@ export const NoteCard = memo(function NoteCard({
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
{/* Leave Share Confirmation Dialog */}
<AlertDialog open={showLeaveDialog} onOpenChange={setShowLeaveDialog}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>{t('notes.leaveShare')}</AlertDialogTitle>
<AlertDialogDescription>
{t('notes.confirmLeaveShare')}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>{t('common.cancel')}</AlertDialogCancel>
<AlertDialogAction variant="destructive" onClick={handleLeaveShare}>
{t('notes.leaveShare')}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</Card>
)
})