Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
rasben committed Dec 11, 2023
1 parent 89f3a1a commit 3ef46e2
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/stories/Library/media/Media.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { withDesign } from "storybook-addon-designs";
import { ComponentMeta, ComponentStory } from "@storybook/react";

import { Media } from "./Media";

Check warning on line 4 in src/stories/Library/media/Media.stories.tsx

View workflow job for this annotation

GitHub Actions / JS Linter

'Media' is defined but never used

export default {
title: "Library / Medias",
component: Medias,
decorators: [withDesign],
argTypes: {},
parameters: {
design: {
type: "figma",
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?type=design&node-id=7477-39100&mode=design&t=sPixP2kXWpSn7p74-4",
},
},
} as ComponentMeta<typeof Medias>;

const Template: ComponentStory<typeof Medias> = (args) => (

Check warning on line 19 in src/stories/Library/media/Media.stories.tsx

View workflow job for this annotation

GitHub Actions / JS Linter

'Template' is assigned a value but never used

Check failure on line 19 in src/stories/Library/media/Media.stories.tsx

View workflow job for this annotation

GitHub Actions / JS Linter

Replace `(⏎··<Medias·{...args}·/>⏎)` with `<Medias·{...args}·/>`
<Medias {...args} />

Check failure on line 20 in src/stories/Library/media/Media.stories.tsx

View workflow job for this annotation

GitHub Actions / JS Linter

'Medias' is not defined
);
22 changes: 22 additions & 0 deletions src/stories/Library/media/Media.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";

export type MediaProps = {
imageUrl?: string;
altText?: string;
byline?: string;
};

const Media: React.FunctionComponent<MediaProps> = ({
imageUrl,
byline,
altText,
}) => {
return (
<figure className="media">
<img src={imageUrl} alt={altText} />
{byline ?? <figcaption>{byline}</figcaption>}
</figure>
);
};

export default Media;
1 change: 1 addition & 0 deletions src/stories/Library/media/media.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.media {}
21 changes: 21 additions & 0 deletions src/stories/Library/medias/Medias.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { withDesign } from "storybook-addon-designs";
import { ComponentMeta, ComponentStory } from "@storybook/react";

import { Medias } from "./Medias";

export default {
title: "Library / Medias",
component: Medias,
decorators: [withDesign],
argTypes: {},
parameters: {
design: {
type: "figma",
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?type=design&node-id=7477-39100&mode=design&t=sPixP2kXWpSn7p74-4",
},
},
} as ComponentMeta<typeof Medias>;

const Template: ComponentStory<typeof Medias> = (args) => (

Check warning on line 19 in src/stories/Library/medias/Medias.stories.tsx

View workflow job for this annotation

GitHub Actions / JS Linter

'Template' is assigned a value but never used

Check failure on line 19 in src/stories/Library/medias/Medias.stories.tsx

View workflow job for this annotation

GitHub Actions / JS Linter

Replace `(⏎··<Medias·{...args}·/>⏎)` with `<Medias·{...args}·/>`
<Medias {...args} />
);
18 changes: 18 additions & 0 deletions src/stories/Library/medias/Medias.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import Media from "../media/Media";

export type MediasProps = {
mediaItems?: Array<typeof Media>;
};

const Medias: React.FunctionComponent<MediasProps> = ({ mediaItems }) => {
return (
<div class="medias">

Check failure on line 10 in src/stories/Library/medias/Medias.tsx

View workflow job for this annotation

GitHub Actions / JS Linter

Unknown property 'class' found, use 'className' instead
{mediaItems.map((media) => (

Check warning on line 11 in src/stories/Library/medias/Medias.tsx

View workflow job for this annotation

GitHub Actions / JS Linter

'media' is defined but never used
<Media />
))}
</div>
);
};

export default Medias;
1 change: 1 addition & 0 deletions src/stories/Library/medias/medias.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.medias {}

0 comments on commit 3ef46e2

Please sign in to comment.