gab-social/app/javascript/gabsocial/components/floating_action_button.js
2020-02-24 16:56:07 -05:00

23 lines
543 B
JavaScript

import Icon from './icon'
import Button from './button'
export default class FloatingActionButton extends Component {
static propTypes = {
onClick: PropTypes.func.isRequired,
message: PropTypes.string.isRequired,
};
shouldComponentUpdate(nextProps) {
return nextProps.message !== this.props.message;
}
render() {
const { onClick, message } = this.props;
return (
<Button onClick={onClick} className='floating-action-button' aria-label={message}>
<Icon id='compose' />
</Button>
)
}
}