Skip to content

Commit

Permalink
feat: migration of mailto
Browse files Browse the repository at this point in the history
  • Loading branch information
the-homeless-god committed Apr 1, 2022
1 parent c844474 commit fc53aa2
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 2 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@
"assets": [
"package.json",
"package-lock.json",
"CHANGELOG.md"
"CHANGELOG.md",
"src/scss/**/*.scss"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
Expand All @@ -147,7 +148,8 @@
"files": [
"README.md",
"LICENSE",
"dist"
"dist",
"src/scss"
],
"publishConfig": {
"registry": "https://npm.pkg.github.com",
Expand Down
15 changes: 15 additions & 0 deletions src/components/molecules/Mailto/Mailto.stories.tsx
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 = {}
34 changes: 34 additions & 0 deletions src/components/molecules/Mailto/Mailto.styles.module.scss
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;
}
}
29 changes: 29 additions & 0 deletions src/components/molecules/Mailto/Mailto.tsx
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>
)
}
1 change: 1 addition & 0 deletions src/components/molecules/Mailto/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Mailto'

0 comments on commit fc53aa2

Please sign in to comment.