2021-04-26 07:22:30 -07:00
|
|
|
import { FunctionComponent } from 'react'
|
|
|
|
|
|
|
|
interface ButtonProps {
|
|
|
|
onClick?: (x?) => void
|
|
|
|
disabled?: boolean
|
|
|
|
className?: string
|
2021-04-27 06:47:52 -07:00
|
|
|
secondary?: boolean
|
2021-04-26 07:22:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
const Button: FunctionComponent<ButtonProps> = ({
|
|
|
|
children,
|
|
|
|
onClick,
|
|
|
|
disabled = false,
|
|
|
|
className,
|
2021-04-27 06:47:52 -07:00
|
|
|
secondary = false,
|
2021-04-26 07:22:30 -07:00
|
|
|
...props
|
|
|
|
}) => {
|
|
|
|
return (
|
|
|
|
<button
|
|
|
|
onClick={onClick}
|
|
|
|
disabled={disabled}
|
2021-04-27 06:47:52 -07:00
|
|
|
className={`${className} ${
|
|
|
|
secondary || disabled
|
|
|
|
? 'bg-bkg-4'
|
|
|
|
: 'bg-gradient-to-br from-secondary-1-light via-secondary-1-dark to-secondary-2-light'
|
|
|
|
} bg-bkg-4 border-none default-transition px-6 py-2 rounded-lg text-fgd-1
|
|
|
|
active:border-primary hover:bg-bkg-3 focus:outline-none
|
|
|
|
disabled:cursor-not-allowed`}
|
2021-04-26 07:22:30 -07:00
|
|
|
{...props}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</button>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Button
|