Use Class and Property Decorators (#3730)
ref https://tc39.github.io/proposal-decorators/
This commit is contained in:
parent
0c44316b22
commit
c1a8e3d1eb
90 changed files with 168 additions and 274 deletions
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import PropTypes from 'prop-types';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
class ClearColumnButton extends React.Component {
|
||||
export default class ClearColumnButton extends React.Component {
|
||||
|
||||
static propTypes = {
|
||||
onClick: PropTypes.func.isRequired,
|
||||
|
@ -15,5 +15,3 @@ class ClearColumnButton extends React.Component {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
export default ClearColumnButton;
|
||||
|
|
|
@ -5,7 +5,7 @@ import { FormattedMessage } from 'react-intl';
|
|||
import ClearColumnButton from './clear_column_button';
|
||||
import SettingToggle from './setting_toggle';
|
||||
|
||||
class ColumnSettings extends React.PureComponent {
|
||||
export default class ColumnSettings extends React.PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
settings: ImmutablePropTypes.map.isRequired,
|
||||
|
@ -63,5 +63,3 @@ class ColumnSettings extends React.PureComponent {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
export default ColumnSettings;
|
||||
|
|
|
@ -8,7 +8,7 @@ import emojify from '../../../emoji';
|
|||
import escapeTextContentForBrowser from 'escape-html';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
|
||||
class Notification extends ImmutablePureComponent {
|
||||
export default class Notification extends ImmutablePureComponent {
|
||||
|
||||
static propTypes = {
|
||||
notification: ImmutablePropTypes.map.isRequired,
|
||||
|
@ -86,5 +86,3 @@ class Notification extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
export default Notification;
|
||||
|
|
|
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import Toggle from 'react-toggle';
|
||||
|
||||
class SettingToggle extends React.PureComponent {
|
||||
export default class SettingToggle extends React.PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
prefix: PropTypes.string,
|
||||
|
@ -30,5 +30,3 @@ class SettingToggle extends React.PureComponent {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
export default SettingToggle;
|
||||
|
|
|
@ -30,7 +30,9 @@ const mapStateToProps = state => ({
|
|||
hasMore: !!state.getIn(['notifications', 'next']),
|
||||
});
|
||||
|
||||
class Notifications extends React.PureComponent {
|
||||
@connect(mapStateToProps)
|
||||
@injectIntl
|
||||
export default class Notifications extends React.PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
columnId: PropTypes.string,
|
||||
|
@ -173,5 +175,3 @@ class Notifications extends React.PureComponent {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps)(injectIntl(Notifications));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue