Skip to content

Commit 5cd1ba8

Browse files
feat(story): add mailto
1 parent fc53aa2 commit 5cd1ba8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/components/molecules/Mailto/Mailto.stories.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@ import React from 'react'
22

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

5+
import { withRouter } from 'src/hooks/router'
6+
57
import { Mailto, MailtoProps } from './Mailto'
68

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

12-
const Template: ComponentStory<React.ComponentType<MailtoProps>> = args => <Mailto {...args} />
14+
const Template: ComponentStory<React.ComponentType<MailtoProps>> = args => withRouter(<Mailto {...args} />)
1315

1416
export const Primary = Template.bind({})
15-
Primary.args = {}
17+
Primary.args = {
18+
mailto: '[email protected]',
19+
label: 'support'
20+
}

src/hooks/router.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React from 'react'
2+
3+
import { BrowserRouter } from 'react-router-dom'
4+
5+
export const withRouter = (children: React.ReactNode) => <BrowserRouter>{children}</BrowserRouter>

0 commit comments

Comments
 (0)