Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/molecules/Toast/Toast.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const meta: Meta<typeof Toast> = {
undefined: undefined,
withAction: {
onClick: fn(),
text: 'Undo',
text: 'Read more',
},
},
},
Expand Down
33 changes: 30 additions & 3 deletions src/providers/ToastProvider/ToastProvider.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,37 @@ function StoryComponent(args: ToastProps | string) {
const { showToast, hideAllToasts } = useToasts();
return (
<div
style={{ display: 'flex', gap: spacings.medium, position: 'relative' }}
style={{
display: 'flex',
flexDirection: 'column',
gap: spacings.large,
alignItems: 'center',
}}
>
<Button onClick={() => showToast(args)}>Show toast</Button>
<Button onClick={hideAllToasts}>Hide all</Button>
<div
style={{ display: 'flex', gap: spacings.medium, position: 'relative' }}
>
<Button onClick={() => showToast(args)}>Show toast</Button>
<Button onClick={hideAllToasts}>Hide all</Button>
</div>
{/* prettier-ignore */}
<pre>
<code style={{ width: '35rem' }}>
{
`// How to use the ToastProvider and useToasts hook
showToast('This is a toast title');
showToast({
title: 'This is a toast title',
description: 'This is a description',
variant: 'success',
duration: 10,
action: {
text: 'Read more',
onClick: () => void
};
Comment thread
mariush2 marked this conversation as resolved.
Comment thread
mariush2 marked this conversation as resolved.
});`}
</code>
</pre>
</div>
);
}
Expand Down
Loading