This commit is contained in:
mgabdev
2020-04-23 02:13:29 -04:00
parent fed036be08
commit e2e7e8c0af
177 changed files with 1231 additions and 1326 deletions

View File

@@ -1,9 +1,22 @@
import { defineMessages, injectIntl } from 'react-intl'
import { openModal } from '../actions/modal'
import Button from './button'
export default class FloatingActionButton extends PureComponent {
const messages = defineMessages({
gab: { id: 'gab', defaultMessage: 'Gab' },
})
const mapDispatchToProps = (dispatch) => ({
onOpenCompose: () => dispatch(openModal('COMPOSE')),
})
export default
@injectIntl
@connect(null, mapDispatchToProps)
class FloatingActionButton extends PureComponent {
static propTypes = {
onClick: PropTypes.func.isRequired,
message: PropTypes.string.isRequired,
intl: PropTypes.object.isRequired,
onOpenCompose: PropTypes.func.isRequired,
}
shouldComponentUpdate(nextProps) {
@@ -11,14 +24,16 @@ export default class FloatingActionButton extends PureComponent {
}
render() {
const { onClick, message } = this.props
const { intl, onOpenCompose } = this.props
const message = intl.formatMessage(messages.gab)
return (
<Button
onClick={onClick}
onClick={onOpenCompose}
color='white'
backgroundColor='brand'
className={[_s.positionFixed, _s.z4, _s.py15, _s.mb15, _s.mr15, _s.bottom0, _s.right0].join(' ')}
className={[_s.posFixed, _s.z4, _s.py15, _s.mb15, _s.mr15, _s.bottom0, _s.right0].join(' ')}
title={message}
aria-label={message}
icon='pencil'