Use ES Class Fields & Static Properties (#3008)
Use ES Class Fields & Static Properties (currently stage 2) for improve class outlook. Added babel-plugin-transform-class-properties as a Babel plugin.
This commit is contained in:
parent
44a3584e2d
commit
2991a7cfe6
79 changed files with 838 additions and 1128 deletions
|
@ -14,17 +14,21 @@ const messages = defineMessages({
|
|||
|
||||
class ReplyIndicator extends ImmutablePureComponent {
|
||||
|
||||
constructor (props, context) {
|
||||
super(props, context);
|
||||
this.handleClick = this.handleClick.bind(this);
|
||||
this.handleAccountClick = this.handleAccountClick.bind(this);
|
||||
}
|
||||
static contextTypes = {
|
||||
router: PropTypes.object
|
||||
};
|
||||
|
||||
handleClick () {
|
||||
static propTypes = {
|
||||
status: ImmutablePropTypes.map,
|
||||
onCancel: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
handleClick = () => {
|
||||
this.props.onCancel();
|
||||
}
|
||||
|
||||
handleAccountClick (e) {
|
||||
handleAccountClick = (e) => {
|
||||
if (e.button === 0) {
|
||||
e.preventDefault();
|
||||
this.context.router.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`);
|
||||
|
@ -58,14 +62,4 @@ class ReplyIndicator extends ImmutablePureComponent {
|
|||
|
||||
}
|
||||
|
||||
ReplyIndicator.contextTypes = {
|
||||
router: PropTypes.object
|
||||
};
|
||||
|
||||
ReplyIndicator.propTypes = {
|
||||
status: ImmutablePropTypes.map,
|
||||
onCancel: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
export default injectIntl(ReplyIndicator);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue