Add click prop to Button

This commit is contained in:
Justin Edmund 2020-09-11 09:07:47 -07:00
parent 5d94cb18ca
commit 2907980d36

View file

@ -7,11 +7,13 @@ import Link from '../../assets/link.svg'
interface Props {
type: string
click: () => void
}
class Button extends React.Component<Props> {
static defaultProps: Props = {
type: null
type: null,
click: () => {}
}
render() {
@ -24,7 +26,7 @@ class Button extends React.Component<Props> {
icon = <span className='icon'><Link /></span>
}
return <button className='Button'>
return <button className='Button' onClick={this.props.click}>
{icon}
<span className='text'>{this.props.children}</span>
</button>