summaryrefslogtreecommitdiffstats
path: root/src/components/organisms/images/gallery.stories.tsx
blob: 786cfff49f32c52825824dcaa0fa37dacf249ea3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import ResponsiveImage from '@components/molecules/images/responsive-image';
import { ComponentMeta, ComponentStory } from '@storybook/react';
import Gallery from './gallery';

/**
 * Gallery - Storybook Meta
 */
export default {
  title: 'Organisms/Images/Gallery',
  component: Gallery,
  argTypes: {
    children: {
      control: {
        type: null,
      },
      description: 'Two or more ResponsiveImage component.',
      type: {
        name: 'function',
        required: true,
      },
    },
    columns: {
      control: {
        type: 'number',
        min: 2,
        max: 4,
      },
      description: 'The columns count.',
      type: {
        name: 'number',
        required: true,
      },
    },
  },
} as ComponentMeta<typeof Gallery>;

const image = {
  alt: 'Modi provident omnis',
  height: 480,
  src: 'http://placeimg.com/640/480/fashion',
  width: 640,
};

const Template: ComponentStory<typeof Gallery> = (args) => (
  <Gallery {...args}>
    <ResponsiveImage unoptimized {...image} />
    <ResponsiveImage unoptimized {...image} />
    <ResponsiveImage unoptimized {...image} />
    <ResponsiveImage unoptimized {...image} />
  </Gallery>
);

/**
 * Gallery Stories - Two columns
 */
export const TwoColumns = Template.bind({});
TwoColumns.args = {
  columns: 2,
};

/**
 * Gallery Stories - Three columns
 */
export const ThreeColumns = Template.bind({});
ThreeColumns.args = {
  columns: 3,
};

/**
 * Gallery Stories - Four columns
 */
export const FourColumns = Template.bind({});
FourColumns.args = {
  columns: 4,
};