docbrown/app/javascript/Snackbar/__stories__/Snackbar.stories.jsx
Nick Taylor c83cad6fb6
Sorting Storybook stories (#8058)
* Added story sorting to Storybook.

* Added design system guidelines.

* Made Base in Storybook tree 2nd in the tree view.

* Now Components are 3rd in the treeview of Storybook.

* Now App Components are 4th in the treeview of Storybook.

* Froze node version to 12.16.0

* Revert "Froze node version to 12.16.0"

This reverts commit 093b119c7d7ca05ecb4e1c0234b24bcf8e7b10a4.
2020-05-27 13:10:16 -04:00

50 lines
1.1 KiB
JavaScript

import { h } from 'preact';
import { action } from '@storybook/addon-actions';
import faker from 'faker';
import { number } from '@storybook/addon-knobs';
import { Snackbar, addSnackbarItem } from '..';
export default {
title: '4_App Components/Snackbar/Snackbar',
};
export const SimulateAddingSnackbarItems = () => {
addSnackbarItem({
message: faker.hacker.phrase(),
actions: [
{ text: faker.lorem.word(), handler: action('action 1 clicked') },
],
});
addSnackbarItem({
message: faker.hacker.phrase(),
actions: [
{ text: faker.lorem.word(), handler: action('action 2 clicked') },
],
});
addSnackbarItem({
message: faker.hacker.phrase(),
actions: [
{ text: faker.lorem.word(), handler: action('action 3 clicked') },
],
});
addSnackbarItem({
message: faker.hacker.phrase(),
actions: [
{ text: faker.lorem.word(), handler: action('action 3 clicked') },
],
});
return (
<Snackbar
lifespan={number('lifespan', 5)}
pollingTime={number('pollingTime', 300)}
/>
);
};
SimulateAddingSnackbarItems.story = {
name: 'simulating adding multiple snackbar items',
};