favycon/components/button/index.tsx
Rui Saraiva 785563a71c
feat: upgrade dependencies (#480)
* feat: upgrade dependencies

* chore: update linter and CI workflows

* chore: upgrade browserslist
2021-12-04 18:32:53 +00:00

32 lines
904 B
TypeScript

import PropTypes from 'prop-types'
import classNames from 'classnames'
import styles from './index.module.scss'
export type ButtonProps = {
children: PropTypes.ReactNodeLike
variant: 'primary' | 'transparent' | 'regularTransparent' | 'modalClose'
weight: 'regular' | 'medium' | 'semiBold' | 'bold'
color: 'black' | 'gray' | 'white' | 'link'
background: 'bgLink' | 'bgGreen' | 'bgDarkGray'
} & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>
const Button = ({ children, variant, weight, color, background, ...props }: ButtonProps) => {
const className = classNames(styles[variant], styles[weight], styles[color], styles[background], props.className)
return (
<button {...props} className={className}>
{children}
</button>
)
}
Button.defaultProps = {
variant: 'primary',
weight: 'bold',
color: 'black',
background: '',
}
export { Button }