docbrown/app/javascript/Snackbar/__stories__/SnackbarItem.stories.jsx
Lisa Sy ea00c808bd
Storybook: Add DocsPage and test out static content (#11397)
* Update naming of guidelines section and improve Introduction page

* Add Docs

* Add docs

* Install Docs add-on

- Rename top-level folders and sort manually
- Add MDX static pages

* Updated all Storybook addons to 6.1.3 except for notes as it's currently 5.3.21

* Fixed naming of section for the select component.

* Updated yarn.lock file.

* Added missing dependency @storybook/addon-docs

Co-authored-by: Nick Taylor <nick@dev.to>
2020-12-02 09:56:38 -08:00

40 lines
846 B
JavaScript

import { h } from 'preact';
import { action } from '@storybook/addon-actions';
import { SnackbarItem } from '../SnackbarItem';
export default {
title: 'App Components/Snackbar/SnackbarItem',
};
export const JustAMessage = () => (
<SnackbarItem message="File uploaded successfully" />
);
JustAMessage.story = {
name: 'message only',
};
export const WithOneAction = () => (
<SnackbarItem
message="Changes saved"
actions={[{ text: 'Undo', handler: action('save file retry') }]}
/>
);
WithOneAction.story = {
name: 'with one action',
};
export const WithActions = () => (
<SnackbarItem
message="Unable to save file"
actions={[
{ text: 'Retry', handler: action('save file retry') },
{ text: 'Abort', handler: action('abort file save') },
]}
/>
);
WithActions.story = {
name: 'with actions',
};