2020-04-23 02:13:29 -04:00
|
|
|
import { defineMessages, injectIntl } from 'react-intl'
|
|
|
|
import { openModal } from '../actions/modal'
|
2020-02-24 16:56:07 -05:00
|
|
|
import Button from './button'
|
2020-01-27 17:20:07 -05:00
|
|
|
|
2020-04-23 02:13:29 -04:00
|
|
|
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 {
|
2019-08-07 01:02:36 -04:00
|
|
|
static propTypes = {
|
2020-04-23 02:13:29 -04:00
|
|
|
intl: PropTypes.object.isRequired,
|
|
|
|
onOpenCompose: PropTypes.func.isRequired,
|
2020-04-11 18:29:19 -04:00
|
|
|
}
|
2019-08-07 01:02:36 -04:00
|
|
|
|
2020-01-27 17:20:07 -05:00
|
|
|
shouldComponentUpdate(nextProps) {
|
2020-04-11 18:29:19 -04:00
|
|
|
return nextProps.message !== this.props.message
|
2019-08-07 01:02:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2020-04-23 02:13:29 -04:00
|
|
|
const { intl, onOpenCompose } = this.props
|
|
|
|
|
|
|
|
const message = intl.formatMessage(messages.gab)
|
2020-03-25 23:11:32 -04:00
|
|
|
|
2019-08-07 01:02:36 -04:00
|
|
|
return (
|
2020-03-25 23:11:32 -04:00
|
|
|
<Button
|
2020-04-23 02:13:29 -04:00
|
|
|
onClick={onOpenCompose}
|
2020-05-07 00:03:34 -04:00
|
|
|
className={[_s.posFixed, _s.z4, _s.py15, _s.mb15, _s.mr15, _s.bottom55PX, _s.height60PX, _s.width60PX, _s.right0, _s.justifyContentCenter, _s.alignItemsCenter].join(' ')}
|
2020-03-25 23:11:32 -04:00
|
|
|
title={message}
|
|
|
|
aria-label={message}
|
2020-04-09 15:18:14 -04:00
|
|
|
icon='pencil'
|
2020-05-06 19:40:54 -04:00
|
|
|
iconSize='20px'
|
2020-04-09 15:18:14 -04:00
|
|
|
/>
|
2019-08-07 01:02:36 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|