updates
This commit is contained in:
@@ -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)}
|
||||
/>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user