Skip to content

Commit

Permalink
feat(story): add mailto
Browse files Browse the repository at this point in the history
  • Loading branch information
the-homeless-god committed Apr 1, 2022
1 parent fc53aa2 commit 5cd1ba8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/molecules/Mailto/Mailto.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@ import React from 'react'

import { ComponentStory, ComponentMeta } from '@storybook/react'

import { withRouter } from 'src/hooks/router'

import { Mailto, MailtoProps } from './Mailto'

export default {
title: 'molecules/Mailto',
component: Mailto
} as ComponentMeta<React.ComponentType<MailtoProps>>

const Template: ComponentStory<React.ComponentType<MailtoProps>> = args => <Mailto {...args} />
const Template: ComponentStory<React.ComponentType<MailtoProps>> = args => withRouter(<Mailto {...args} />)

export const Primary = Template.bind({})
Primary.args = {}
Primary.args = {
mailto: '[email protected]',
label: 'support'
}
5 changes: 5 additions & 0 deletions src/hooks/router.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react'

import { BrowserRouter } from 'react-router-dom'

export const withRouter = (children: React.ReactNode) => <BrowserRouter>{children}</BrowserRouter>

0 comments on commit 5cd1ba8

Please sign in to comment.