Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ddfform 70 (WIP) #381

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {}
Loading