From 50e912d3ac534cab016e63dc698488fc60c6468c Mon Sep 17 00:00:00 2001 From: Pavel Klibani Date: Mon, 20 May 2024 09:45:14 +0200 Subject: [PATCH] fixup! fixup! fixup! Feat(web-react): Add autoclose feature to Toast component --- .../src/components/Toast/demo/ToastDynamicToastQueue.tsx | 4 ++-- .../components/Toast/stories/UncontrolledToast.stories.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/web-react/src/components/Toast/demo/ToastDynamicToastQueue.tsx b/packages/web-react/src/components/Toast/demo/ToastDynamicToastQueue.tsx index 705e152a6d..7c933fbbab 100644 --- a/packages/web-react/src/components/Toast/demo/ToastDynamicToastQueue.tsx +++ b/packages/web-react/src/components/Toast/demo/ToastDynamicToastQueue.tsx @@ -12,7 +12,7 @@ import Toast from '../Toast'; import ToastBar from '../ToastBar'; import { ToastItem, ToastProvider } from '../ToastContext'; import { useToast } from '../useToast'; -import { TOAST_AUTOCLOSE_TIMEOUT } from '../constants'; +import { TOAST_AUTO_CLOSE_INTERVAL } from '../constants'; const ToastDynamicToastQueue = () => { const [isCollapsible, setIsCollapsible] = useState(true); @@ -22,7 +22,7 @@ const ToastDynamicToastQueue = () => { const [hasIconValue, setHasIconValue] = useState(true); const [isDismissibleValue, setIsDismissibleValue] = useState(true); const [enableAutoCloseValue, setEnableAutoCloseValue] = useState(true); - const [autoCloseInterval, setAutoCloseInterval] = useState(TOAST_AUTOCLOSE_TIMEOUT); + const [autoCloseInterval, setAutoCloseInterval] = useState(TOAST_AUTO_CLOSE_INTERVAL); const [messageValue, setMessageValue] = useState('This is a new toast message.'); const { queue, show, hide, clear, setQueue } = useToast(); diff --git a/packages/web-react/src/components/Toast/stories/UncontrolledToast.stories.tsx b/packages/web-react/src/components/Toast/stories/UncontrolledToast.stories.tsx index 724f56d498..75abe72969 100644 --- a/packages/web-react/src/components/Toast/stories/UncontrolledToast.stories.tsx +++ b/packages/web-react/src/components/Toast/stories/UncontrolledToast.stories.tsx @@ -7,7 +7,7 @@ import { AlignmentX, EmotionColors } from '../../../constants'; import { ToastColorType, UncontrolledToastProps } from '../../../types'; import { Button } from '../../Button'; import ReadMe from '../README.md'; -import { TOAST_AUTOCLOSE_TIMEOUT } from '../constants'; +import { TOAST_AUTO_CLOSE_INTERVAL } from '../constants'; import { useToast } from '../useToast'; interface UncontrolledToastPlaygroundProps extends UncontrolledToastProps { @@ -85,7 +85,7 @@ const meta: Meta = { iconName: '', isCollapsible: true, enableAutoClose: true, - autoCloseInterval: TOAST_AUTOCLOSE_TIMEOUT, + autoCloseInterval: TOAST_AUTO_CLOSE_INTERVAL, }, };