This commit is contained in:
fahed
2026-02-23 11:57:32 +03:00
parent 4522edeea8
commit 8436c49142
50 changed files with 6447 additions and 55 deletions

View File

@@ -20,7 +20,10 @@ export function ToastProvider({ children }) {
}, [])
const removeToast = useCallback((id) => {
setToasts(prev => prev.filter(t => t.id !== id))
setToasts(prev => prev.map(t => t.id === id ? { ...t, exiting: true } : t))
setTimeout(() => {
setToasts(prev => prev.filter(t => t.id !== id))
}, 300)
}, [])
const toast = {
@@ -42,6 +45,7 @@ export function ToastProvider({ children }) {
message={t.message}
type={t.type}
duration={t.duration}
exiting={t.exiting}
onClose={() => removeToast(t.id)}
/>
))}