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:
committed by
Eugen Rochko
parent
44a3584e2d
commit
2991a7cfe6
@ -8,6 +8,11 @@ const messages = defineMessages({
|
||||
|
||||
class ClearColumnButton extends React.Component {
|
||||
|
||||
static propTypes = {
|
||||
onClick: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
render () {
|
||||
const { intl } = this.props;
|
||||
|
||||
@ -19,9 +24,4 @@ class ClearColumnButton extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
ClearColumnButton.propTypes = {
|
||||
onClick: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
export default injectIntl(ClearColumnButton);
|
||||
|
@ -11,6 +11,15 @@ const messages = defineMessages({
|
||||
|
||||
class ColumnSettings extends React.PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
settings: ImmutablePropTypes.map.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
onSave: PropTypes.func.isRequired,
|
||||
intl: PropTypes.shape({
|
||||
formatMessage: PropTypes.func.isRequired
|
||||
}).isRequired
|
||||
};
|
||||
|
||||
render () {
|
||||
const { settings, intl, onChange, onSave } = this.props;
|
||||
|
||||
@ -59,13 +68,4 @@ class ColumnSettings extends React.PureComponent {
|
||||
|
||||
}
|
||||
|
||||
ColumnSettings.propTypes = {
|
||||
settings: ImmutablePropTypes.map.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
onSave: PropTypes.func.isRequired,
|
||||
intl: PropTypes.shape({
|
||||
formatMessage: PropTypes.func.isRequired
|
||||
}).isRequired
|
||||
};
|
||||
|
||||
export default injectIntl(ColumnSettings);
|
||||
|
@ -11,6 +11,10 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
|
||||
class Notification extends ImmutablePureComponent {
|
||||
|
||||
static propTypes = {
|
||||
notification: ImmutablePropTypes.map.isRequired
|
||||
};
|
||||
|
||||
renderFollow (account, link) {
|
||||
return (
|
||||
<div className='notification notification-follow'>
|
||||
@ -82,8 +86,4 @@ class Notification extends ImmutablePureComponent {
|
||||
|
||||
}
|
||||
|
||||
Notification.propTypes = {
|
||||
notification: ImmutablePropTypes.map.isRequired
|
||||
};
|
||||
|
||||
export default Notification;
|
||||
|
Reference in New Issue
Block a user