-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c844474
commit fc53aa2
Showing
5 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react' | ||
|
||
import { ComponentStory, ComponentMeta } from '@storybook/react' | ||
|
||
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} /> | ||
|
||
export const Primary = Template.bind({}) | ||
Primary.args = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@import 'src/scss/mixins'; | ||
|
||
.mailto { | ||
@include flex-center; | ||
|
||
margin: 15px 12px; | ||
|
||
@include mobile { | ||
width: 100%; | ||
justify-content: left; | ||
padding-left: 8px; | ||
} | ||
} | ||
|
||
.title { | ||
color: $color-light; | ||
font-weight: 500; | ||
} | ||
|
||
.title, | ||
.label { | ||
font-size: 22px; | ||
line-height: 50px; | ||
} | ||
|
||
.label { | ||
color: $color-base; | ||
padding-left: 10px; | ||
font-weight: 500; | ||
|
||
&:hover { | ||
color: $color-light-gray; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react' | ||
|
||
import { Link } from 'react-router-dom' | ||
|
||
import css from './Mailto.styles.module.scss' | ||
|
||
export type MailtoProps = { | ||
mailto: string | ||
label: string | ||
title: string | ||
} | ||
|
||
export const Mailto = ({ mailto, label, title }: MailtoProps) => { | ||
return ( | ||
<div className={css.mailto}> | ||
<p className={css.title}>{title}</p> | ||
<Link | ||
to="#" | ||
onClick={event => { | ||
window.location.href = mailto | ||
event.preventDefault() | ||
}} | ||
className={css.label} | ||
> | ||
{label} | ||
</Link> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Mailto' |