Skip to content

Commit

Permalink
fixup! fixup! fixup! Feat(web-react): Add autoclose feature to Toast …
Browse files Browse the repository at this point in the history
…component
  • Loading branch information
pavelklibani committed May 20, 2024
1 parent 8718bcc commit 50e912d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -85,7 +85,7 @@ const meta: Meta<UncontrolledToastPlaygroundProps> = {
iconName: '',
isCollapsible: true,
enableAutoClose: true,
autoCloseInterval: TOAST_AUTOCLOSE_TIMEOUT,
autoCloseInterval: TOAST_AUTO_CLOSE_INTERVAL,
},
};

Expand Down

0 comments on commit 50e912d

Please sign in to comment.