2020-02-24 16:56:07 -05:00
|
|
|
import Icon from './icon'
|
|
|
|
import Button from './button'
|
2020-01-27 17:20:07 -05:00
|
|
|
|
2019-08-07 01:02:36 -04:00
|
|
|
export default class FloatingActionButton extends Component {
|
|
|
|
static propTypes = {
|
|
|
|
onClick: PropTypes.func.isRequired,
|
|
|
|
message: PropTypes.string.isRequired,
|
|
|
|
};
|
|
|
|
|
2020-01-27 17:20:07 -05:00
|
|
|
shouldComponentUpdate(nextProps) {
|
|
|
|
return nextProps.message !== this.props.message;
|
2019-08-07 01:02:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { onClick, message } = this.props;
|
|
|
|
|
|
|
|
return (
|
2020-02-24 16:56:07 -05:00
|
|
|
<Button onClick={onClick} className='floating-action-button' aria-label={message}>
|
|
|
|
<Icon id='compose' />
|
|
|
|
</Button>
|
2019-08-07 01:02:36 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|