From c1b6d057ba810705789e02e45f32ad29ce383954 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 1 Apr 2022 11:25:56 +0200 Subject: chore: add a Cog icon component --- src/components/atoms/icons/cog.module.scss | 9 +++++++++ src/components/atoms/icons/cog.stories.tsx | 13 +++++++++++++ src/components/atoms/icons/cog.test.tsx | 9 +++++++++ src/components/atoms/icons/cog.tsx | 22 ++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 src/components/atoms/icons/cog.module.scss create mode 100644 src/components/atoms/icons/cog.stories.tsx create mode 100644 src/components/atoms/icons/cog.test.tsx create mode 100644 src/components/atoms/icons/cog.tsx (limited to 'src/components/atoms') diff --git a/src/components/atoms/icons/cog.module.scss b/src/components/atoms/icons/cog.module.scss new file mode 100644 index 0000000..8c48fcc --- /dev/null +++ b/src/components/atoms/icons/cog.module.scss @@ -0,0 +1,9 @@ +@use "@styles/abstracts/functions" as fun; + +.icon { + display: block; + width: var(--icon-size, #{fun.convert-px(40)}); + fill: var(--color-primary-lighter); + stroke: var(--color-primary-darker); + stroke-width: 4; +} diff --git a/src/components/atoms/icons/cog.stories.tsx b/src/components/atoms/icons/cog.stories.tsx new file mode 100644 index 0000000..3b16ffc --- /dev/null +++ b/src/components/atoms/icons/cog.stories.tsx @@ -0,0 +1,13 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react'; +import CogIcon from './cog'; + +export default { + title: 'Atoms/Icons', + component: CogIcon, +} as ComponentMeta; + +const Template: ComponentStory = (args) => ( + +); + +export const Cog = Template.bind({}); diff --git a/src/components/atoms/icons/cog.test.tsx b/src/components/atoms/icons/cog.test.tsx new file mode 100644 index 0000000..89090fa --- /dev/null +++ b/src/components/atoms/icons/cog.test.tsx @@ -0,0 +1,9 @@ +import { render } from '@test-utils'; +import Cog from './cog'; + +describe('Cog', () => { + it('renders a Cog icon', () => { + const { container } = render(); + expect(container).toBeDefined(); + }); +}); diff --git a/src/components/atoms/icons/cog.tsx b/src/components/atoms/icons/cog.tsx new file mode 100644 index 0000000..bed19ce --- /dev/null +++ b/src/components/atoms/icons/cog.tsx @@ -0,0 +1,22 @@ +import { FC } from 'react'; +import styles from './cog.module.scss'; + +/** + * Cog component + * + * Render a cog svg icon. + */ +const Cog: FC = () => { + return ( + + + + + ); +}; + +export default Cog; -- cgit v1.2.3