From 83057c2bbb7a21990ea13bc9b5e5b770d0f6bc43 Mon Sep 17 00:00:00 2001 From: Gunnar Torfi Date: Tue, 10 Dec 2024 10:00:32 +0000 Subject: [PATCH] chore: use animation duration constant --- src/toaster.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/toaster.tsx b/src/toaster.tsx index 37d10f2..2fce846 100644 --- a/src/toaster.tsx +++ b/src/toaster.tsx @@ -14,6 +14,7 @@ import { type ToastRef, } from './types'; import { areToastsEqual } from './toast-comparator'; +import { ANIMATION_DURATION } from './animations'; let addToastHandler: AddToastContextHandler; let dismissToastHandler: typeof toast.dismiss; @@ -37,7 +38,7 @@ export const Toaster: React.FC = ({ // let the animation finish const timeout = setTimeout(() => { setToastsVisible(false); - }, 300); + }, ANIMATION_DURATION); return () => clearTimeout(timeout); }, [toasts.length]);