From 5324664e87bedfaa01ba62c0c847ef5b861e69b3 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 26 Apr 2022 18:16:00 +0200 Subject: chore: add a Feed icon component --- src/components/atoms/icons/feed.module.scss | 6 +++ src/components/atoms/icons/feed.stories.tsx | 34 +++++++++++++ src/components/atoms/icons/feed.test.tsx | 9 ++++ src/components/atoms/icons/feed.tsx | 74 +++++++++++++++++++++++++++++ 4 files changed, 123 insertions(+) create mode 100644 src/components/atoms/icons/feed.module.scss create mode 100644 src/components/atoms/icons/feed.stories.tsx create mode 100644 src/components/atoms/icons/feed.test.tsx create mode 100644 src/components/atoms/icons/feed.tsx (limited to 'src') diff --git a/src/components/atoms/icons/feed.module.scss b/src/components/atoms/icons/feed.module.scss new file mode 100644 index 0000000..56a5253 --- /dev/null +++ b/src/components/atoms/icons/feed.module.scss @@ -0,0 +1,6 @@ +@use "@styles/abstracts/functions" as fun; + +.icon { + display: block; + width: var(--icon-size, #{fun.convert-px(40)}); +} diff --git a/src/components/atoms/icons/feed.stories.tsx b/src/components/atoms/icons/feed.stories.tsx new file mode 100644 index 0000000..e3587a8 --- /dev/null +++ b/src/components/atoms/icons/feed.stories.tsx @@ -0,0 +1,34 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react'; +import FeedIcon from './feed'; + +/** + * Feed icon - Storybook Meta + */ +export default { + title: 'Atoms/Illustrations/Icons', + component: FeedIcon, + argTypes: { + className: { + control: { + type: 'text', + }, + description: 'Set additional classnames.', + table: { + category: 'Styles', + }, + type: { + name: 'string', + required: false, + }, + }, + }, +} as ComponentMeta; + +const Template: ComponentStory = (args) => ( + +); + +/** + * Icons Stories - Feed + */ +export const Feed = Template.bind({}); diff --git a/src/components/atoms/icons/feed.test.tsx b/src/components/atoms/icons/feed.test.tsx new file mode 100644 index 0000000..fed9da9 --- /dev/null +++ b/src/components/atoms/icons/feed.test.tsx @@ -0,0 +1,9 @@ +import { render } from '@test-utils'; +import Feed from './feed'; + +describe('Feed', () => { + it('renders a feed icon', () => { + const { container } = render(); + expect(container).toBeDefined(); + }); +}); diff --git a/src/components/atoms/icons/feed.tsx b/src/components/atoms/icons/feed.tsx new file mode 100644 index 0000000..6839abd --- /dev/null +++ b/src/components/atoms/icons/feed.tsx @@ -0,0 +1,74 @@ +import { FC } from 'react'; +import styles from './feed.module.scss'; + +export type FeedProps = { + /** + * Set additional classnames to the icon. + */ + className?: string; +}; + +/** + * Feed Component + * + * Render a feed svg icon. + */ +const Feed: FC = ({ className = '' }) => { + return ( + + + + + + + + + + + + + + + + + + + + ); +}; + +export default Feed; -- cgit v1.2.3