Skip to content

Commit

Permalink
chore: update stories
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanluongoe committed Jan 9, 2024
1 parent 39ef7b6 commit 69f1ed3
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions src/stories/Toast.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,63 @@ export const GeneralOptions: StoryFn<typeof Toaster> = () => {
</div>
);
};

export const CustomViewport: StoryFn<typeof Toaster> = () => {
const [count, setCount] = useState(0);

return (
<div>
<Toaster
toastOptions={{
viewportStyle: {
border: '1px solid red',
},
viewportClassName: 'custom-viewport',
}}
/>
<button
type="button"
onClick={() => {
toast({
title: `Scheduled: Catch up ${count}`,
description:
'Friday, February 10, 2023 at 5:57 PM, lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, voluptatum.',
duration: 60 * 1000,
});
setCount((prev) => prev + 1);
}}
>
Show Toast
</button>
</div>
);
};

export const CustomClassName: StoryFn<typeof Toaster> = () => {
const [count, setCount] = useState(0);

return (
<div>
<Toaster
toastOptions={{
className: 'abc',
}}
/>
<button
type="button"
onClick={() => {
toast({
title: `Scheduled: Catch up ${count}`,
description:
'Friday, February 10, 2023 at 5:57 PM, lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, voluptatum.',
duration: 60 * 1000,
className: 'def',
});
setCount((prev) => prev + 1);
}}
>
Show Toast
</button>
</div>
);
};

0 comments on commit 69f1ed3

Please sign in to comment.