aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/widgets/image-widget.stories.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-13 18:46:31 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-13 18:53:15 +0100
commite331106e56d59a8b987230860b66214139c12ef6 (patch)
tree18b595ddd86089b405e9517cd3efc72e2f17a1ab /src/components/organisms/widgets/image-widget.stories.tsx
parent56878f647ea0f1066fa3e222d7aa0d83057f496d (diff)
refactor(components): rewrite ImageWidget component
* remove `imageClassName` prop * replace `image` prop with `img` and expect an image instead of an object * remove `alignment prop` * remove useless CSS
Diffstat (limited to 'src/components/organisms/widgets/image-widget.stories.tsx')
-rw-r--r--src/components/organisms/widgets/image-widget.stories.tsx158
1 files changed, 0 insertions, 158 deletions
diff --git a/src/components/organisms/widgets/image-widget.stories.tsx b/src/components/organisms/widgets/image-widget.stories.tsx
deleted file mode 100644
index e9857bf..0000000
--- a/src/components/organisms/widgets/image-widget.stories.tsx
+++ /dev/null
@@ -1,158 +0,0 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
-import { Heading } from '../../atoms';
-import { ImageWidget } from './image-widget';
-
-/**
- * ImageWidget - Storybook Meta
- */
-export default {
- title: 'Organisms/Widgets/Image',
- component: ImageWidget,
- args: {
- alignment: 'left',
- },
- argTypes: {
- alignment: {
- control: {
- type: 'select',
- },
- description: 'The content alignment.',
- options: ['left', 'center', 'right'],
- table: {
- category: 'Options',
- defaultValue: { summary: 'left' },
- },
- type: {
- name: 'string',
- required: false,
- },
- },
- className: {
- control: {
- type: 'text',
- },
- description: 'Set additional classnames to the widget wrapper.',
- table: {
- category: 'Styles',
- },
- type: {
- name: 'string',
- required: false,
- },
- },
- description: {
- control: {
- type: 'text',
- },
- description: 'Add a caption image.',
- table: {
- category: 'Options',
- },
- type: {
- name: 'string',
- required: false,
- },
- },
- image: {
- description: 'An image object.',
- type: {
- name: 'object',
- required: true,
- value: {},
- },
- },
- imageClassName: {
- control: {
- type: 'text',
- },
- description: 'Set additional classnames to the image wrapper.',
- table: {
- category: 'Styles',
- },
- type: {
- name: 'string',
- required: false,
- },
- },
- url: {
- control: {
- type: 'text',
- },
- description: 'Add a link to the image.',
- table: {
- category: 'Options',
- },
- type: {
- name: 'string',
- required: false,
- },
- },
- },
-} as ComponentMeta<typeof ImageWidget>;
-
-const Template: ComponentStory<typeof ImageWidget> = (args) => (
- <ImageWidget {...args} />
-);
-
-const image = {
- alt: 'Et perferendis quaerat',
- height: 480,
- src: 'http://picsum.photos/640/480',
- width: 640,
-};
-
-/**
- * ImageWidget Stories - Align left
- */
-export const AlignLeft = Template.bind({});
-AlignLeft.args = {
- alignment: 'left',
- heading: (
- <Heading isFake level={3}>
- Quo et totam
- </Heading>
- ),
- image,
-};
-
-/**
- * ImageWidget Stories - Align center
- */
-export const AlignCenter = Template.bind({});
-AlignCenter.args = {
- alignment: 'center',
- heading: (
- <Heading isFake level={3}>
- Quo et totam
- </Heading>
- ),
- image,
-};
-
-/**
- * ImageWidget Stories - Align right
- */
-export const AlignRight = Template.bind({});
-AlignRight.args = {
- alignment: 'right',
- heading: (
- <Heading isFake level={3}>
- Quo et totam
- </Heading>
- ),
- image,
-};
-
-/**
- * ImageWidget Stories - With description
- */
-export const WithDescription = Template.bind({});
-WithDescription.args = {
- description: 'Sint enim harum',
- heading: (
- <Heading isFake level={3}>
- Quo et totam
- </Heading>
- ),
- image,
-};