2020-10-08 09:21:27 -07:00
|
|
|
import React from "react"
|
|
|
|
|
2020-10-14 11:36:46 -07:00
|
|
|
import './button.scss'
|
2020-10-09 14:02:19 +02:00
|
|
|
|
2020-10-08 09:21:27 -07:00
|
|
|
type Props = {
|
|
|
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void
|
|
|
|
style?: React.CSSProperties
|
|
|
|
backgroundColor?: string
|
|
|
|
text?: string
|
|
|
|
title?: string
|
|
|
|
}
|
|
|
|
|
2020-10-09 17:10:26 +02:00
|
|
|
export default class Button extends React.Component<Props> {
|
2020-10-08 09:21:27 -07:00
|
|
|
render() {
|
|
|
|
const style = {...this.props.style, backgroundColor: this.props.backgroundColor}
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
onClick={this.props.onClick}
|
2020-10-09 14:02:19 +02:00
|
|
|
className="Button octo-button"
|
2020-10-08 09:21:27 -07:00
|
|
|
style={style}
|
|
|
|
title={this.props.title}>
|
|
|
|
{this.props.children}
|
|
|
|
{this.props.text}
|
|
|
|
</div>)
|
|
|
|
}
|
|
|
|
}
|