keepsafe rework & alert ajustments
All checks were successful
Deploy Sokko G / deploy (push) Successful in 7s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 7s
This commit is contained in:
parent
68005ef918
commit
2e6d8a2c0c
11 changed files with 129 additions and 45 deletions
|
|
@ -24,11 +24,16 @@ export function ConfirmModal({ title, message, confirmLabel = "Confirmer", cance
|
|||
);
|
||||
}
|
||||
|
||||
export function NotificationToast({ message, position = "right", onClose }) {
|
||||
export function NotificationToast({ id, message, onClose }) {
|
||||
useEffect(() => {
|
||||
const timeoutId = window.setTimeout(() => onClose(id), 120000);
|
||||
return () => window.clearTimeout(timeoutId);
|
||||
}, [id, onClose]);
|
||||
|
||||
return (
|
||||
<div className={`notification-toast is-${position === "left" ? "left" : "right"}`} role="status" aria-live="polite">
|
||||
<div className="notification-toast" role="status">
|
||||
<span>{message}</span>
|
||||
<button type="button" onClick={onClose} aria-label="Fermer l'alerte" title="Fermer">
|
||||
<button type="button" onClick={() => onClose(id)} aria-label="Fermer l'alerte" title="Fermer">
|
||||
<Icon name="close" />
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue