Skip to content

Commit

Permalink
feat: Footer stories
Browse files Browse the repository at this point in the history
  • Loading branch information
meissadia committed Jun 23, 2023
1 parent 16a58f5 commit 143efec
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion src/components/Footer/Footer.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react';
import { Icon } from '../Icon/Icon';
import Footer from './Footer';
import { FooterCfGov } from './FooterCFGOV';

const meta: Meta<typeof Footer> = {
component: Footer,
Expand All @@ -10,6 +12,45 @@ export default meta;

type Story = StoryObj<typeof meta>;

const makeLink = (label: string, isExternal?: boolean): JSX.Element => (
<a
key={label}
href={window.location.href}
className={`m-list_link a-link ${isExternal ? 'a-link__icon' : ''}`}
>
<span className='a-link_text'>{label}</span>
{isExternal ? <Icon name='external-link' alt='External link' /> : null}
</a>
);

const makeSocialLink = (label: string): JSX.Element => (
<a key={label} href={window.location.href}>
<Icon name={label} withBg />
</a>
);

export const Example: Story = {
args: {
navLinks: [makeLink('Nav 1'), makeLink('Nav 2'), makeLink('Nav 3')],
socialLinks: [makeSocialLink('facebook'), makeSocialLink('youtube')],
linksCol1: [
makeLink('Col1 Link 1'),
makeLink('Col1 Link 2'),
makeLink('Col1 Link 3')
],
linksCol2: [
makeLink('Col2 Link 1'),
makeLink('Col2 Link 2'),
makeLink('Col2 Link 3')
],
linksCol3: [
makeLink('Col3 Link 1', true),
makeLink('Col3 Link 2', true),
makeLink('Col3 Link 3', true)
]
}
};

export const CFGov: Story = {
args: {}
render: () => <FooterCfGov />
};

0 comments on commit 143efec

Please sign in to comment.