Progress
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user