summaryrefslogtreecommitdiffstats
path: root/src/components/organisms/widgets/sharing.stories.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-15 17:13:21 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-15 17:40:40 +0200
commita07729064790df13324dbe7f4d1629892070558b (patch)
tree25a4bc6cc4386f35270e0fd3b633e909e6bcf853 /src/components/organisms/widgets/sharing.stories.tsx
parentd9bf6f0d69ecb4475c06c772ef6314e5a7ee0fe8 (diff)
chore: add a SharingWidget component
Diffstat (limited to 'src/components/organisms/widgets/sharing.stories.tsx')
-rw-r--r--src/components/organisms/widgets/sharing.stories.tsx78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/components/organisms/widgets/sharing.stories.tsx b/src/components/organisms/widgets/sharing.stories.tsx
new file mode 100644
index 0000000..be20b84
--- /dev/null
+++ b/src/components/organisms/widgets/sharing.stories.tsx
@@ -0,0 +1,78 @@
+import { ComponentMeta, ComponentStory } from '@storybook/react';
+import { IntlProvider } from 'react-intl';
+import SharingWidget from './sharing';
+
+export default {
+ title: 'Organisms/Widgets',
+ component: SharingWidget,
+ argTypes: {
+ data: {
+ description: 'The page data.',
+ type: {
+ name: 'object',
+ required: true,
+ value: {},
+ },
+ },
+ expanded: {
+ control: {
+ type: null,
+ },
+ description: 'Default widget state (expanded or collapsed).',
+ type: {
+ name: 'boolean',
+ required: true,
+ },
+ },
+ level: {
+ control: {
+ type: 'number',
+ },
+ description: 'The heading level.',
+ type: {
+ name: 'number',
+ required: true,
+ },
+ },
+ media: {
+ control: {
+ type: null,
+ },
+ description: 'An array of active and ordered sharing medium.',
+ type: {
+ name: 'string',
+ required: true,
+ },
+ },
+ title: {
+ control: {
+ type: 'text',
+ },
+ description: 'The widget title.',
+ type: {
+ name: 'string',
+ required: true,
+ },
+ },
+ },
+} as ComponentMeta<typeof SharingWidget>;
+
+const Template: ComponentStory<typeof SharingWidget> = (args) => (
+ <IntlProvider locale="en">
+ <SharingWidget {...args} />
+ </IntlProvider>
+);
+
+export const Sharing = Template.bind({});
+Sharing.args = {
+ expanded: true,
+ data: {
+ excerpt:
+ 'Alias similique eius ducimus laudantium aspernatur. Est rem ut eum temporibus sit reprehenderit aut non molestias. Vel dolorem expedita labore quo inventore aliquid nihil nam. Possimus nobis enim quas corporis eos.',
+ title: 'Accusantium totam nostrum',
+ url: 'https://www.example.test',
+ },
+ level: 2,
+ media: ['diaspora', 'facebook', 'linkedin', 'twitter', 'email'],
+ title: 'Sharing',
+};