gab-social/app/javascript/gabsocial/components/floating_action_button.js

23 lines
543 B
JavaScript
Raw Normal View History

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