- {name ? #{name} : }
+ {name ? <>#{name}> : }
{typeof people !== 'undefined' ?
:
}
diff --git a/app/javascript/mastodon/components/icon.js b/app/javascript/mastodon/components/icon.js
index d8a17722fe..11178dd127 100644
--- a/app/javascript/mastodon/components/icon.js
+++ b/app/javascript/mastodon/components/icon.js
@@ -1,8 +1,8 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
-export default class Icon extends React.PureComponent {
+export default class Icon extends PureComponent {
static propTypes = {
id: PropTypes.string.isRequired,
diff --git a/app/javascript/mastodon/components/icon_button.js b/app/javascript/mastodon/components/icon_button.js
index 81743a1dbe..1c1c3244b0 100644
--- a/app/javascript/mastodon/components/icon_button.js
+++ b/app/javascript/mastodon/components/icon_button.js
@@ -1,10 +1,10 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Icon from 'mastodon/components/icon';
import AnimatedNumber from 'mastodon/components/animated_number';
-export default class IconButton extends React.PureComponent {
+export default class IconButton extends PureComponent {
static propTypes = {
className: PropTypes.string,
@@ -44,7 +44,7 @@ export default class IconButton extends React.PureComponent {
deactivate: false,
}
- componentWillReceiveProps (nextProps) {
+ UNSAFE_componentWillReceiveProps (nextProps) {
if (!nextProps.animate) return;
if (this.props.active && !nextProps.active) {
@@ -126,9 +126,9 @@ export default class IconButton extends React.PureComponent {
}
let contents = (
-
+ <>
{typeof counter !== 'undefined' && }
-
+ >
);
if (href) {
diff --git a/app/javascript/mastodon/components/icon_with_badge.js b/app/javascript/mastodon/components/icon_with_badge.js
index 4214eccfde..812ebfe573 100644
--- a/app/javascript/mastodon/components/icon_with_badge.js
+++ b/app/javascript/mastodon/components/icon_with_badge.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
import Icon from 'mastodon/components/icon';
diff --git a/app/javascript/mastodon/components/inline_account.js b/app/javascript/mastodon/components/inline_account.js
index a1b4955904..c5c30fb989 100644
--- a/app/javascript/mastodon/components/inline_account.js
+++ b/app/javascript/mastodon/components/inline_account.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
import { makeGetAccount } from 'mastodon/selectors';
@@ -15,7 +15,7 @@ const makeMapStateToProps = () => {
};
export default @connect(makeMapStateToProps)
-class InlineAccount extends React.PureComponent {
+class InlineAccount extends PureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,
diff --git a/app/javascript/mastodon/components/intersection_observer_article.js b/app/javascript/mastodon/components/intersection_observer_article.js
index 26f85fa400..88a12b2425 100644
--- a/app/javascript/mastodon/components/intersection_observer_article.js
+++ b/app/javascript/mastodon/components/intersection_observer_article.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { cloneElement, Component } from 'react';
import PropTypes from 'prop-types';
import scheduleIdleTask from '../features/ui/util/schedule_idle_task';
import getRectFromEntry from '../features/ui/util/get_rect_from_entry';
@@ -6,7 +6,7 @@ import getRectFromEntry from '../features/ui/util/get_rect_from_entry';
// Diff these props in the "unrendered" state
const updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'cachedHeight'];
-export default class IntersectionObserverArticle extends React.Component {
+export default class IntersectionObserverArticle extends Component {
static propTypes = {
intersectionObserverWrapper: PropTypes.object.isRequired,
@@ -115,14 +115,14 @@ export default class IntersectionObserverArticle extends React.Component {
data-id={id}
tabIndex='0'
>
- {children && React.cloneElement(children, { hidden: true })}
+ {children && cloneElement(children, { hidden: true })}
);
}
return (
- {children && React.cloneElement(children, { hidden: false })}
+ {children && cloneElement(children, { hidden: false })}
);
}
diff --git a/app/javascript/mastodon/components/load_gap.js b/app/javascript/mastodon/components/load_gap.js
index a44d55d093..ca2077a239 100644
--- a/app/javascript/mastodon/components/load_gap.js
+++ b/app/javascript/mastodon/components/load_gap.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { injectIntl, defineMessages } from 'react-intl';
import Icon from 'mastodon/components/icon';
@@ -8,7 +8,7 @@ const messages = defineMessages({
});
export default @injectIntl
-class LoadGap extends React.PureComponent {
+class LoadGap extends PureComponent {
static propTypes = {
disabled: PropTypes.bool,
diff --git a/app/javascript/mastodon/components/load_more.js b/app/javascript/mastodon/components/load_more.js
index 389c3e1e11..f7bd70d7da 100644
--- a/app/javascript/mastodon/components/load_more.js
+++ b/app/javascript/mastodon/components/load_more.js
@@ -1,8 +1,8 @@
-import React from 'react';
+import { PureComponent } from 'react';
import { FormattedMessage } from 'react-intl';
import PropTypes from 'prop-types';
-export default class LoadMore extends React.PureComponent {
+export default class LoadMore extends PureComponent {
static propTypes = {
onClick: PropTypes.func,
diff --git a/app/javascript/mastodon/components/load_pending.js b/app/javascript/mastodon/components/load_pending.js
index 7e27024036..96727c7f93 100644
--- a/app/javascript/mastodon/components/load_pending.js
+++ b/app/javascript/mastodon/components/load_pending.js
@@ -1,8 +1,8 @@
-import React from 'react';
+import { PureComponent } from 'react';
import { FormattedMessage } from 'react-intl';
import PropTypes from 'prop-types';
-export default class LoadPending extends React.PureComponent {
+export default class LoadPending extends PureComponent {
static propTypes = {
onClick: PropTypes.func,
diff --git a/app/javascript/mastodon/components/loading_indicator.js b/app/javascript/mastodon/components/loading_indicator.js
index 33c59d94c0..c3f7a4e9ef 100644
--- a/app/javascript/mastodon/components/loading_indicator.js
+++ b/app/javascript/mastodon/components/loading_indicator.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
export const CircularProgress = ({ size, strokeWidth }) => {
diff --git a/app/javascript/mastodon/components/logo.js b/app/javascript/mastodon/components/logo.js
index d1c7f08a91..26df5753d8 100644
--- a/app/javascript/mastodon/components/logo.js
+++ b/app/javascript/mastodon/components/logo.js
@@ -1,5 +1,3 @@
-import React from 'react';
-
const Logo = () => (
diff --git a/app/javascript/mastodon/features/follow_requests/components/account_authorize.js b/app/javascript/mastodon/features/follow_requests/components/account_authorize.js
index 263a7ae162..bb81cfb2e2 100644
--- a/app/javascript/mastodon/features/follow_requests/components/account_authorize.js
+++ b/app/javascript/mastodon/features/follow_requests/components/account_authorize.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Permalink from '../../../components/permalink';
diff --git a/app/javascript/mastodon/features/follow_requests/index.js b/app/javascript/mastodon/features/follow_requests/index.js
index 1f9b635bb7..68396645bc 100644
--- a/app/javascript/mastodon/features/follow_requests/index.js
+++ b/app/javascript/mastodon/features/follow_requests/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
@@ -41,7 +40,7 @@ class FollowRequests extends ImmutablePureComponent {
multiColumn: PropTypes.bool,
};
- componentWillMount () {
+ UNSAFE_componentWillMount () {
this.props.dispatch(fetchFollowRequests());
}
diff --git a/app/javascript/mastodon/features/followers/index.js b/app/javascript/mastodon/features/followers/index.js
index 5b7f402f8d..d180b96dd6 100644
--- a/app/javascript/mastodon/features/followers/index.js
+++ b/app/javascript/mastodon/features/followers/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import ImmutablePureComponent from 'react-immutable-pure-component';
import PropTypes from 'prop-types';
diff --git a/app/javascript/mastodon/features/following/index.js b/app/javascript/mastodon/features/following/index.js
index 143082d760..a400d79c8e 100644
--- a/app/javascript/mastodon/features/following/index.js
+++ b/app/javascript/mastodon/features/following/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import ImmutablePureComponent from 'react-immutable-pure-component';
import PropTypes from 'prop-types';
diff --git a/app/javascript/mastodon/features/generic_not_found/index.js b/app/javascript/mastodon/features/generic_not_found/index.js
index 41cd61a5f8..c7f82626e6 100644
--- a/app/javascript/mastodon/features/generic_not_found/index.js
+++ b/app/javascript/mastodon/features/generic_not_found/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import Column from '../ui/components/column';
import MissingIndicator from '../../components/missing_indicator';
diff --git a/app/javascript/mastodon/features/getting_started/components/announcements.js b/app/javascript/mastodon/features/getting_started/components/announcements.js
index 24db8cedec..567ce4ba5f 100644
--- a/app/javascript/mastodon/features/getting_started/components/announcements.js
+++ b/app/javascript/mastodon/features/getting_started/components/announcements.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ReactSwipeableViews from 'react-swipeable-views';
import ImmutablePropTypes from 'react-immutable-proptypes';
@@ -149,7 +149,7 @@ class Content extends ImmutablePureComponent {
}
-class Emoji extends React.PureComponent {
+class Emoji extends PureComponent {
static propTypes = {
emoji: PropTypes.string.isRequired,
diff --git a/app/javascript/mastodon/features/getting_started/components/trends.js b/app/javascript/mastodon/features/getting_started/components/trends.js
index 71c7c458dc..4ea812901d 100644
--- a/app/javascript/mastodon/features/getting_started/components/trends.js
+++ b/app/javascript/mastodon/features/getting_started/components/trends.js
@@ -1,4 +1,3 @@
-import React from 'react';
import ImmutablePureComponent from 'react-immutable-pure-component';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
diff --git a/app/javascript/mastodon/features/getting_started/index.js b/app/javascript/mastodon/features/getting_started/index.js
index 65cee7498b..e58f7b63c7 100644
--- a/app/javascript/mastodon/features/getting_started/index.js
+++ b/app/javascript/mastodon/features/getting_started/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import Column from '../ui/components/column';
import ColumnLink from '../ui/components/column_link';
import ColumnSubheading from '../ui/components/column_subheading';
diff --git a/app/javascript/mastodon/features/hashtag_timeline/components/column_settings.js b/app/javascript/mastodon/features/hashtag_timeline/components/column_settings.js
index ede8907e50..c375d585ed 100644
--- a/app/javascript/mastodon/features/hashtag_timeline/components/column_settings.js
+++ b/app/javascript/mastodon/features/hashtag_timeline/components/column_settings.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
@@ -13,7 +13,7 @@ const messages = defineMessages({
});
export default @injectIntl
-class ColumnSettings extends React.PureComponent {
+class ColumnSettings extends PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,
diff --git a/app/javascript/mastodon/features/hashtag_timeline/index.js b/app/javascript/mastodon/features/hashtag_timeline/index.js
index 6a808eb306..10b3358ce2 100644
--- a/app/javascript/mastodon/features/hashtag_timeline/index.js
+++ b/app/javascript/mastodon/features/hashtag_timeline/index.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import StatusListContainer from '../ui/containers/status_list_container';
@@ -16,7 +16,7 @@ const mapStateToProps = (state, props) => ({
});
export default @connect(mapStateToProps)
-class HashtagTimeline extends React.PureComponent {
+class HashtagTimeline extends PureComponent {
disconnects = [];
@@ -103,7 +103,7 @@ class HashtagTimeline extends React.PureComponent {
dispatch(expandHashtagTimeline(id, { tags, local }));
}
- componentWillReceiveProps (nextProps) {
+ UNSAFE_componentWillReceiveProps (nextProps) {
const { dispatch, params } = this.props;
const { id, tags, local } = nextProps.params;
diff --git a/app/javascript/mastodon/features/home_timeline/components/column_settings.js b/app/javascript/mastodon/features/home_timeline/components/column_settings.js
index 455e218817..490ae99b45 100644
--- a/app/javascript/mastodon/features/home_timeline/components/column_settings.js
+++ b/app/javascript/mastodon/features/home_timeline/components/column_settings.js
@@ -1,11 +1,11 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { injectIntl, FormattedMessage } from 'react-intl';
import SettingToggle from '../../notifications/components/setting_toggle';
export default @injectIntl
-class ColumnSettings extends React.PureComponent {
+class ColumnSettings extends PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,
diff --git a/app/javascript/mastodon/features/home_timeline/index.js b/app/javascript/mastodon/features/home_timeline/index.js
index dc440f2fe0..ff04ddfb38 100644
--- a/app/javascript/mastodon/features/home_timeline/index.js
+++ b/app/javascript/mastodon/features/home_timeline/index.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import { connect } from 'react-redux';
import { expandHomeTimeline } from '../../actions/timelines';
import PropTypes from 'prop-types';
@@ -30,7 +30,7 @@ const mapStateToProps = state => ({
export default @connect(mapStateToProps)
@injectIntl
-class HomeTimeline extends React.PureComponent {
+class HomeTimeline extends PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,
diff --git a/app/javascript/mastodon/features/keyboard_shortcuts/index.js b/app/javascript/mastodon/features/keyboard_shortcuts/index.js
index 8f1631d829..3072c5d38c 100644
--- a/app/javascript/mastodon/features/keyboard_shortcuts/index.js
+++ b/app/javascript/mastodon/features/keyboard_shortcuts/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import Column from '../ui/components/column';
import ColumnBackButtonSlim from '../../components/column_back_button_slim';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
diff --git a/app/javascript/mastodon/features/list_adder/components/account.js b/app/javascript/mastodon/features/list_adder/components/account.js
index 1369aac074..c3468a930e 100644
--- a/app/javascript/mastodon/features/list_adder/components/account.js
+++ b/app/javascript/mastodon/features/list_adder/components/account.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import { makeGetAccount } from '../../../selectors';
import ImmutablePureComponent from 'react-immutable-pure-component';
diff --git a/app/javascript/mastodon/features/list_adder/components/list.js b/app/javascript/mastodon/features/list_adder/components/list.js
index 60c8958a73..88458856dc 100644
--- a/app/javascript/mastodon/features/list_adder/components/list.js
+++ b/app/javascript/mastodon/features/list_adder/components/list.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import ImmutablePureComponent from 'react-immutable-pure-component';
diff --git a/app/javascript/mastodon/features/list_adder/index.js b/app/javascript/mastodon/features/list_adder/index.js
index cb8a15e8c7..f3e3415900 100644
--- a/app/javascript/mastodon/features/list_adder/index.js
+++ b/app/javascript/mastodon/features/list_adder/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
diff --git a/app/javascript/mastodon/features/list_editor/components/account.js b/app/javascript/mastodon/features/list_editor/components/account.js
index 48085af43d..22b41ce81a 100644
--- a/app/javascript/mastodon/features/list_editor/components/account.js
+++ b/app/javascript/mastodon/features/list_editor/components/account.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { makeGetAccount } from '../../../selectors';
diff --git a/app/javascript/mastodon/features/list_editor/components/edit_list_form.js b/app/javascript/mastodon/features/list_editor/components/edit_list_form.js
index 3ccab12a80..f092a5aa26 100644
--- a/app/javascript/mastodon/features/list_editor/components/edit_list_form.js
+++ b/app/javascript/mastodon/features/list_editor/components/edit_list_form.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { changeListEditorTitle, submitListEditor } from '../../../actions/lists';
@@ -21,7 +21,7 @@ const mapDispatchToProps = dispatch => ({
export default @connect(mapStateToProps, mapDispatchToProps)
@injectIntl
-class ListForm extends React.PureComponent {
+class ListForm extends PureComponent {
static propTypes = {
value: PropTypes.string.isRequired,
diff --git a/app/javascript/mastodon/features/list_editor/components/search.js b/app/javascript/mastodon/features/list_editor/components/search.js
index e3f069bb80..721fffb021 100644
--- a/app/javascript/mastodon/features/list_editor/components/search.js
+++ b/app/javascript/mastodon/features/list_editor/components/search.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { defineMessages, injectIntl } from 'react-intl';
@@ -22,7 +22,7 @@ const mapDispatchToProps = dispatch => ({
export default @connect(mapStateToProps, mapDispatchToProps)
@injectIntl
-class Search extends React.PureComponent {
+class Search extends PureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,
diff --git a/app/javascript/mastodon/features/list_editor/index.js b/app/javascript/mastodon/features/list_editor/index.js
index 48466604a7..0e68637f38 100644
--- a/app/javascript/mastodon/features/list_editor/index.js
+++ b/app/javascript/mastodon/features/list_editor/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
diff --git a/app/javascript/mastodon/features/list_timeline/index.js b/app/javascript/mastodon/features/list_timeline/index.js
index 8010274f88..91fbfeceef 100644
--- a/app/javascript/mastodon/features/list_timeline/index.js
+++ b/app/javascript/mastodon/features/list_timeline/index.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
@@ -32,7 +32,7 @@ const mapStateToProps = (state, props) => ({
export default @connect(mapStateToProps)
@injectIntl
-class ListTimeline extends React.PureComponent {
+class ListTimeline extends PureComponent {
static contextTypes = {
router: PropTypes.object,
@@ -78,7 +78,7 @@ class ListTimeline extends React.PureComponent {
this.disconnect = dispatch(connectListStream(id));
}
- componentWillReceiveProps (nextProps) {
+ UNSAFE_componentWillReceiveProps (nextProps) {
const { dispatch } = this.props;
const { id } = nextProps.params;
diff --git a/app/javascript/mastodon/features/lists/components/new_list_form.js b/app/javascript/mastodon/features/lists/components/new_list_form.js
index 7faf50be81..acc2d8216e 100644
--- a/app/javascript/mastodon/features/lists/components/new_list_form.js
+++ b/app/javascript/mastodon/features/lists/components/new_list_form.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { changeListEditorTitle, submitListEditor } from '../../../actions/lists';
@@ -22,7 +22,7 @@ const mapDispatchToProps = dispatch => ({
export default @connect(mapStateToProps, mapDispatchToProps)
@injectIntl
-class NewListForm extends React.PureComponent {
+class NewListForm extends PureComponent {
static propTypes = {
value: PropTypes.string.isRequired,
diff --git a/app/javascript/mastodon/features/lists/index.js b/app/javascript/mastodon/features/lists/index.js
index 809d79d998..de6c8dca1a 100644
--- a/app/javascript/mastodon/features/lists/index.js
+++ b/app/javascript/mastodon/features/lists/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
@@ -43,7 +42,7 @@ class Lists extends ImmutablePureComponent {
multiColumn: PropTypes.bool,
};
- componentWillMount () {
+ UNSAFE_componentWillMount () {
this.props.dispatch(fetchLists());
}
diff --git a/app/javascript/mastodon/features/mutes/index.js b/app/javascript/mastodon/features/mutes/index.js
index c21433cc41..75cd1d73d2 100644
--- a/app/javascript/mastodon/features/mutes/index.js
+++ b/app/javascript/mastodon/features/mutes/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
@@ -36,7 +35,7 @@ class Mutes extends ImmutablePureComponent {
multiColumn: PropTypes.bool,
};
- componentWillMount () {
+ UNSAFE_componentWillMount () {
this.props.dispatch(fetchMutes());
}
diff --git a/app/javascript/mastodon/features/notifications/components/clear_column_button.js b/app/javascript/mastodon/features/notifications/components/clear_column_button.js
index b82fd092f8..3d73625fe2 100644
--- a/app/javascript/mastodon/features/notifications/components/clear_column_button.js
+++ b/app/javascript/mastodon/features/notifications/components/clear_column_button.js
@@ -1,9 +1,9 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import Icon from 'mastodon/components/icon';
-export default class ClearColumnButton extends React.PureComponent {
+export default class ClearColumnButton extends PureComponent {
static propTypes = {
onClick: PropTypes.func.isRequired,
diff --git a/app/javascript/mastodon/features/notifications/components/column_settings.js b/app/javascript/mastodon/features/notifications/components/column_settings.js
index 61df79b464..5a05a47901 100644
--- a/app/javascript/mastodon/features/notifications/components/column_settings.js
+++ b/app/javascript/mastodon/features/notifications/components/column_settings.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage } from 'react-intl';
@@ -7,7 +7,7 @@ import GrantPermissionButton from './grant_permission_button';
import SettingToggle from './setting_toggle';
import { isStaff } from 'mastodon/initial_state';
-export default class ColumnSettings extends React.PureComponent {
+export default class ColumnSettings extends PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,
diff --git a/app/javascript/mastodon/features/notifications/components/filter_bar.js b/app/javascript/mastodon/features/notifications/components/filter_bar.js
index 368eb0b7e6..9e9b154cd9 100644
--- a/app/javascript/mastodon/features/notifications/components/filter_bar.js
+++ b/app/javascript/mastodon/features/notifications/components/filter_bar.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import Icon from 'mastodon/components/icon';
@@ -13,7 +13,7 @@ const tooltips = defineMessages({
});
export default @injectIntl
-class FilterBar extends React.PureComponent {
+class FilterBar extends PureComponent {
static propTypes = {
selectFilter: PropTypes.func.isRequired,
diff --git a/app/javascript/mastodon/features/notifications/components/follow_request.js b/app/javascript/mastodon/features/notifications/components/follow_request.js
index 9ef3fde7eb..548871f451 100644
--- a/app/javascript/mastodon/features/notifications/components/follow_request.js
+++ b/app/javascript/mastodon/features/notifications/components/follow_request.js
@@ -1,4 +1,3 @@
-import React, { Fragment } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import Avatar from 'mastodon/components/avatar';
@@ -32,10 +31,10 @@ class FollowRequest extends ImmutablePureComponent {
if (hidden) {
return (
-
+ <>
{account.get('display_name')}
{account.get('username')}
-
+ >
);
}
diff --git a/app/javascript/mastodon/features/notifications/components/grant_permission_button.js b/app/javascript/mastodon/features/notifications/components/grant_permission_button.js
index 798e4c7872..06420c9a14 100644
--- a/app/javascript/mastodon/features/notifications/components/grant_permission_button.js
+++ b/app/javascript/mastodon/features/notifications/components/grant_permission_button.js
@@ -1,8 +1,8 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
-export default class GrantPermissionButton extends React.PureComponent {
+export default class GrantPermissionButton extends PureComponent {
static propTypes = {
onClick: PropTypes.func.isRequired,
diff --git a/app/javascript/mastodon/features/notifications/components/notification.js b/app/javascript/mastodon/features/notifications/components/notification.js
index 0af71418c4..8261cffbb8 100644
--- a/app/javascript/mastodon/features/notifications/components/notification.js
+++ b/app/javascript/mastodon/features/notifications/components/notification.js
@@ -1,4 +1,3 @@
-import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { injectIntl, FormattedMessage, defineMessages } from 'react-intl';
import { HotKeys } from 'react-hotkeys';
diff --git a/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.js b/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.js
index df9b7fb1b8..30a1e17f39 100644
--- a/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.js
+++ b/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import Icon from 'mastodon/components/icon';
import Button from 'mastodon/components/button';
import IconButton from 'mastodon/components/icon_button';
@@ -14,7 +14,7 @@ const messages = defineMessages({
export default @connect()
@injectIntl
-class NotificationsPermissionBanner extends React.PureComponent {
+class NotificationsPermissionBanner extends PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,
diff --git a/app/javascript/mastodon/features/notifications/components/report.js b/app/javascript/mastodon/features/notifications/components/report.js
index 3ce3eb9d32..75f87a4a45 100644
--- a/app/javascript/mastodon/features/notifications/components/report.js
+++ b/app/javascript/mastodon/features/notifications/components/report.js
@@ -1,4 +1,3 @@
-import React, { Fragment } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
@@ -32,9 +31,9 @@ class Report extends ImmutablePureComponent {
if (hidden) {
return (
-
+ <>
{report.get('id')}
-
+ >
);
}
diff --git a/app/javascript/mastodon/features/notifications/components/setting_toggle.js b/app/javascript/mastodon/features/notifications/components/setting_toggle.js
index c4c8bffbe3..b054b36ff1 100644
--- a/app/javascript/mastodon/features/notifications/components/setting_toggle.js
+++ b/app/javascript/mastodon/features/notifications/components/setting_toggle.js
@@ -1,9 +1,9 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Toggle from 'react-toggle';
-export default class SettingToggle extends React.PureComponent {
+export default class SettingToggle extends PureComponent {
static propTypes = {
prefix: PropTypes.string,
diff --git a/app/javascript/mastodon/features/notifications/index.js b/app/javascript/mastodon/features/notifications/index.js
index a6a277d7ed..0f32431850 100644
--- a/app/javascript/mastodon/features/notifications/index.js
+++ b/app/javascript/mastodon/features/notifications/index.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
@@ -67,7 +67,7 @@ const mapStateToProps = state => ({
export default @connect(mapStateToProps)
@injectIntl
-class Notifications extends React.PureComponent {
+class Notifications extends PureComponent {
static propTypes = {
columnId: PropTypes.string,
@@ -89,7 +89,7 @@ class Notifications extends React.PureComponent {
trackScroll: true,
};
- componentWillMount() {
+ UNSAFE_componentWillMount() {
this.props.dispatch(mountNotifications());
}
diff --git a/app/javascript/mastodon/features/picture_in_picture/components/footer.js b/app/javascript/mastodon/features/picture_in_picture/components/footer.js
index 0cb42b25aa..74a0cf1493 100644
--- a/app/javascript/mastodon/features/picture_in_picture/components/footer.js
+++ b/app/javascript/mastodon/features/picture_in_picture/components/footer.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
diff --git a/app/javascript/mastodon/features/picture_in_picture/components/header.js b/app/javascript/mastodon/features/picture_in_picture/components/header.js
index e05d8c62e9..58c35df6ec 100644
--- a/app/javascript/mastodon/features/picture_in_picture/components/header.js
+++ b/app/javascript/mastodon/features/picture_in_picture/components/header.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
diff --git a/app/javascript/mastodon/features/picture_in_picture/index.js b/app/javascript/mastodon/features/picture_in_picture/index.js
index 1e59fbcd33..76a764c360 100644
--- a/app/javascript/mastodon/features/picture_in_picture/index.js
+++ b/app/javascript/mastodon/features/picture_in_picture/index.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { Component } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import Video from 'mastodon/features/video';
@@ -12,7 +12,7 @@ const mapStateToProps = state => ({
});
export default @connect(mapStateToProps)
-class PictureInPicture extends React.Component {
+class PictureInPicture extends Component {
static propTypes = {
statusId: PropTypes.string,
diff --git a/app/javascript/mastodon/features/pinned_statuses/index.js b/app/javascript/mastodon/features/pinned_statuses/index.js
index 67b13f10aa..11e90419b7 100644
--- a/app/javascript/mastodon/features/pinned_statuses/index.js
+++ b/app/javascript/mastodon/features/pinned_statuses/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
@@ -30,7 +29,7 @@ class PinnedStatuses extends ImmutablePureComponent {
multiColumn: PropTypes.bool,
};
- componentWillMount () {
+ UNSAFE_componentWillMount () {
this.props.dispatch(fetchPinnedStatuses());
}
diff --git a/app/javascript/mastodon/features/public_timeline/components/column_settings.js b/app/javascript/mastodon/features/public_timeline/components/column_settings.js
index 756b6fe06d..78af8b5e37 100644
--- a/app/javascript/mastodon/features/public_timeline/components/column_settings.js
+++ b/app/javascript/mastodon/features/public_timeline/components/column_settings.js
@@ -1,11 +1,11 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { injectIntl, FormattedMessage } from 'react-intl';
import SettingToggle from '../../notifications/components/setting_toggle';
export default @injectIntl
-class ColumnSettings extends React.PureComponent {
+class ColumnSettings extends PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,
diff --git a/app/javascript/mastodon/features/public_timeline/index.js b/app/javascript/mastodon/features/public_timeline/index.js
index b1d5518af5..8c7a817136 100644
--- a/app/javascript/mastodon/features/public_timeline/index.js
+++ b/app/javascript/mastodon/features/public_timeline/index.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import { connect } from 'react-redux';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import PropTypes from 'prop-types';
@@ -31,7 +31,7 @@ const mapStateToProps = (state, { columnId }) => {
export default @connect(mapStateToProps)
@injectIntl
-class PublicTimeline extends React.PureComponent {
+class PublicTimeline extends PureComponent {
static contextTypes = {
router: PropTypes.object,
diff --git a/app/javascript/mastodon/features/reblogs/index.js b/app/javascript/mastodon/features/reblogs/index.js
index 7704a049f4..21c5a9854d 100644
--- a/app/javascript/mastodon/features/reblogs/index.js
+++ b/app/javascript/mastodon/features/reblogs/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import ImmutablePureComponent from 'react-immutable-pure-component';
import PropTypes from 'prop-types';
@@ -32,13 +31,13 @@ class Reblogs extends ImmutablePureComponent {
intl: PropTypes.object.isRequired,
};
- componentWillMount () {
+ UNSAFE_componentWillMount () {
if (!this.props.accountIds) {
this.props.dispatch(fetchReblogs(this.props.params.statusId));
}
}
- componentWillReceiveProps(nextProps) {
+ UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {
this.props.dispatch(fetchReblogs(nextProps.params.statusId));
}
diff --git a/app/javascript/mastodon/features/report/category.js b/app/javascript/mastodon/features/report/category.js
index 9215b3f51e..a2592c9b5e 100644
--- a/app/javascript/mastodon/features/report/category.js
+++ b/app/javascript/mastodon/features/report/category.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
@@ -25,7 +25,7 @@ const mapStateToProps = state => ({
export default @connect(mapStateToProps)
@injectIntl
-class Category extends React.PureComponent {
+class Category extends PureComponent {
static propTypes = {
onNextStep: PropTypes.func.isRequired,
@@ -75,7 +75,7 @@ class Category extends React.PureComponent {
];
return (
-
+ <>
@@ -98,7 +98,7 @@ class Category extends React.PureComponent {
-
+ >
);
}
diff --git a/app/javascript/mastodon/features/report/comment.js b/app/javascript/mastodon/features/report/comment.js
index cde1564158..250a2b3d2a 100644
--- a/app/javascript/mastodon/features/report/comment.js
+++ b/app/javascript/mastodon/features/report/comment.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
import Button from 'mastodon/components/button';
@@ -9,7 +9,7 @@ const messages = defineMessages({
});
export default @injectIntl
-class Comment extends React.PureComponent {
+class Comment extends PureComponent {
static propTypes = {
onSubmit: PropTypes.func.isRequired,
@@ -48,7 +48,7 @@ class Comment extends React.PureComponent {
const { comment, isRemote, forward, domain, isSubmitting, intl } = this.props;
return (
-
+ <>
{isRemote && (
-
+ <>
-
+ >
)}
@@ -76,7 +76,7 @@ class Comment extends React.PureComponent {
-
+ >
);
}
diff --git a/app/javascript/mastodon/features/report/components/option.js b/app/javascript/mastodon/features/report/components/option.js
index 744d852680..df6ef0e0f3 100644
--- a/app/javascript/mastodon/features/report/components/option.js
+++ b/app/javascript/mastodon/features/report/components/option.js
@@ -1,9 +1,9 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Check from 'mastodon/components/check';
-export default class Option extends React.PureComponent {
+export default class Option extends PureComponent {
static propTypes = {
name: PropTypes.string.isRequired,
diff --git a/app/javascript/mastodon/features/report/components/status_check_box.js b/app/javascript/mastodon/features/report/components/status_check_box.js
index 373c60e21e..a8abcfaa25 100644
--- a/app/javascript/mastodon/features/report/components/status_check_box.js
+++ b/app/javascript/mastodon/features/report/components/status_check_box.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import StatusContent from 'mastodon/components/status_content';
@@ -8,7 +8,7 @@ import RelativeTimestamp from 'mastodon/components/relative_timestamp';
import Option from './option';
import MediaAttachments from 'mastodon/components/media_attachments';
-export default class StatusCheckBox extends React.PureComponent {
+export default class StatusCheckBox extends PureComponent {
static propTypes = {
id: PropTypes.string.isRequired,
diff --git a/app/javascript/mastodon/features/report/rules.js b/app/javascript/mastodon/features/report/rules.js
index f2db0d9e4c..e804d195cb 100644
--- a/app/javascript/mastodon/features/report/rules.js
+++ b/app/javascript/mastodon/features/report/rules.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
@@ -11,7 +11,7 @@ const mapStateToProps = state => ({
});
export default @connect(mapStateToProps)
-class Rules extends React.PureComponent {
+class Rules extends PureComponent {
static propTypes = {
onNextStep: PropTypes.func.isRequired,
@@ -34,7 +34,7 @@ class Rules extends React.PureComponent {
const { rules, selectedRuleIds } = this.props;
return (
-
+ <>
@@ -57,7 +57,7 @@ class Rules extends React.PureComponent {
-
+ >
);
}
diff --git a/app/javascript/mastodon/features/report/statuses.js b/app/javascript/mastodon/features/report/statuses.js
index d5d86034fb..3ced111103 100644
--- a/app/javascript/mastodon/features/report/statuses.js
+++ b/app/javascript/mastodon/features/report/statuses.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
@@ -14,7 +14,7 @@ const mapStateToProps = (state, { accountId }) => ({
});
export default @connect(mapStateToProps)
-class Statuses extends React.PureComponent {
+class Statuses extends PureComponent {
static propTypes = {
onNextStep: PropTypes.func.isRequired,
@@ -34,7 +34,7 @@ class Statuses extends React.PureComponent {
const { availableStatusIds, selectedStatusIds, onToggle, isLoading } = this.props;
return (
-
+ <>
@@ -54,7 +54,7 @@ class Statuses extends React.PureComponent {
-
+ >
);
}
diff --git a/app/javascript/mastodon/features/report/thanks.js b/app/javascript/mastodon/features/report/thanks.js
index d169b1e329..a58e948763 100644
--- a/app/javascript/mastodon/features/report/thanks.js
+++ b/app/javascript/mastodon/features/report/thanks.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage } from 'react-intl';
@@ -13,7 +13,7 @@ import {
const mapStateToProps = () => ({});
export default @connect(mapStateToProps)
-class Thanks extends React.PureComponent {
+class Thanks extends PureComponent {
static propTypes = {
submitted: PropTypes.bool,
@@ -49,17 +49,17 @@ class Thanks extends React.PureComponent {
const { account, submitted } = this.props;
return (
-
+ <>
{submitted ? : }
{submitted ? : }
{account.getIn(['relationship', 'following']) && (
-
+ <>
-
+ >
)}
@@ -77,7 +77,7 @@ class Thanks extends React.PureComponent {
-
+ >
);
}
diff --git a/app/javascript/mastodon/features/standalone/compose/index.js b/app/javascript/mastodon/features/standalone/compose/index.js
index 0d764575fd..610000036e 100644
--- a/app/javascript/mastodon/features/standalone/compose/index.js
+++ b/app/javascript/mastodon/features/standalone/compose/index.js
@@ -1,10 +1,10 @@
-import React from 'react';
+import { PureComponent } from 'react';
import ComposeFormContainer from '../../compose/containers/compose_form_container';
import NotificationsContainer from '../../ui/containers/notifications_container';
import LoadingBarContainer from '../../ui/containers/loading_bar_container';
import ModalContainer from '../../ui/containers/modal_container';
-export default class Compose extends React.PureComponent {
+export default class Compose extends PureComponent {
render () {
return (
diff --git a/app/javascript/mastodon/features/standalone/hashtag_timeline/index.js b/app/javascript/mastodon/features/standalone/hashtag_timeline/index.js
index d3d8a6507e..f23c5c1f53 100644
--- a/app/javascript/mastodon/features/standalone/hashtag_timeline/index.js
+++ b/app/javascript/mastodon/features/standalone/hashtag_timeline/index.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
@@ -16,7 +16,7 @@ const mapStateToProps = (state, { hashtag }) => ({
});
export default @connect(mapStateToProps)
-class HashtagTimeline extends React.PureComponent {
+class HashtagTimeline extends PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,
diff --git a/app/javascript/mastodon/features/standalone/public_timeline/index.js b/app/javascript/mastodon/features/standalone/public_timeline/index.js
index 19b0b14be6..6a3530bde1 100644
--- a/app/javascript/mastodon/features/standalone/public_timeline/index.js
+++ b/app/javascript/mastodon/features/standalone/public_timeline/index.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
@@ -20,7 +20,7 @@ const mapStateToProps = (state, { local }) => {
};
export default @connect(mapStateToProps)
-class PublicTimeline extends React.PureComponent {
+class PublicTimeline extends PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,
diff --git a/app/javascript/mastodon/features/status/components/action_bar.js b/app/javascript/mastodon/features/status/components/action_bar.js
index edaff959e6..2ece806f1a 100644
--- a/app/javascript/mastodon/features/status/components/action_bar.js
+++ b/app/javascript/mastodon/features/status/components/action_bar.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import IconButton from '../../../components/icon_button';
@@ -46,7 +46,7 @@ const mapStateToProps = (state, { status }) => ({
export default @connect(mapStateToProps)
@injectIntl
-class ActionBar extends React.PureComponent {
+class ActionBar extends PureComponent {
static contextTypes = {
router: PropTypes.object,
diff --git a/app/javascript/mastodon/features/status/components/card.js b/app/javascript/mastodon/features/status/components/card.js
index 3d81bcb29b..cad1526f30 100644
--- a/app/javascript/mastodon/features/status/components/card.js
+++ b/app/javascript/mastodon/features/status/components/card.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Immutable from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';
@@ -58,7 +58,7 @@ const addAutoPlay = html => {
return html;
};
-export default class Card extends React.PureComponent {
+export default class Card extends PureComponent {
static propTypes = {
card: ImmutablePropTypes.map,
@@ -82,7 +82,7 @@ export default class Card extends React.PureComponent {
revealed: !this.props.sensitive,
};
- componentWillReceiveProps (nextProps) {
+ UNSAFE_componentWillReceiveProps (nextProps) {
if (!Immutable.is(this.props.card, nextProps.card)) {
this.setState({ embedded: false, previewLoaded: false });
}
diff --git a/app/javascript/mastodon/features/status/components/detailed_status.js b/app/javascript/mastodon/features/status/components/detailed_status.js
index 13bce1b831..6d7aaaea83 100644
--- a/app/javascript/mastodon/features/status/components/detailed_status.js
+++ b/app/javascript/mastodon/features/status/components/detailed_status.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Avatar from '../../../components/avatar';
@@ -178,7 +177,7 @@ class DetailedStatus extends ImmutablePureComponent {
}
if (status.get('application')) {
- applicationLink =
· {status.getIn(['application', 'name'])};
+ applicationLink = <> ·
{status.getIn(['application', 'name'])}>;
}
const visibilityIconInfo = {
@@ -189,33 +188,33 @@ class DetailedStatus extends ImmutablePureComponent {
};
const visibilityIcon = visibilityIconInfo[status.get('visibility')];
- const visibilityLink =
· ;
+ const visibilityLink = <> ·
>;
if (['private', 'direct'].includes(status.get('visibility'))) {
reblogLink = '';
} else if (this.context.router) {
reblogLink = (
-
- ·
+ <>
+ <> · >
-
+ >
);
} else {
reblogLink = (
-
- ·
+ <>
+ <> · >
-
+ >
);
}
@@ -241,10 +240,10 @@ class DetailedStatus extends ImmutablePureComponent {
if (status.get('edited_at')) {
edited = (
-
- ·
+ <>
+ <> · >
-
+ >
);
}
diff --git a/app/javascript/mastodon/features/status/index.js b/app/javascript/mastodon/features/status/index.js
index 4d7f24834e..e54945368c 100644
--- a/app/javascript/mastodon/features/status/index.js
+++ b/app/javascript/mastodon/features/status/index.js
@@ -1,5 +1,4 @@
import Immutable from 'immutable';
-import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import classNames from 'classnames';
@@ -184,7 +183,7 @@ class Status extends ImmutablePureComponent {
loadedStatusId: undefined,
};
- componentWillMount () {
+ UNSAFE_componentWillMount () {
this.props.dispatch(fetchStatus(this.props.params.statusId));
}
@@ -192,7 +191,7 @@ class Status extends ImmutablePureComponent {
attachFullscreenListener(this.onFullScreenChange);
}
- componentWillReceiveProps (nextProps) {
+ UNSAFE_componentWillReceiveProps (nextProps) {
if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {
this._scrolledIntoView = false;
this.props.dispatch(fetchStatus(nextProps.params.statusId));
diff --git a/app/javascript/mastodon/features/ui/components/__tests__/column-test.js b/app/javascript/mastodon/features/ui/components/__tests__/column-test.js
index a56859be07..8f935299fa 100644
--- a/app/javascript/mastodon/features/ui/components/__tests__/column-test.js
+++ b/app/javascript/mastodon/features/ui/components/__tests__/column-test.js
@@ -1,5 +1,4 @@
import { render, fireEvent, screen } from '@testing-library/react';
-import React from 'react';
import Column from '../column';
describe('
', () => {
diff --git a/app/javascript/mastodon/features/ui/components/actions_modal.js b/app/javascript/mastodon/features/ui/components/actions_modal.js
index 875b2b75d7..31318406fa 100644
--- a/app/javascript/mastodon/features/ui/components/actions_modal.js
+++ b/app/javascript/mastodon/features/ui/components/actions_modal.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
diff --git a/app/javascript/mastodon/features/ui/components/audio_modal.js b/app/javascript/mastodon/features/ui/components/audio_modal.js
index c46fefce89..fbf4c6151e 100644
--- a/app/javascript/mastodon/features/ui/components/audio_modal.js
+++ b/app/javascript/mastodon/features/ui/components/audio_modal.js
@@ -1,4 +1,3 @@
-import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import Audio from 'mastodon/features/audio';
diff --git a/app/javascript/mastodon/features/ui/components/block_modal.js b/app/javascript/mastodon/features/ui/components/block_modal.js
index a07baeaa64..3445cdbb3c 100644
--- a/app/javascript/mastodon/features/ui/components/block_modal.js
+++ b/app/javascript/mastodon/features/ui/components/block_modal.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { injectIntl, FormattedMessage } from 'react-intl';
@@ -38,7 +38,7 @@ const mapDispatchToProps = dispatch => {
export default @connect(makeMapStateToProps, mapDispatchToProps)
@injectIntl
-class BlockModal extends React.PureComponent {
+class BlockModal extends PureComponent {
static propTypes = {
account: PropTypes.object.isRequired,
diff --git a/app/javascript/mastodon/features/ui/components/boost_modal.js b/app/javascript/mastodon/features/ui/components/boost_modal.js
index ab87ee4276..9c0c18ad42 100644
--- a/app/javascript/mastodon/features/ui/components/boost_modal.js
+++ b/app/javascript/mastodon/features/ui/components/boost_modal.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
diff --git a/app/javascript/mastodon/features/ui/components/bundle.js b/app/javascript/mastodon/features/ui/components/bundle.js
index a60ace35ba..7805f18dd5 100644
--- a/app/javascript/mastodon/features/ui/components/bundle.js
+++ b/app/javascript/mastodon/features/ui/components/bundle.js
@@ -1,10 +1,10 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
const emptyComponent = () => null;
const noop = () => { };
-class Bundle extends React.PureComponent {
+class Bundle extends PureComponent {
static propTypes = {
fetchComponent: PropTypes.func.isRequired,
@@ -33,11 +33,11 @@ class Bundle extends React.PureComponent {
forceRender: false,
}
- componentWillMount() {
+ UNSAFE_componentWillMount() {
this.load(this.props);
}
- componentWillReceiveProps(nextProps) {
+ UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.fetchComponent !== this.props.fetchComponent) {
this.load(nextProps);
}
diff --git a/app/javascript/mastodon/features/ui/components/bundle_column_error.js b/app/javascript/mastodon/features/ui/components/bundle_column_error.js
index f39ebd900b..38ad48a32b 100644
--- a/app/javascript/mastodon/features/ui/components/bundle_column_error.js
+++ b/app/javascript/mastodon/features/ui/components/bundle_column_error.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
@@ -13,7 +13,7 @@ const messages = defineMessages({
retry: { id: 'bundle_column_error.retry', defaultMessage: 'Try again' },
});
-class BundleColumnError extends React.PureComponent {
+class BundleColumnError extends PureComponent {
static propTypes = {
onRetry: PropTypes.func.isRequired,
diff --git a/app/javascript/mastodon/features/ui/components/bundle_modal_error.js b/app/javascript/mastodon/features/ui/components/bundle_modal_error.js
index f9365b95bc..d78008832c 100644
--- a/app/javascript/mastodon/features/ui/components/bundle_modal_error.js
+++ b/app/javascript/mastodon/features/ui/components/bundle_modal_error.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
@@ -10,7 +10,7 @@ const messages = defineMessages({
close: { id: 'bundle_modal_error.close', defaultMessage: 'Close' },
});
-class BundleModalError extends React.PureComponent {
+class BundleModalError extends PureComponent {
static propTypes = {
onRetry: PropTypes.func.isRequired,
diff --git a/app/javascript/mastodon/features/ui/components/column.js b/app/javascript/mastodon/features/ui/components/column.js
index 15538ea387..91ecf74523 100644
--- a/app/javascript/mastodon/features/ui/components/column.js
+++ b/app/javascript/mastodon/features/ui/components/column.js
@@ -1,11 +1,11 @@
-import React from 'react';
+import { PureComponent } from 'react';
import ColumnHeader from './column_header';
import PropTypes from 'prop-types';
import { debounce } from 'lodash';
import { scrollTop } from '../../../scroll';
import { isMobile } from '../../../is_mobile';
-export default class Column extends React.PureComponent {
+export default class Column extends PureComponent {
static propTypes = {
heading: PropTypes.string,
diff --git a/app/javascript/mastodon/features/ui/components/column_header.js b/app/javascript/mastodon/features/ui/components/column_header.js
index b1a36e173d..6360ceb980 100644
--- a/app/javascript/mastodon/features/ui/components/column_header.js
+++ b/app/javascript/mastodon/features/ui/components/column_header.js
@@ -1,9 +1,9 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Icon from 'mastodon/components/icon';
-export default class ColumnHeader extends React.PureComponent {
+export default class ColumnHeader extends PureComponent {
static propTypes = {
icon: PropTypes.string,
diff --git a/app/javascript/mastodon/features/ui/components/column_link.js b/app/javascript/mastodon/features/ui/components/column_link.js
index 0a25f1ea20..5c6de4d858 100644
--- a/app/javascript/mastodon/features/ui/components/column_link.js
+++ b/app/javascript/mastodon/features/ui/components/column_link.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import Icon from 'mastodon/components/icon';
diff --git a/app/javascript/mastodon/features/ui/components/column_loading.js b/app/javascript/mastodon/features/ui/components/column_loading.js
index 0cdfd05d80..87da4f4209 100644
--- a/app/javascript/mastodon/features/ui/components/column_loading.js
+++ b/app/javascript/mastodon/features/ui/components/column_loading.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
import Column from '../../../components/column';
diff --git a/app/javascript/mastodon/features/ui/components/column_subheading.js b/app/javascript/mastodon/features/ui/components/column_subheading.js
index 8160c4aa39..e970a0bfdd 100644
--- a/app/javascript/mastodon/features/ui/components/column_subheading.js
+++ b/app/javascript/mastodon/features/ui/components/column_subheading.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
const ColumnSubheading = ({ text }) => {
diff --git a/app/javascript/mastodon/features/ui/components/columns_area.js b/app/javascript/mastodon/features/ui/components/columns_area.js
index 68017a5f1e..0ae2e56154 100644
--- a/app/javascript/mastodon/features/ui/components/columns_area.js
+++ b/app/javascript/mastodon/features/ui/components/columns_area.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { Children, cloneElement } from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePropTypes from 'react-immutable-proptypes';
@@ -78,7 +78,7 @@ class ColumnsArea extends ImmutablePureComponent {
renderComposePanel: !(this.mediaQuery && this.mediaQuery.matches),
}
- componentWillReceiveProps() {
+ UNSAFE_componentWillReceiveProps() {
if (typeof this.pendingIndex !== 'number' && this.lastIndex !== getIndex(this.context.router.history.location.pathname)) {
this.setState({ shouldAnimate: false });
}
@@ -104,7 +104,7 @@ class ColumnsArea extends ImmutablePureComponent {
this.setState({ shouldAnimate: true });
}
- componentWillUpdate(nextProps) {
+ UNSAFE_componentWillUpdate(nextProps) {
if (this.props.singleColumn !== nextProps.singleColumn && nextProps.singleColumn) {
this.node.removeEventListener('wheel', this.handleWheel);
}
@@ -191,7 +191,7 @@ class ColumnsArea extends ImmutablePureComponent {
const icon = link.props['data-preview-icon'];
const view = (index === columnIndex) ?
- React.cloneElement(this.props.children) :
+ cloneElement(this.props.children) :
;
return (
@@ -263,7 +263,7 @@ class ColumnsArea extends ImmutablePureComponent {
);
})}
- {React.Children.map(children, child => React.cloneElement(child, { multiColumn: true }))}
+ {Children.map(children, child => cloneElement(child, { multiColumn: true }))}
);
}
diff --git a/app/javascript/mastodon/features/ui/components/compare_history_modal.js b/app/javascript/mastodon/features/ui/components/compare_history_modal.js
index ecccc8f7df..116347da24 100644
--- a/app/javascript/mastodon/features/ui/components/compare_history_modal.js
+++ b/app/javascript/mastodon/features/ui/components/compare_history_modal.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
@@ -24,7 +24,7 @@ const mapDispatchToProps = dispatch => ({
});
export default @connect(mapStateToProps, mapDispatchToProps)
-class CompareHistoryModal extends React.PureComponent {
+class CompareHistoryModal extends PureComponent {
static propTypes = {
onClose: PropTypes.func.isRequired,
@@ -64,10 +64,10 @@ class CompareHistoryModal extends React.PureComponent {