Skip to content

Commit

Permalink
feat(mailto): extend classNames
Browse files Browse the repository at this point in the history
  • Loading branch information
the-homeless-god committed Apr 20, 2022
1 parent 1231d6d commit 39986c1
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/components/molecules/Mailto/Mailto.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
import React from 'react'

import cx from 'classnames'

import css from './Mailto.styles.module.scss'

export type MailtoProps = {
mailto: string
label: string
title: string

// Extend props
classNameMailto?: string
classNameTitle?: string
classNameLabel?: string
}

export const Mailto = ({ mailto, label, title }: MailtoProps) => {
export const Mailto = ({ mailto, label, title, classNameLabel, classNameMailto, classNameTitle }: MailtoProps) => {
return (
<div className={css.mailto}>
<p className={css.title}>{title}</p>
// TODO: Change className `mailto` to `container`
<div className={cx(css.mailto, classNameMailto)}>
{/* TODO: Add prefix for classes: mailtoTitle */}
<p className={cx(css.title, classNameTitle)}>{title}</p>
<a
href="#"
onClick={event => {
window.location.href = mailto
event.preventDefault()
}}
className={css.label}
// TODO: Add prefix for classes: mailtoLabel
className={cx(css.label, classNameLabel)}
>
{label}
</a>
Expand Down

0 comments on commit 39986c1

Please sign in to comment.