Use the new JSX transform (#25064)

This commit is contained in:
Renaud Chaput 2023-05-23 10:52:27 +02:00 committed by GitHub
parent e387175fc9
commit 8f66126b10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
241 changed files with 366 additions and 473 deletions

View File

@ -101,7 +101,12 @@ module.exports = {
'react/jsx-equals-spacing': 'error',
'react/jsx-no-bind': 'error',
'react/jsx-no-target-blank': 'off',
'react/jsx-tag-spacing': 'error',
'react/jsx-uses-react': 'off', // not needed with new JSX transform
'react/jsx-wrap-multilines': 'error',
'react/no-deprecated': 'off',
'react/no-unknown-property': 'off',
'react/react-in-jsx-scope': 'off', // not needed with new JSX transform
'react/self-closing-comp': 'error',
// recommended values found in https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/index.js
@ -339,6 +344,9 @@ module.exports = {
'import/no-default-export': 'warn',
'react/prefer-stateless-function': 'warn',
'react/function-component-definition': ['error', { namedComponents: 'arrow-function' }],
'react/jsx-uses-react': 'off', // not needed with new JSX transform
'react/react-in-jsx-scope': 'off', // not needed with new JSX transform
'react/prop-types': 'off',
},
},
{

View File

@ -1,4 +1,3 @@
import React from 'react';
import renderer from 'react-test-renderer';
import AutosuggestEmoji from '../autosuggest_emoji';

View File

@ -1,4 +1,3 @@
import React from 'react';
import renderer from 'react-test-renderer';
import { fromJS } from 'immutable';
import { Avatar } from '../avatar';

View File

@ -1,4 +1,3 @@
import React from 'react';
import renderer from 'react-test-renderer';
import { fromJS } from 'immutable';
import { AvatarOverlay } from '../avatar_overlay';

View File

@ -1,5 +1,4 @@
import { render, fireEvent, screen } from '@testing-library/react';
import React from 'react';
import renderer from 'react-test-renderer';
import Button from '../button';

View File

@ -1,4 +1,3 @@
import React from 'react';
import renderer from 'react-test-renderer';
import { fromJS } from 'immutable';
import { DisplayName } from '../display_name';

View File

@ -1,4 +1,3 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { Avatar } from './avatar';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import api from 'mastodon/api';
import { FormattedNumber } from 'react-intl';
@ -24,7 +24,7 @@ const percIncrease = (a, b) => {
return percent;
};
export default class Counter extends React.PureComponent {
export default class Counter extends PureComponent {
static propTypes = {
measure: PropTypes.string.isRequired,
@ -62,25 +62,25 @@ export default class Counter extends React.PureComponent {
if (loading) {
content = (
<React.Fragment>
<Fragment>
<span className='sparkline__value__total'><Skeleton width={43} /></span>
<span className='sparkline__value__change'><Skeleton width={43} /></span>
</React.Fragment>
</Fragment>
);
} else {
const measure = data[0];
const percentChange = measure.previous_total && percIncrease(measure.previous_total * 1, measure.total * 1);
content = (
<React.Fragment>
<Fragment>
<span className='sparkline__value__total'>{measure.human_value || <FormattedNumber value={measure.total} />}</span>
{measure.previous_total && (<span className={classNames('sparkline__value__change', { positive: percentChange > 0, negative: percentChange < 0 })}>{percentChange > 0 && '+'}<FormattedNumber value={percentChange} style='percent' /></span>)}
</React.Fragment>
</Fragment>
);
}
const inner = (
<React.Fragment>
<Fragment>
<div className='sparkline__value'>
{content}
</div>
@ -96,7 +96,7 @@ export default class Counter extends React.PureComponent {
</Sparklines>
)}
</div>
</React.Fragment>
</Fragment>
);
if (href) {

View File

@ -1,11 +1,11 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import api from 'mastodon/api';
import { FormattedNumber } from 'react-intl';
import { roundTo10 } from 'mastodon/utils/numbers';
import { Skeleton } from 'mastodon/components/skeleton';
export default class Dimension extends React.PureComponent {
export default class Dimension extends PureComponent {
static propTypes = {
dimension: PropTypes.string.isRequired,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import api from 'mastodon/api';
import { injectIntl, defineMessages } from 'react-intl';
@ -10,7 +10,7 @@ const messages = defineMessages({
violation: { id: 'report.categories.violation', defaultMessage: 'Content violates one or more server rules' },
});
class Category extends React.PureComponent {
class Category extends PureComponent {
static propTypes = {
id: PropTypes.string.isRequired,
@ -52,7 +52,7 @@ class Category extends React.PureComponent {
}
class Rule extends React.PureComponent {
class Rule extends PureComponent {
static propTypes = {
id: PropTypes.string.isRequired,
@ -84,7 +84,7 @@ class Rule extends React.PureComponent {
}
class ReportReasonSelector extends React.PureComponent {
class ReportReasonSelector extends PureComponent {
static propTypes = {
id: PropTypes.string.isRequired,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import api from 'mastodon/api';
import { FormattedMessage, FormattedNumber, FormattedDate } from 'react-intl';
@ -14,7 +14,7 @@ const dateForCohort = cohort => {
}
};
export default class Retention extends React.PureComponent {
export default class Retention extends PureComponent {
static propTypes = {
start_at: PropTypes.string,

View File

@ -1,11 +1,11 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import api from 'mastodon/api';
import { FormattedMessage } from 'react-intl';
import classNames from 'classnames';
import Hashtag from 'mastodon/components/hashtag';
export default class Trends extends React.PureComponent {
export default class Trends extends PureComponent {
static propTypes = {
limit: PropTypes.number.isRequired,

View File

@ -1,4 +1,4 @@
import React, { useCallback, useState } from 'react';
import { useCallback, useState } from 'react';
import { TransitionMotion, spring } from 'react-motion';

View File

@ -1,4 +1,3 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import ImmutablePureComponent from 'react-immutable-pure-component';

View File

@ -1,9 +1,9 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import unicodeMapping from '../features/emoji/emoji_unicode_mapping_light';
import { assetHost } from 'mastodon/utils/config';
export default class AutosuggestEmoji extends React.PureComponent {
export default class AutosuggestEmoji extends PureComponent {
static propTypes = {
emoji: PropTypes.object.isRequired,

View File

@ -1,9 +1,9 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ShortNumber from 'mastodon/components/short_number';
import { FormattedMessage } from 'react-intl';
export default class AutosuggestHashtag extends React.PureComponent {
export default class AutosuggestHashtag extends PureComponent {
static propTypes = {
tag: PropTypes.shape({

View File

@ -1,4 +1,3 @@
import React from 'react';
import AutosuggestAccountContainer from '../features/compose/containers/autosuggest_account_container';
import AutosuggestEmoji from './autosuggest_emoji';
import AutosuggestHashtag from './autosuggest_hashtag';

View File

@ -1,4 +1,3 @@
import React from 'react';
import AutosuggestAccountContainer from '../features/compose/containers/autosuggest_account_container';
import AutosuggestEmoji from './autosuggest_emoji';
import AutosuggestHashtag from './autosuggest_hashtag';

View File

@ -1,5 +1,3 @@
import * as React from 'react';
import classNames from 'classnames';
import { useHovering } from '../../hooks/useHovering';

View File

@ -1,10 +1,10 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { autoPlayGif } from '../initial_state';
import { Avatar } from './avatar';
export default class AvatarComposite extends React.PureComponent {
export default class AvatarComposite extends PureComponent {
static propTypes = {
accounts: ImmutablePropTypes.list.isRequired,

View File

@ -1,5 +1,3 @@
import React from 'react';
import { useHovering } from '../../hooks/useHovering';
import type { Account } from '../../types/resources';
import { autoPlayGif } from '../initial_state';

View File

@ -1,4 +1,4 @@
import React, { useRef, useEffect } from 'react';
import { memo, useRef, useEffect } from 'react';
import { decode } from 'blurhash';
@ -43,6 +43,6 @@ const Blurhash: React.FC<Props> = ({
);
};
const MemoizedBlurhash = React.memo(Blurhash);
const MemoizedBlurhash = memo(Blurhash);
export { MemoizedBlurhash as Blurhash };

View File

@ -1,8 +1,8 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
export default class Button extends React.PureComponent {
export default class Button extends PureComponent {
static propTypes = {
text: PropTypes.node,

View File

@ -1,5 +1,3 @@
import React from 'react';
export const Check: React.FC = () => (
<svg
xmlns='http://www.w3.org/2000/svg'

View File

@ -1,11 +1,11 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { supportsPassiveEvents } from 'detect-passive-events';
import { scrollTop } from '../scroll';
const listenerOptions = supportsPassiveEvents ? { passive: true } : false;
export default class Column extends React.PureComponent {
export default class Column extends PureComponent {
static propTypes = {
children: PropTypes.node,

View File

@ -1,10 +1,10 @@
import React from 'react';
import { PureComponent } from 'react';
import { FormattedMessage } from 'react-intl';
import PropTypes from 'prop-types';
import { Icon } from 'mastodon/components/icon';
import { createPortal } from 'react-dom';
export default class ColumnBackButton extends React.PureComponent {
export default class ColumnBackButton extends PureComponent {
static contextTypes = {
router: PropTypes.object,

View File

@ -1,4 +1,3 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
import ColumnBackButton from './column_back_button';
import { Icon } from 'mastodon/components/icon';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { createPortal } from 'react-dom';
import classNames from 'classnames';
@ -12,7 +12,7 @@ const messages = defineMessages({
moveRight: { id: 'column_header.moveRight_settings', defaultMessage: 'Move column to the right' },
});
class ColumnHeader extends React.PureComponent {
class ColumnHeader extends PureComponent {
static contextTypes = {
router: PropTypes.object,

View File

@ -1,5 +1,4 @@
// @ts-check
import React from 'react';
import { FormattedMessage } from 'react-intl';
/**

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import { IconButton } from './icon_button';
import PropTypes from 'prop-types';
import { injectIntl, defineMessages } from 'react-intl';
@ -8,7 +8,7 @@ const messages = defineMessages({
dismiss: { id: 'dismissable_banner.dismiss', defaultMessage: 'Dismiss' },
});
class DismissableBanner extends React.PureComponent {
class DismissableBanner extends PureComponent {
static propTypes = {
id: PropTypes.string.isRequired,

View File

@ -1,4 +1,4 @@
import React, { useCallback } from 'react';
import { useCallback } from 'react';
import type { InjectedIntl } from 'react-intl';
import { defineMessages, injectIntl } from 'react-intl';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, cloneElement, Children, Fragment } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { IconButton } from './icon_button';
@ -10,7 +10,7 @@ import { CircularProgress } from 'mastodon/components/loading_indicator';
const listenerOptions = supportsPassiveEvents ? { passive: true, capture: true } : true;
let id = 0;
class DropdownMenu extends React.PureComponent {
class DropdownMenu extends PureComponent {
static contextTypes = {
router: PropTypes.object,
@ -155,7 +155,7 @@ class DropdownMenu extends React.PureComponent {
}
export default class Dropdown extends React.PureComponent {
export default class Dropdown extends PureComponent {
static contextTypes = {
router: PropTypes.object,
@ -286,7 +286,7 @@ export default class Dropdown extends React.PureComponent {
const open = this.state.id === openDropdownId;
const button = children ? React.cloneElement(React.Children.only(children), {
const button = children ? cloneElement(Children.only(children), {
onClick: this.handleClick,
onMouseDown: this.handleMouseDown,
onKeyDown: this.handleButtonKeyDown,
@ -306,7 +306,7 @@ export default class Dropdown extends React.PureComponent {
);
return (
<React.Fragment>
<Fragment>
<span ref={this.setTargetRef}>
{button}
</span>
@ -329,7 +329,7 @@ export default class Dropdown extends React.PureComponent {
</div>
)}
</Overlay>
</React.Fragment>
</Fragment>
);
}

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage, injectIntl } from 'react-intl';
import { Icon } from 'mastodon/components/icon';
@ -16,7 +16,7 @@ const mapDispatchToProps = (dispatch, { statusId }) => ({
});
class EditedTimestamp extends React.PureComponent {
class EditedTimestamp extends PureComponent {
static propTypes = {
statusId: PropTypes.string.isRequired,

View File

@ -1,11 +1,11 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { version, source_url } from 'mastodon/initial_state';
import StackTrace from 'stacktrace-js';
import { Helmet } from 'react-helmet';
export default class ErrorBoundary extends React.PureComponent {
export default class ErrorBoundary extends PureComponent {
static propTypes = {
children: PropTypes.node,

View File

@ -1,4 +1,4 @@
import React, { useCallback, useState } from 'react';
import { useCallback, useState } from 'react';
interface Props {
src: string;

View File

@ -1,5 +1,5 @@
// @ts-check
import React from 'react';
import { Component, Fragment } from 'react';
import { Sparklines, SparklinesCurve } from 'react-sparklines';
import { FormattedMessage } from 'react-intl';
import PropTypes from 'prop-types';
@ -9,7 +9,7 @@ import ShortNumber from 'mastodon/components/short_number';
import { Skeleton } from 'mastodon/components/skeleton';
import classNames from 'classnames';
class SilentErrorBoundary extends React.Component {
class SilentErrorBoundary extends Component {
static propTypes = {
children: PropTypes.node,
@ -69,7 +69,7 @@ const Hashtag = ({ name, to, people, uses, history, className, description, with
<div className={classNames('trends__item', className)}>
<div className='trends__item__name'>
<Link to={to}>
{name ? <React.Fragment>#<span>{name}</span></React.Fragment> : <Skeleton width={50} />}
{name ? <Fragment>#<span>{name}</span></Fragment> : <Skeleton width={50} />}
</Link>
{description ? (

View File

@ -1,5 +1,3 @@
import React from 'react';
import classNames from 'classnames';
interface Props extends React.HTMLAttributes<HTMLImageElement> {

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import classNames from 'classnames';
@ -32,7 +32,7 @@ interface States {
activate: boolean;
deactivate: boolean;
}
export class IconButton extends React.PureComponent<Props, States> {
export class IconButton extends PureComponent<Props, States> {
static defaultProps = {
size: 18,
active: false,
@ -127,14 +127,14 @@ export class IconButton extends React.PureComponent<Props, States> {
}
let contents = (
<React.Fragment>
<>
<Icon id={icon} fixedWidth aria-hidden='true' />{' '}
{typeof counter !== 'undefined' && (
<span className='icon-button__counter'>
<AnimatedNumber value={counter} obfuscate={obfuscateCount} />
</span>
)}
</React.Fragment>
</>
);
if (href != null) {

View File

@ -1,5 +1,3 @@
import React from 'react';
import { Icon } from './icon';
const formatNumber = (num: number): number | string => (num > 40 ? '40+' : num);

View File

@ -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';
@ -14,7 +14,7 @@ const makeMapStateToProps = () => {
return mapStateToProps;
};
class InlineAccount extends React.PureComponent {
class InlineAccount extends PureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,

View File

@ -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 })}
</article>
);
}
return (
<article ref={this.handleRef} aria-posinset={index + 1} aria-setsize={listLength} data-id={id} tabIndex={0}>
{children && React.cloneElement(children, { hidden: false })}
{children && cloneElement(children, { hidden: false })}
</article>
);
}

View File

@ -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';
@ -7,7 +7,7 @@ const messages = defineMessages({
load_more: { id: 'status.load_more', defaultMessage: 'Load more' },
});
class LoadGap extends React.PureComponent {
class LoadGap extends PureComponent {
static propTypes = {
disabled: PropTypes.bool,

View File

@ -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,

View File

@ -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,

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
export const CircularProgress = ({ size, strokeWidth }) => {

View File

@ -1,5 +1,3 @@
import React from 'react';
import logo from 'mastodon/../images/logo.svg';
export const WordmarkLogo: React.FC = () => (

View File

@ -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';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { is } from 'immutable';
@ -13,7 +13,7 @@ const messages = defineMessages({
toggle_visible: { id: 'media_gallery.toggle_visible', defaultMessage: '{number, plural, one {Hide image} other {Hide images}}' },
});
class Item extends React.PureComponent {
class Item extends PureComponent {
static propTypes = {
attachment: ImmutablePropTypes.map.isRequired,
@ -196,7 +196,7 @@ class Item extends React.PureComponent {
}
class MediaGallery extends React.PureComponent {
class MediaGallery extends PureComponent {
static propTypes = {
sensitive: PropTypes.bool,

View File

@ -1,10 +1,10 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import 'wicg-inert';
import { createBrowserHistory } from 'history';
import { multiply } from 'color-blend';
export default class ModalRoot extends React.PureComponent {
export default class ModalRoot extends PureComponent {
static contextTypes = {
router: PropTypes.object,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import { Switch, Route, withRouter } from 'react-router-dom';
import { showTrends } from 'mastodon/initial_state';
import Trends from 'mastodon/features/getting_started/containers/trends_container';
@ -15,7 +15,7 @@ const DefaultNavigation = () => (
</>
);
class NavigationPortal extends React.PureComponent {
class NavigationPortal extends PureComponent {
render () {
return (

View File

@ -1,5 +1,3 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
export const NotSignedInIndicator: React.FC = () => (

View File

@ -1,11 +1,11 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Icon } from 'mastodon/components/icon';
import { removePictureInPicture } from 'mastodon/actions/picture_in_picture';
import { connect } from 'react-redux';
import { FormattedMessage } from 'react-intl';
class PictureInPicturePlaceholder extends React.PureComponent {
class PictureInPicturePlaceholder extends PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,

View File

@ -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';

View File

@ -1,5 +1,3 @@
import React from 'react';
import classNames from 'classnames';
interface Props {

View File

@ -1,4 +1,3 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
import illustration from 'mastodon/../images/elephant_ui_working.svg';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { Component } from 'react';
import type { InjectedIntl } from 'react-intl';
import { injectIntl, defineMessages } from 'react-intl';
@ -199,7 +199,7 @@ interface Props {
interface States {
now: number;
}
class RelativeTimestamp extends React.Component<Props, States> {
class RelativeTimestamp extends Component<Props, States> {
state = {
now: this.props.intl.now(),
};

View File

@ -1,4 +1,4 @@
import React, { PureComponent } from 'react';
import { Children, cloneElement, PureComponent } from 'react';
import ScrollContainer from 'mastodon/containers/scroll_container';
import PropTypes from 'prop-types';
import IntersectionObserverArticleContainer from '../containers/intersection_observer_article_container';
@ -184,8 +184,8 @@ class ScrollableList extends PureComponent {
};
getSnapshotBeforeUpdate (prevProps) {
const someItemInserted = React.Children.count(prevProps.children) > 0 &&
React.Children.count(prevProps.children) < React.Children.count(this.props.children) &&
const someItemInserted = Children.count(prevProps.children) > 0 &&
Children.count(prevProps.children) < Children.count(this.props.children) &&
this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props);
const pendingChanged = (prevProps.numPending > 0) !== (this.props.numPending > 0);
@ -293,7 +293,7 @@ class ScrollableList extends PureComponent {
render () {
const { children, scrollKey, trackScroll, showLoading, isLoading, hasMore, numPending, prepend, alwaysPrepend, append, emptyMessage, onLoadMore } = this.props;
const { fullscreen } = this.state;
const childrenCount = React.Children.count(children);
const childrenCount = Children.count(children);
const loadMore = (hasMore && onLoadMore) ? <LoadMore visible={!isLoading} onClick={this.handleLoadMore} /> : null;
const loadPending = (numPending > 0) ? <LoadPending count={numPending} onClick={this.handleLoadPending} /> : null;
@ -319,7 +319,7 @@ class ScrollableList extends PureComponent {
{loadPending}
{React.Children.map(this.props.children, (child, index) => (
{Children.map(this.props.children, (child, index) => (
<IntersectionObserverArticleContainer
key={child.key}
id={child.key}
@ -328,7 +328,7 @@ class ScrollableList extends PureComponent {
intersectionObserverWrapper={this.intersectionObserverWrapper}
saveHeightKey={trackScroll ? `${this.context.router.route.location.key}:${scrollKey}` : null}
>
{React.cloneElement(child, {
{cloneElement(child, {
getScrollPosition: this.getScrollPosition,
updateScrollBottom: this.updateScrollBottom,
cachedMediaWidth: this.state.cachedMediaWidth,

View File

@ -1,5 +1,5 @@
import PropTypes from 'prop-types';
import React from 'react';
import { PureComponent } from 'react';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { fetchServer } from 'mastodon/actions/server';
@ -18,7 +18,7 @@ const mapStateToProps = state => ({
server: state.getIn(['server', 'server']),
});
class ServerBanner extends React.PureComponent {
class ServerBanner extends PureComponent {
static propTypes = {
server: PropTypes.object,

View File

@ -1,4 +1,4 @@
import React, { useCallback, useState } from 'react';
import { useCallback, useState } from 'react';
import classNames from 'classnames';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { memo } from 'react';
import PropTypes from 'prop-types';
import { toShortNumber, pluralReady, DECIMAL_UNITS } from '../utils/numbers';
import { FormattedMessage, FormattedNumber } from 'react-intl';
@ -109,4 +109,4 @@ ShortNumberCounter.propTypes = {
value: PropTypes.arrayOf(PropTypes.number),
};
export default React.memo(ShortNumber);
export default memo(ShortNumber);

View File

@ -1,5 +1,3 @@
import React from 'react';
interface Props {
width?: number | string;
height?: number | string;

View File

@ -1,4 +1,3 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { Avatar } from './avatar';

View File

@ -1,4 +1,3 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { FormattedMessage, injectIntl } from 'react-intl';
@ -11,7 +11,7 @@ import { autoPlayGif, languages as preloadedLanguages } from 'mastodon/initial_s
const MAX_HEIGHT = 706; // 22px * 32 (+ 2px padding at the top)
class TranslateButton extends React.PureComponent {
class TranslateButton extends PureComponent {
static propTypes = {
translation: ImmutablePropTypes.map,
@ -52,7 +52,7 @@ const mapStateToProps = state => ({
languages: state.getIn(['server', 'translationLanguages', 'items']),
});
class StatusContent extends React.PureComponent {
class StatusContent extends PureComponent {
static contextTypes = {
router: PropTypes.object,

View File

@ -1,5 +1,4 @@
import { debounce } from 'lodash';
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import StatusContainer from '../containers/status_container';

View File

@ -1,5 +1,3 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
interface Props {

View File

@ -1,5 +1,3 @@
import React from 'react';
import { Icon } from './icon';
interface Props {

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { makeGetAccount } from '../selectors';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { IntlProvider, addLocaleData } from 'react-intl';
import { getLocale } from '../locales';
@ -6,7 +6,7 @@ import { getLocale } from '../locales';
const { localeData, messages } = getLocale();
addLocaleData(localeData);
export default class AdminComponent extends React.PureComponent {
export default class AdminComponent extends PureComponent {
static propTypes = {
locale: PropTypes.string.isRequired,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import { Provider } from 'react-redux';
import PropTypes from 'prop-types';
import { store } from '../store';
@ -18,7 +18,7 @@ if (initialState) {
store.dispatch(fetchCustomEmojis());
export default class TimelineContainer extends React.PureComponent {
export default class TimelineContainer extends PureComponent {
static propTypes = {
locale: PropTypes.string.isRequired,

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import { blockDomain, unblockDomain } from '../actions/domain_blocks';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';

View File

@ -1,5 +1,5 @@
import PropTypes from 'prop-types';
import React from 'react';
import { PureComponent } from 'react';
import { Helmet } from 'react-helmet';
import { IntlProvider, addLocaleData } from 'react-intl';
import { Provider as ReduxProvider } from 'react-redux';
@ -34,7 +34,7 @@ const createIdentityContext = state => ({
permissions: state.role ? state.role.permissions : 0,
});
export default class Mastodon extends React.PureComponent {
export default class Mastodon extends PureComponent {
static propTypes = {
locale: PropTypes.string.isRequired,

View File

@ -1,4 +1,4 @@
import React, { PureComponent, Fragment } from 'react';
import { PureComponent, Fragment } from 'react';
import { createPortal } from 'react-dom';
import PropTypes from 'prop-types';
import { IntlProvider, addLocaleData } from 'react-intl';

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import Status from '../components/status';
import { makeGetStatus, makeGetPictureInPicture } from '../selectors';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
@ -41,7 +41,7 @@ const mapStateToProps = state => ({
domainBlocks: state.getIn(['server', 'domainBlocks']),
});
class Section extends React.PureComponent {
class Section extends PureComponent {
static propTypes = {
title: PropTypes.string,
@ -80,7 +80,7 @@ class Section extends React.PureComponent {
}
class About extends React.PureComponent {
class About extends PureComponent {
static propTypes = {
server: ImmutablePropTypes.map,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
@ -10,7 +10,7 @@ const messages = defineMessages({
placeholder: { id: 'account_note.placeholder', defaultMessage: 'Click to add a note' },
});
class InlineAlert extends React.PureComponent {
class InlineAlert extends PureComponent {
static propTypes = {
show: PropTypes.bool,

View File

@ -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';

View File

@ -1,4 +1,3 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { Fragment } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
@ -399,10 +399,10 @@ class Header extends ImmutablePureComponent {
{!suspended && (
<div className='account__header__tabs__buttons'>
{!hidden && (
<React.Fragment>
<Fragment>
{actionBtn}
{bellBtn}
</React.Fragment>
</Fragment>
)}
<DropdownMenuContainer disabled={menu.length === 0} items={menu} icon='ellipsis-v' size={24} direction='right' />

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import FeaturedTags from 'mastodon/features/account/containers/featured_tags_container';
@ -19,7 +19,7 @@ const mapStateToProps = (state, { match: { params: { acct } } }) => {
};
};
class AccountNavigation extends React.PureComponent {
class AccountNavigation extends PureComponent {
static propTypes = {
match: PropTypes.shape({

View File

@ -3,7 +3,6 @@ import classNames from 'classnames';
import { Icon } from 'mastodon/components/icon';
import { autoPlayGif, displayMedia, useBlurhash } from 'mastodon/initial_state';
import PropTypes from 'prop-types';
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';

View File

@ -1,4 +1,3 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import InnerHeader from '../../account/components/header';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { revealAccount } from 'mastodon/actions/accounts';
@ -14,7 +14,7 @@ const mapDispatchToProps = (dispatch, { accountId }) => ({
});
class LimitedAccountHint extends React.PureComponent {
class LimitedAccountHint extends PureComponent {
static propTypes = {
accountId: PropTypes.string.isRequired,

View File

@ -1,4 +1,3 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
const MemorialNote = () => (

View File

@ -1,4 +1,3 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import { makeGetAccount, getAccountHidden } from '../../../selectors';
import Header from '../components/header';

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
import { formatTime, getPointerPosition, fileNameFromURL } from 'mastodon/features/video';
@ -22,7 +22,7 @@ const messages = defineMessages({
const TICK_SIZE = 10;
const PADDING = 180;
class Audio extends React.PureComponent {
class Audio extends PureComponent {
static propTypes = {
src: PropTypes.string.isRequired,

View File

@ -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';

View File

@ -1,6 +1,5 @@
import { debounce } from 'lodash';
import PropTypes from 'prop-types';
import React from 'react';
import { Helmet } from 'react-helmet';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ImmutablePropTypes from 'react-immutable-proptypes';

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import { FormattedMessage } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';

View File

@ -1,10 +1,10 @@
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';
class ColumnSettings extends React.PureComponent {
class ColumnSettings extends PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,

View File

@ -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';
@ -30,7 +30,7 @@ const mapStateToProps = (state, { columnId }) => {
};
};
class CommunityTimeline extends React.PureComponent {
class CommunityTimeline extends PureComponent {
static contextTypes = {
router: PropTypes.object,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import DropdownMenuContainer from '../../../containers/dropdown_menu_container';
@ -20,7 +20,7 @@ const messages = defineMessages({
bookmarks: { id: 'navigation_bar.bookmarks', defaultMessage: 'Bookmarks' },
});
class ActionBar extends React.PureComponent {
class ActionBar extends PureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,

View File

@ -1,4 +1,3 @@
import React from 'react';
import { Avatar } from '../../../components/avatar';
import { DisplayName } from '../../../components/display_name';
import ImmutablePropTypes from 'react-immutable-proptypes';

View File

@ -1,8 +1,8 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { length } from 'stringz';
export default class CharacterCounter extends React.PureComponent {
export default class CharacterCounter extends PureComponent {
static propTypes = {
text: PropTypes.string.isRequired,

View File

@ -1,4 +1,3 @@
import React from 'react';
import CharacterCounter from './character_counter';
import Button from '../../../components/button';
import ImmutablePropTypes from 'react-immutable-proptypes';

View File

@ -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 { EmojiPicker as EmojiPickerAsync } from '../../ui/util/async-components';
@ -47,7 +47,7 @@ const notFoundFn = () => (
</div>
);
class ModifierPickerMenu extends React.PureComponent {
class ModifierPickerMenu extends PureComponent {
static propTypes = {
active: PropTypes.bool,
@ -108,7 +108,7 @@ class ModifierPickerMenu extends React.PureComponent {
}
class ModifierPicker extends React.PureComponent {
class ModifierPicker extends PureComponent {
static propTypes = {
active: PropTypes.bool,
@ -144,7 +144,7 @@ class ModifierPicker extends React.PureComponent {
}
class EmojiPickerMenuImpl extends React.PureComponent {
class EmojiPickerMenuImpl extends PureComponent {
static propTypes = {
custom_emojis: ImmutablePropTypes.list,
@ -306,7 +306,7 @@ class EmojiPickerMenuImpl extends React.PureComponent {
const EmojiPickerMenu = injectIntl(EmojiPickerMenuImpl);
class EmojiPickerDropdown extends React.PureComponent {
class EmojiPickerDropdown extends PureComponent {
static propTypes = {
custom_emojis: ImmutablePropTypes.list,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { injectIntl, defineMessages } from 'react-intl';
import TextIconButton from './text_icon_button';
@ -17,7 +17,7 @@ const messages = defineMessages({
const listenerOptions = supportsPassiveEvents ? { passive: true, capture: true } : true;
class LanguageDropdownMenu extends React.PureComponent {
class LanguageDropdownMenu extends PureComponent {
static propTypes = {
value: PropTypes.string.isRequired,
@ -238,7 +238,7 @@ class LanguageDropdownMenu extends React.PureComponent {
}
class LanguageDropdown extends React.PureComponent {
class LanguageDropdown extends PureComponent {
static propTypes = {
value: PropTypes.string,

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ActionBar from './action_bar';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import { IconButton } from '../../../components/icon_button';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
@ -13,7 +13,7 @@ const iconStyle = {
lineHeight: '27px',
};
class PollButton extends React.PureComponent {
class PollButton extends PureComponent {
static propTypes = {
disabled: PropTypes.bool,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
@ -20,7 +20,7 @@ const messages = defineMessages({
days: { id: 'intervals.full.days', defaultMessage: '{number, plural, one {# day} other {# days}}' },
});
class OptionIntl extends React.PureComponent {
class OptionIntl extends PureComponent {
static propTypes = {
title: PropTypes.string.isRequired,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { injectIntl, defineMessages } from 'react-intl';
import { IconButton } from '../../../components/icon_button';
@ -21,7 +21,7 @@ const messages = defineMessages({
const listenerOptions = supportsPassiveEvents ? { passive: true, capture: true } : true;
class PrivacyDropdownMenu extends React.PureComponent {
class PrivacyDropdownMenu extends PureComponent {
static propTypes = {
style: PropTypes.object,
@ -133,7 +133,7 @@ class PrivacyDropdownMenu extends React.PureComponent {
}
class PrivacyDropdown extends React.PureComponent {
class PrivacyDropdown extends PureComponent {
static propTypes = {
isUserTouching: PropTypes.func,

View File

@ -1,4 +1,3 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { Avatar } from '../../../components/avatar';

View File

@ -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';
@ -12,7 +12,7 @@ const messages = defineMessages({
placeholderSignedIn: { id: 'search.search_or_paste', defaultMessage: 'Search or paste URL' },
});
class Search extends React.PureComponent {
class Search extends PureComponent {
static contextTypes = {
router: PropTypes.object.isRequired,

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
const iconStyle = {
@ -7,7 +7,7 @@ const iconStyle = {
width: `${18 * 1.28571429}px`,
};
export default class TextIconButton extends React.PureComponent {
export default class TextIconButton extends PureComponent {
static propTypes = {
label: PropTypes.string.isRequired,

View File

@ -1,4 +1,3 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import Motion from '../../ui/util/optional_motion';

View File

@ -1,4 +1,3 @@
import React from 'react';
import { IconButton } from '../../../components/icon_button';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';

View File

@ -1,4 +1,3 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import UploadProgressContainer from '../containers/upload_progress_container';
import ImmutablePureComponent from 'react-immutable-pure-component';

View File

@ -1,11 +1,11 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Motion from '../../ui/util/optional_motion';
import spring from 'react-motion/lib/spring';
import { Icon } from 'mastodon/components/icon';
import { FormattedMessage } from 'react-intl';
export default class UploadProgress extends React.PureComponent {
export default class UploadProgress extends PureComponent {
static propTypes = {
active: PropTypes.bool,

View File

@ -1,9 +1,9 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Motion from '../../ui/util/optional_motion';
import spring from 'react-motion/lib/spring';
export default class Warning extends React.PureComponent {
export default class Warning extends PureComponent {
static propTypes = {
message: PropTypes.node.isRequired,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import classNames from 'classnames';
@ -30,7 +30,7 @@ const mapDispatchToProps = dispatch => ({
});
class SensitiveButton extends React.PureComponent {
class SensitiveButton extends PureComponent {
static propTypes = {
active: PropTypes.bool,

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import Warning from '../components/warning';
import PropTypes from 'prop-types';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import ComposeFormContainer from './containers/compose_form_container';
import NavigationContainer from './containers/navigation_container';
import PropTypes from 'prop-types';
@ -38,7 +38,7 @@ const mapStateToProps = (state, ownProps) => ({
showSearch: ownProps.multiColumn ? state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']) : false,
});
class Compose extends React.PureComponent {
class Compose extends PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,

View File

@ -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';

View File

@ -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';

View File

@ -1,5 +1,5 @@
import PropTypes from 'prop-types';
import React from 'react';
import { PureComponent } from 'react';
import { Helmet } from 'react-helmet';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
@ -14,7 +14,7 @@ const messages = defineMessages({
title: { id: 'column.direct', defaultMessage: 'Private mentions' },
});
class DirectTimeline extends React.PureComponent {
class DirectTimeline extends PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,

View File

@ -1,4 +1,3 @@
import React from 'react';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import { connect } from 'react-redux';
import { defineMessages, injectIntl } from 'react-intl';
import PropTypes from 'prop-types';
@ -29,7 +29,7 @@ const mapStateToProps = state => ({
domain: state.getIn(['meta', 'domain']),
});
class Directory extends React.PureComponent {
class Directory extends PureComponent {
static contextTypes = {
router: PropTypes.object,

View File

@ -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';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import { Blurhash } from 'mastodon/components/blurhash';
import { accountsCountRenderer } from 'mastodon/components/hashtag';
@ -6,7 +6,7 @@ import ShortNumber from 'mastodon/components/short_number';
import { Skeleton } from 'mastodon/components/skeleton';
import classNames from 'classnames';
export default class Story extends React.PureComponent {
export default class Story extends PureComponent {
static propTypes = {
url: PropTypes.string,
@ -38,10 +38,10 @@ export default class Story extends React.PureComponent {
<div className='story__thumbnail'>
{thumbnail ? (
<React.Fragment>
<Fragment>
<div className={classNames('story__thumbnail__preview', { 'story__thumbnail__preview--hidden': thumbnailLoaded })}><Blurhash hash={blurhash} /></div>
<img src={thumbnail} onLoad={this.handleImageLoad} alt='' role='presentation' />
</React.Fragment>
</Fragment>
) : <Skeleton />}
</div>
</a>

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
@ -24,7 +24,7 @@ const mapStateToProps = state => ({
isSearching: state.getIn(['search', 'submitted']) || !showTrends,
});
class Explore extends React.PureComponent {
class Explore extends PureComponent {
static contextTypes = {
router: PropTypes.object,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Story from './components/story';
@ -13,7 +13,7 @@ const mapStateToProps = state => ({
isLoading: state.getIn(['trends', 'links', 'isLoading']),
});
class Links extends React.PureComponent {
class Links extends PureComponent {
static propTypes = {
links: ImmutablePropTypes.list,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
@ -42,7 +42,7 @@ const renderStatuses = (results, onLoadMore) => appendLoadMore('statuses', resul
<Status key={`status-${item}`} id={item} />
)), onLoadMore);
class Results extends React.PureComponent {
class Results extends PureComponent {
static propTypes = {
results: ImmutablePropTypes.map,
@ -102,7 +102,7 @@ class Results extends React.PureComponent {
}
return (
<React.Fragment>
<Fragment>
<div className='account__section-headline'>
<button onClick={this.handleSelectAll} className={type === 'all' && 'active'}><FormattedMessage id='search_results.all' defaultMessage='All' /></button>
<button onClick={this.handleSelectAccounts} className={type === 'accounts' && 'active'}><FormattedMessage id='search_results.accounts' defaultMessage='Profiles' /></button>
@ -117,7 +117,7 @@ class Results extends React.PureComponent {
<Helmet>
<title>{intl.formatMessage(messages.title, { q })}</title>
</Helmet>
</React.Fragment>
</Fragment>
);
}

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import StatusList from 'mastodon/components/status_list';
@ -14,7 +14,7 @@ const mapStateToProps = state => ({
hasMore: !!state.getIn(['status_lists', 'trending', 'next']),
});
class Statuses extends React.PureComponent {
class Statuses extends PureComponent {
static propTypes = {
statusIds: ImmutablePropTypes.list,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import AccountCard from 'mastodon/features/directory/components/account_card';
@ -12,7 +12,7 @@ const mapStateToProps = state => ({
isLoading: state.getIn(['suggestions', 'isLoading']),
});
class Suggestions extends React.PureComponent {
class Suggestions extends PureComponent {
static propTypes = {
isLoading: PropTypes.bool,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { ImmutableHashtag as Hashtag } from 'mastodon/components/hashtag';
@ -13,7 +13,7 @@ const mapStateToProps = state => ({
isLoadingHashtags: state.getIn(['trends', 'tags', 'isLoading']),
});
class Tags extends React.PureComponent {
class Tags extends PureComponent {
static propTypes = {
hashtags: ImmutablePropTypes.list,

View File

@ -1,6 +1,5 @@
import { debounce } from 'lodash';
import PropTypes from 'prop-types';
import React from 'react';
import { Helmet } from 'react-helmet';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';

View File

@ -1,5 +1,4 @@
import PropTypes from 'prop-types';
import React from 'react';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage } from 'react-intl';
@ -10,7 +10,7 @@ const mapStateToProps = (state, { filterId }) => ({
filter: state.getIn(['filters', filterId]),
});
class AddedToFilter extends React.PureComponent {
class AddedToFilter extends PureComponent {
static propTypes = {
onClose: PropTypes.func.isRequired,
@ -30,7 +30,7 @@ class AddedToFilter extends React.PureComponent {
let expiredMessage = null;
if (filter.get('expires_at') && filter.get('expires_at') < new Date()) {
expiredMessage = (
<React.Fragment>
<Fragment>
<h4 className='report-dialog-modal__subtitle'><FormattedMessage id='filter_modal.added.expired_title' defaultMessage='Expired filter!' /></h4>
<p className='report-dialog-modal__lead'>
<FormattedMessage
@ -38,14 +38,14 @@ class AddedToFilter extends React.PureComponent {
defaultMessage='This filter category has expired, you will need to change the expiration date for it to apply.'
/>
</p>
</React.Fragment>
</Fragment>
);
}
let contextMismatchMessage = null;
if (contextType && !filter.get('context').includes(toServerSideType(contextType))) {
contextMismatchMessage = (
<React.Fragment>
<Fragment>
<h4 className='report-dialog-modal__subtitle'><FormattedMessage id='filter_modal.added.context_mismatch_title' defaultMessage='Context mismatch!' /></h4>
<p className='report-dialog-modal__lead'>
<FormattedMessage
@ -53,7 +53,7 @@ class AddedToFilter extends React.PureComponent {
defaultMessage='This filter category does not apply to the context in which you have accessed this post. If you want the post to be filtered in this context too, you will have to edit the filter.'
/>
</p>
</React.Fragment>
</Fragment>
);
}
@ -67,7 +67,7 @@ class AddedToFilter extends React.PureComponent {
);
return (
<React.Fragment>
<Fragment>
<h3 className='report-dialog-modal__title'><FormattedMessage id='filter_modal.added.title' defaultMessage='Filter added!' /></h3>
<p className='report-dialog-modal__lead'>
<FormattedMessage
@ -94,7 +94,7 @@ class AddedToFilter extends React.PureComponent {
<div className='report-dialog-modal__actions'>
<Button onClick={this.handleCloseClick}><FormattedMessage id='report.close' defaultMessage='Done' /></Button>
</div>
</React.Fragment>
</Fragment>
);
}

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
@ -22,7 +22,7 @@ const mapStateToProps = (state, { contextType }) => ({
]),
});
class SelectFilter extends React.PureComponent {
class SelectFilter extends PureComponent {
static propTypes = {
onSelectFilter: PropTypes.func.isRequired,
@ -169,7 +169,7 @@ class SelectFilter extends React.PureComponent {
const results = this.search();
return (
<React.Fragment>
<Fragment>
<h3 className='report-dialog-modal__title'><FormattedMessage id='filter_modal.select_filter.title' defaultMessage='Filter this post' /></h3>
<p className='report-dialog-modal__lead'><FormattedMessage id='filter_modal.select_filter.subtitle' defaultMessage='Use an existing category or create a new one' /></p>
@ -183,7 +183,7 @@ class SelectFilter extends React.PureComponent {
{isSearching && this.renderCreateNew(searchValue) }
</div>
</React.Fragment>
</Fragment>
);
}

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { Link } from 'react-router-dom';

View File

@ -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';

View File

@ -1,6 +1,5 @@
import { debounce } from 'lodash';
import PropTypes from 'prop-types';
import React from 'react';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';

View File

@ -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';

View File

@ -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';

View File

@ -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';
@ -148,7 +148,7 @@ class Content extends ImmutablePureComponent {
}
class Emoji extends React.PureComponent {
class Emoji extends PureComponent {
static propTypes = {
emoji: PropTypes.string.isRequired,

View File

@ -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';

View File

@ -1,4 +1,3 @@
import React from 'react';
import Column from 'mastodon/components/column';
import ColumnHeader from 'mastodon/components/column_header';
import ColumnLink from '../ui/components/column_link';

View File

@ -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';
@ -12,7 +12,7 @@ const messages = defineMessages({
noOptions: { id: 'hashtag.column_settings.select.no_options_message', defaultMessage: 'No suggestions found' },
});
class ColumnSettings extends React.PureComponent {
class ColumnSettings extends PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,

View File

@ -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';
@ -26,7 +26,7 @@ const mapStateToProps = (state, props) => ({
tag: state.getIn(['tags', props.params.id]),
});
class HashtagTimeline extends React.PureComponent {
class HashtagTimeline extends PureComponent {
disconnects = [];

View File

@ -1,10 +1,10 @@
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';
class ColumnSettings extends React.PureComponent {
class ColumnSettings extends PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,

View File

@ -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 => ({
showAnnouncements: state.getIn(['announcements', 'show']),
});
class HomeTimeline extends React.PureComponent {
class HomeTimeline extends PureComponent {
static contextTypes = {
identity: PropTypes.object,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { registrationsOpen } from 'mastodon/initial_state';
@ -18,7 +18,7 @@ const mapDispatchToProps = (dispatch) => ({
},
});
class Copypaste extends React.PureComponent {
class Copypaste extends PureComponent {
static propTypes = {
value: PropTypes.string,
@ -74,7 +74,7 @@ class Copypaste extends React.PureComponent {
}
class InteractionModal extends React.PureComponent {
class InteractionModal extends PureComponent {
static propTypes = {
displayNameHtml: PropTypes.string,

View File

@ -1,4 +1,3 @@
import React from 'react';
import Column from 'mastodon/components/column';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import PropTypes from 'prop-types';

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import { makeGetAccount } from '../../../selectors';
import ImmutablePureComponent from 'react-immutable-pure-component';

View File

@ -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';

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { makeGetAccount } from '../../../selectors';

View File

@ -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';
@ -19,7 +19,7 @@ const mapDispatchToProps = dispatch => ({
onSubmit: () => dispatch(submitListEditor(false)),
});
class ListForm extends React.PureComponent {
class ListForm extends PureComponent {
static propTypes = {
value: PropTypes.string.isRequired,

View File

@ -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';
@ -20,7 +20,7 @@ const mapDispatchToProps = dispatch => ({
onChange: value => dispatch(changeListSuggestions(value)),
});
class Search extends React.PureComponent {
class Search extends PureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';

View File

@ -1,5 +1,5 @@
import PropTypes from 'prop-types';
import React from 'react';
import { PureComponent } from 'react';
import { Helmet } from 'react-helmet';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
@ -30,7 +30,7 @@ const mapStateToProps = (state, props) => ({
hasUnread: state.getIn(['timelines', `list:${props.params.id}`, 'unread']) > 0,
});
class ListTimeline extends React.PureComponent {
class ListTimeline extends PureComponent {
static contextTypes = {
router: PropTypes.object,

View File

@ -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 'mastodon/actions/lists';
@ -20,7 +20,7 @@ const mapDispatchToProps = dispatch => ({
onSubmit: () => dispatch(submitListEditor(true)),
});
class NewListForm extends React.PureComponent {
class NewListForm extends PureComponent {
static propTypes = {
value: PropTypes.string.isRequired,

View File

@ -1,5 +1,4 @@
import PropTypes from 'prop-types';
import React from 'react';
import { Helmet } from 'react-helmet';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';

View File

@ -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';

View File

@ -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,

View File

@ -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 { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_REPORTS } from 'mastodon/permissions';
export default class ColumnSettings extends React.PureComponent {
export default class ColumnSettings extends PureComponent {
static contextTypes = {
identity: PropTypes.object,

View File

@ -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';
@ -12,7 +12,7 @@ const tooltips = defineMessages({
statuses: { id: 'notifications.filter.statuses', defaultMessage: 'Updates from people you follow' },
});
class FilterBar extends React.PureComponent {
class FilterBar extends PureComponent {
static propTypes = {
selectFilter: PropTypes.func.isRequired,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { Fragment } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { Avatar } from 'mastodon/components/avatar';
@ -31,10 +31,10 @@ class FollowRequest extends ImmutablePureComponent {
if (hidden) {
return (
<React.Fragment>
<Fragment>
{account.get('display_name')}
{account.get('username')}
</React.Fragment>
</Fragment>
);
}

View File

@ -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,

View File

@ -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';

View File

@ -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';
@ -12,7 +12,7 @@ const messages = defineMessages({
close: { id: 'lightbox.close', defaultMessage: 'Close' },
});
class NotificationsPermissionBanner extends React.PureComponent {
class NotificationsPermissionBanner extends PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,

View File

@ -1,4 +1,4 @@
import React, { Fragment } from 'react';
import { Fragment } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';

View File

@ -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,

View File

@ -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 => ({
needsNotificationPermission: state.getIn(['settings', 'notifications', 'alerts']).includes(true) && state.getIn(['notifications', 'browserSupport']) && state.getIn(['notifications', 'browserPermission']) === 'default' && !state.getIn(['settings', 'notifications', 'dismissPermissionBanner']),
});
class Notifications extends React.PureComponent {
class Notifications extends PureComponent {
static contextTypes = {
identity: PropTypes.object,

View File

@ -1,5 +1,3 @@
import React from 'react';
const ArrowSmallRight = () => (
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'>
<path fillRule='evenodd' d='M5 10a.75.75 0 01.75-.75h6.638L10.23 7.29a.75.75 0 111.04-1.08l3.5 3.25a.75.75 0 010 1.08l-3.5 3.25a.75.75 0 11-1.04-1.08l2.158-1.96H5.75A.75.75 0 015 10z' clipRule='evenodd' />

View File

@ -1,4 +1,4 @@
import React from 'react';
import { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Check } from 'mastodon/components/check';
import classNames from 'classnames';
@ -6,13 +6,13 @@ import classNames from 'classnames';
const ProgressIndicator = ({ steps, completed }) => (
<div className='onboarding__progress-indicator'>
{(new Array(steps)).fill().map((_, i) => (
<React.Fragment key={i}>
<Fragment key={i}>
{i > 0 && <div className={classNames('onboarding__progress-indicator__line', { active: completed > i })} />}
<div className={classNames('onboarding__progress-indicator__step', { active: completed > i })}>
{completed > i && <Check />}
</div>
</React.Fragment>
</Fragment>
))}
</div>
);

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Icon } from 'mastodon/components/icon';
import { Check } from 'mastodon/components/check';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import Column from 'mastodon/components/column';
import ColumnBackButton from 'mastodon/components/column_back_button';
import PropTypes from 'prop-types';
@ -23,7 +23,7 @@ const mapStateToProps = () => {
});
};
class Follows extends React.PureComponent {
class Follows extends PureComponent {
static propTypes = {
onBack: PropTypes.func,

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import Column from 'mastodon/components/column';
import ColumnBackButton from 'mastodon/components/column_back_button';
import PropTypes from 'prop-types';
@ -20,7 +20,7 @@ const mapStateToProps = state => ({
account: state.getIn(['accounts', me]),
});
class CopyPasteText extends React.PureComponent {
class CopyPasteText extends PureComponent {
static propTypes = {
value: PropTypes.string,
@ -81,7 +81,7 @@ class CopyPasteText extends React.PureComponent {
}
class TipCarousel extends React.PureComponent {
class TipCarousel extends PureComponent {
static propTypes = {
children: PropTypes.node,
@ -135,7 +135,7 @@ class TipCarousel extends React.PureComponent {
}
class Share extends React.PureComponent {
class Share extends PureComponent {
static propTypes = {
onBack: PropTypes.func,

View File

@ -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';

View File

@ -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';

View File

@ -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';
@ -11,7 +11,7 @@ const mapStateToProps = state => ({
...state.get('picture_in_picture'),
});
class PictureInPicture extends React.Component {
class PictureInPicture extends Component {
static propTypes = {
statusId: PropTypes.string,

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Helmet } from 'react-helmet';
import { FormattedMessage, FormattedDate, injectIntl, defineMessages } from 'react-intl';
@ -10,7 +10,7 @@ const messages = defineMessages({
title: { id: 'privacy_policy.title', defaultMessage: 'Privacy Policy' },
});
class PrivacyPolicy extends React.PureComponent {
class PrivacyPolicy extends PureComponent {
static propTypes = {
intl: PropTypes.object,

View File

@ -1,10 +1,10 @@
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';
class ColumnSettings extends React.PureComponent {
class ColumnSettings extends PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,

View File

@ -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 }) => {
};
};
class PublicTimeline extends React.PureComponent {
class PublicTimeline extends PureComponent {
static contextTypes = {
router: PropTypes.object,

View File

@ -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';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
@ -24,7 +24,7 @@ const mapStateToProps = state => ({
rules: state.getIn(['server', 'server', 'rules'], ImmutableList()),
});
class Category extends React.PureComponent {
class Category extends PureComponent {
static propTypes = {
onNextStep: PropTypes.func.isRequired,
@ -74,7 +74,7 @@ class Category extends React.PureComponent {
];
return (
<React.Fragment>
<Fragment>
<h3 className='report-dialog-modal__title'><FormattedMessage id='report.category.title' defaultMessage="Tell us what's going on with this {type}" values={{ type: intl.formatMessage(messages[startedFrom]) }} /></h3>
<p className='report-dialog-modal__lead'><FormattedMessage id='report.category.subtitle' defaultMessage='Choose the best match' /></p>
@ -97,7 +97,7 @@ class Category extends React.PureComponent {
<div className='report-dialog-modal__actions'>
<Button onClick={this.handleNextClick} disabled={category === null}><FormattedMessage id='report.next' defaultMessage='Next' /></Button>
</div>
</React.Fragment>
</Fragment>
);
}

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
import Button from 'mastodon/components/button';
@ -8,7 +8,7 @@ const messages = defineMessages({
placeholder: { id: 'report.placeholder', defaultMessage: 'Type or paste additional comments' },
});
class Comment extends React.PureComponent {
class Comment extends PureComponent {
static propTypes = {
onSubmit: PropTypes.func.isRequired,
@ -47,7 +47,7 @@ class Comment extends React.PureComponent {
const { comment, isRemote, forward, domain, isSubmitting, intl } = this.props;
return (
<React.Fragment>
<Fragment>
<h3 className='report-dialog-modal__title'><FormattedMessage id='report.comment.title' defaultMessage='Is there anything else you think we should know?' /></h3>
<textarea
@ -60,14 +60,14 @@ class Comment extends React.PureComponent {
/>
{isRemote && (
<React.Fragment>
<Fragment>
<p className='report-dialog-modal__lead'><FormattedMessage id='report.forward_hint' defaultMessage='The account is from another server. Send an anonymized copy of the report there as well?' /></p>
<label className='report-dialog-modal__toggle'>
<Toggle checked={forward} disabled={isSubmitting} onChange={this.handleForwardChange} />
<FormattedMessage id='report.forward' defaultMessage='Forward to {target}' values={{ target: domain }} />
</label>
</React.Fragment>
</Fragment>
)}
<div className='flex-spacer' />
@ -75,7 +75,7 @@ class Comment extends React.PureComponent {
<div className='report-dialog-modal__actions'>
<Button onClick={this.handleClick} disabled={isSubmitting}><FormattedMessage id='report.submit' defaultMessage='Submit report' /></Button>
</div>
</React.Fragment>
</Fragment>
);
}

View File

@ -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,

View File

@ -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';
@ -17,7 +17,7 @@ const messages = defineMessages({
direct_short: { id: 'privacy.direct.short', defaultMessage: 'Mentioned people only' },
});
class StatusCheckBox extends React.PureComponent {
class StatusCheckBox extends PureComponent {
static propTypes = {
id: PropTypes.string.isRequired,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
@ -10,7 +10,7 @@ const mapStateToProps = state => ({
rules: state.getIn(['server', 'server', 'rules']),
});
class Rules extends React.PureComponent {
class Rules extends PureComponent {
static propTypes = {
onNextStep: PropTypes.func.isRequired,
@ -33,7 +33,7 @@ class Rules extends React.PureComponent {
const { rules, selectedRuleIds } = this.props;
return (
<React.Fragment>
<Fragment>
<h3 className='report-dialog-modal__title'><FormattedMessage id='report.rules.title' defaultMessage='Which rules are being violated?' /></h3>
<p className='report-dialog-modal__lead'><FormattedMessage id='report.rules.subtitle' defaultMessage='Select all that apply' /></p>
@ -56,7 +56,7 @@ class Rules extends React.PureComponent {
<div className='report-dialog-modal__actions'>
<Button onClick={this.handleNextClick} disabled={selectedRuleIds.size < 1}><FormattedMessage id='report.next' defaultMessage='Next' /></Button>
</div>
</React.Fragment>
</Fragment>
);
}

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
@ -13,7 +13,7 @@ const mapStateToProps = (state, { accountId }) => ({
isLoading: state.getIn(['timelines', `account:${accountId}:with_replies`, 'isLoading']),
});
class Statuses extends React.PureComponent {
class Statuses extends PureComponent {
static propTypes = {
onNextStep: PropTypes.func.isRequired,
@ -33,7 +33,7 @@ class Statuses extends React.PureComponent {
const { availableStatusIds, selectedStatusIds, onToggle, isLoading } = this.props;
return (
<React.Fragment>
<Fragment>
<h3 className='report-dialog-modal__title'><FormattedMessage id='report.statuses.title' defaultMessage='Are there any posts that back up this report?' /></h3>
<p className='report-dialog-modal__lead'><FormattedMessage id='report.statuses.subtitle' defaultMessage='Select all that apply' /></p>
@ -53,7 +53,7 @@ class Statuses extends React.PureComponent {
<div className='report-dialog-modal__actions'>
<Button onClick={this.handleNextClick}><FormattedMessage id='report.next' defaultMessage='Next' /></Button>
</div>
</React.Fragment>
</Fragment>
);
}

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage } from 'react-intl';
@ -12,7 +12,7 @@ import {
const mapStateToProps = () => ({});
class Thanks extends React.PureComponent {
class Thanks extends PureComponent {
static propTypes = {
submitted: PropTypes.bool,
@ -48,17 +48,17 @@ class Thanks extends React.PureComponent {
const { account, submitted } = this.props;
return (
<React.Fragment>
<Fragment>
<h3 className='report-dialog-modal__title'>{submitted ? <FormattedMessage id='report.thanks.title_actionable' defaultMessage="Thanks for reporting, we'll look into this." /> : <FormattedMessage id='report.thanks.title' defaultMessage="Don't want to see this?" />}</h3>
<p className='report-dialog-modal__lead'>{submitted ? <FormattedMessage id='report.thanks.take_action_actionable' defaultMessage='While we review this, you can take action against @{name}:' values={{ name: account.get('username') }} /> : <FormattedMessage id='report.thanks.take_action' defaultMessage='Here are your options for controlling what you see on Mastodon:' />}</p>
{account.getIn(['relationship', 'following']) && (
<React.Fragment>
<Fragment>
<h4 className='report-dialog-modal__subtitle'><FormattedMessage id='report.unfollow' defaultMessage='Unfollow @{name}' values={{ name: account.get('username') }} /></h4>
<p className='report-dialog-modal__lead'><FormattedMessage id='report.unfollow_explanation' defaultMessage='You are following this account. To not see their posts in your home feed anymore, unfollow them.' /></p>
<Button secondary onClick={this.handleUnfollowClick}><FormattedMessage id='account.unfollow' defaultMessage='Unfollow' /></Button>
<hr />
</React.Fragment>
</Fragment>
)}
<h4 className='report-dialog-modal__subtitle'><FormattedMessage id='account.mute' defaultMessage='Mute @{name}' values={{ name: account.get('username') }} /></h4>
@ -76,7 +76,7 @@ class Thanks extends React.PureComponent {
<div className='report-dialog-modal__actions'>
<Button onClick={this.handleCloseClick}><FormattedMessage id='report.close' defaultMessage='Done' /></Button>
</div>
</React.Fragment>
</Fragment>
);
}

View File

@ -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 (

View File

@ -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';
@ -47,7 +47,7 @@ const mapStateToProps = (state, { status }) => ({
relationship: state.getIn(['relationships', status.getIn(['account', 'id'])]),
});
class ActionBar extends React.PureComponent {
class ActionBar extends PureComponent {
static contextTypes = {
router: PropTypes.object,

View File

@ -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';
@ -47,7 +47,7 @@ const addAutoPlay = html => {
return html;
};
export default class Card extends React.PureComponent {
export default class Card extends PureComponent {
static propTypes = {
card: ImmutablePropTypes.map,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { Fragment } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { Avatar } from '../../../components/avatar';
@ -190,7 +190,7 @@ class DetailedStatus extends ImmutablePureComponent {
}
if (status.get('application')) {
applicationLink = <React.Fragment> · <a className='detailed-status__application' href={status.getIn(['application', 'website'])} target='_blank' rel='noopener noreferrer'>{status.getIn(['application', 'name'])}</a></React.Fragment>;
applicationLink = <Fragment> · <a className='detailed-status__application' href={status.getIn(['application', 'website'])} target='_blank' rel='noopener noreferrer'>{status.getIn(['application', 'name'])}</a></Fragment>;
}
const visibilityIconInfo = {
@ -201,33 +201,33 @@ class DetailedStatus extends ImmutablePureComponent {
};
const visibilityIcon = visibilityIconInfo[status.get('visibility')];
const visibilityLink = <React.Fragment> · <Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></React.Fragment>;
const visibilityLink = <Fragment> · <Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></Fragment>;
if (['private', 'direct'].includes(status.get('visibility'))) {
reblogLink = '';
} else if (this.context.router) {
reblogLink = (
<React.Fragment>
<React.Fragment> · </React.Fragment>
<Fragment>
<Fragment> · </Fragment>
<Link to={`/@${status.getIn(['account', 'acct'])}/${status.get('id')}/reblogs`} className='detailed-status__link'>
<Icon id={reblogIcon} />
<span className='detailed-status__reblogs'>
<AnimatedNumber value={status.get('reblogs_count')} />
</span>
</Link>
</React.Fragment>
</Fragment>
);
} else {
reblogLink = (
<React.Fragment>
<React.Fragment> · </React.Fragment>
<Fragment>
<Fragment> · </Fragment>
<a href={`/interact/${status.get('id')}?type=reblog`} className='detailed-status__link' onClick={this.handleModalLink}>
<Icon id={reblogIcon} />
<span className='detailed-status__reblogs'>
<AnimatedNumber value={status.get('reblogs_count')} />
</span>
</a>
</React.Fragment>
</Fragment>
);
}
@ -253,10 +253,10 @@ class DetailedStatus extends ImmutablePureComponent {
if (status.get('edited_at')) {
edited = (
<React.Fragment>
<React.Fragment> · </React.Fragment>
<Fragment>
<Fragment> · </Fragment>
<EditedTimestamp statusId={status.get('id')} timestamp={status.get('edited_at')} />
</React.Fragment>
</Fragment>
);
}

View File

@ -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';

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';

View File

@ -1,5 +1,4 @@
import { render, fireEvent, screen } from '@testing-library/react';
import React from 'react';
import Column from '../column';
describe('<Column />', () => {

View File

@ -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';

View File

@ -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';

View File

@ -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';
@ -36,7 +36,7 @@ const mapDispatchToProps = dispatch => {
};
};
class BlockModal extends React.PureComponent {
class BlockModal extends PureComponent {
static propTypes = {
account: PropTypes.object.isRequired,

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';

View File

@ -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,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { injectIntl, FormattedMessage } from 'react-intl';
import Column from 'mastodon/components/column';
@ -8,7 +8,7 @@ import { Link } from 'react-router-dom';
import classNames from 'classnames';
import { autoPlayGif } from 'mastodon/initial_state';
class GIF extends React.PureComponent {
class GIF extends PureComponent {
static propTypes = {
src: PropTypes.string.isRequired,
@ -59,7 +59,7 @@ class GIF extends React.PureComponent {
}
class CopyButton extends React.PureComponent {
class CopyButton extends PureComponent {
static propTypes = {
children: PropTypes.node.isRequired,
@ -92,7 +92,7 @@ class CopyButton extends React.PureComponent {
}
class BundleColumnError extends React.PureComponent {
class BundleColumnError extends PureComponent {
static propTypes = {
errorType: PropTypes.oneOf(['routing', 'network', 'error']),

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import { NavLink } from 'react-router-dom';
import { Icon } from 'mastodon/components/icon';

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import Column from '../../../components/column';

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
const ColumnSubheading = ({ text }) => {

View File

@ -1,4 +1,4 @@
import React from 'react';
import { Children, cloneElement } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
@ -173,7 +173,7 @@ export default class ColumnsArea extends ImmutablePureComponent {
);
})}
{React.Children.map(children, child => React.cloneElement(child, { multiColumn: true }))}
{Children.map(children, child => cloneElement(child, { multiColumn: true }))}
</div>
);
}

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } 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 => ({
});
class CompareHistoryModal extends React.PureComponent {
class CompareHistoryModal extends PureComponent {
static propTypes = {
onClose: PropTypes.func.isRequired,
@ -65,10 +65,10 @@ class CompareHistoryModal extends React.PureComponent {
<div className='compare-history-modal__container'>
<div className='status__content'>
{currentVersion.get('spoiler_text').length > 0 && (
<React.Fragment>
<Fragment>
<div className='translate' dangerouslySetInnerHTML={spoilerContent} lang={language} />
<hr />
</React.Fragment>
</Fragment>
)}
<div className='status__content__text status__content__text--visible translate' dangerouslySetInnerHTML={content} lang={language} />

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import SearchContainer from 'mastodon/features/compose/containers/search_container';
@ -8,7 +8,7 @@ import LinkFooter from './link_footer';
import ServerBanner from 'mastodon/components/server_banner';
import { changeComposing, mountCompose, unmountCompose } from 'mastodon/actions/compose';
class ComposePanel extends React.PureComponent {
class ComposePanel extends PureComponent {
static contextTypes = {
identity: PropTypes.object.isRequired,
@ -46,17 +46,17 @@ class ComposePanel extends React.PureComponent {
<SearchContainer openInRoute />
{!signedIn && (
<React.Fragment>
<Fragment>
<ServerBanner />
<div className='flex-spacer' />
</React.Fragment>
</Fragment>
)}
{signedIn && (
<React.Fragment>
<Fragment>
<NavigationContainer onClose={this.onBlur} />
<ComposeFormContainer singleColumn />
</React.Fragment>
</Fragment>
)}
<LinkFooter />

View File

@ -1,9 +1,9 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { injectIntl, FormattedMessage } from 'react-intl';
import Button from '../../../components/button';
class ConfirmationModal extends React.PureComponent {
class ConfirmationModal extends PureComponent {
static propTypes = {
message: PropTypes.node.isRequired,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
@ -28,7 +28,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
},
});
class DisabledAccountBanner extends React.PureComponent {
class DisabledAccountBanner extends PureComponent {
static propTypes = {
disabledAcct: PropTypes.string.isRequired,

View File

@ -1,5 +1,3 @@
import React from 'react';
const DrawerLoading = () => (
<div className='drawer'>
<div className='drawer__pager'>

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import { fetchStatus } from 'mastodon/actions/statuses';
import { fetchFilters, createFilter, createFilterStatus } from 'mastodon/actions/filters';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import ImmutablePureComponent from 'react-immutable-pure-component';
@ -69,7 +69,7 @@ const removeExtraLineBreaks = str => str.replace(/\n\n/g, '******')
.replace(/\n/g, ' ')
.replace(/\*\*\*\*\*\*/g, '\n\n');
class ImageLoader extends React.PureComponent {
class ImageLoader extends PureComponent {
static propTypes = {
src: PropTypes.string.isRequired,
@ -315,7 +315,7 @@ class FocalPointModal extends ImmutablePureComponent {
{focals && <p><FormattedMessage id='upload_modal.hint' defaultMessage='Click or drag the circle on the preview to choose the focal point which will always be in view on all thumbnails.' /></p>}
{thumbnailable && (
<React.Fragment>
<Fragment>
<label className='setting-text-label' htmlFor='upload-modal__thumbnail'><FormattedMessage id='upload_form.thumbnail' defaultMessage='Change thumbnail' /></label>
<Button disabled={isUploadingThumbnail || !media.get('unattached')} text={intl.formatMessage(messages.chooseImage)} onClick={this.handleFileInputClick} />
@ -335,7 +335,7 @@ class FocalPointModal extends ImmutablePureComponent {
</label>
<hr className='setting-divider' />
</React.Fragment>
</Fragment>
)}
<label className='setting-text-label' htmlFor='upload-modal__description'>

View File

@ -1,4 +1,4 @@
import React from 'react';
import { Component } from 'react';
import PropTypes from 'prop-types';
import { fetchFollowRequests } from 'mastodon/actions/accounts';
import { connect } from 'react-redux';
@ -15,7 +15,7 @@ const mapStateToProps = state => ({
count: state.getIn(['user_lists', 'follow_requests', 'items'], ImmutableList()).size,
});
class FollowRequestsColumnLink extends React.Component {
class FollowRequestsColumnLink extends Component {
static propTypes = {
dispatch: PropTypes.func.isRequired,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import { WordmarkLogo, SymbolLogo } from 'mastodon/components/logo';
import { Link, withRouter } from 'react-router-dom';
import { FormattedMessage } from 'react-intl';
@ -22,7 +22,7 @@ const mapDispatchToProps = (dispatch) => ({
},
});
class Header extends React.PureComponent {
class Header extends PureComponent {
static contextTypes = {
identity: PropTypes.object,

View File

@ -1,6 +1,6 @@
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
import { PureComponent } from 'react';
import { LoadingBar } from 'react-redux-loading-bar';
import ZoomableImage from './zoomable_image';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { defineMessages, injectIntl } from 'react-intl';
@ -9,7 +9,7 @@ const messages = defineMessages({
close: { id: 'lightbox.close', defaultMessage: 'Close' },
});
class ImageModal extends React.PureComponent {
class ImageModal extends PureComponent {
static propTypes = {
src: PropTypes.string.isRequired,

View File

@ -1,5 +1,5 @@
import { connect } from 'react-redux';
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
import { Link } from 'react-router-dom';
@ -24,7 +24,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
},
});
class LinkFooter extends React.PureComponent {
class LinkFooter extends PureComponent {
static contextTypes = {
identity: PropTypes.object,

View File

@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import { createSelector } from 'reselect';
import ImmutablePropTypes from 'react-immutable-proptypes';

View File

@ -1,4 +1,3 @@
import React from 'react';
import ReactSwipeableViews from 'react-swipeable-views';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';

View File

@ -1,5 +1,3 @@
import React from 'react';
import LoadingIndicator from '../../../components/loading_indicator';
// Keep the markup in sync with <BundleModalError />

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { getScrollbarWidth } from 'mastodon/utils/scrollbar';
import Base from 'mastodon/components/modal_root';
@ -50,7 +50,7 @@ const MODAL_COMPONENTS = {
'CLOSED_REGISTRATIONS': ClosedRegistrationsModal,
};
export default class ModalRoot extends React.PureComponent {
export default class ModalRoot extends PureComponent {
static propTypes = {
type: PropTypes.string,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
@ -43,7 +43,7 @@ const mapDispatchToProps = dispatch => {
};
};
class MuteModal extends React.PureComponent {
class MuteModal extends PureComponent {
static propTypes = {
account: PropTypes.object.isRequired,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import { Link } from 'react-router-dom';
@ -28,7 +28,7 @@ const messages = defineMessages({
search: { id: 'navigation_bar.search', defaultMessage: 'Search' },
});
class NavigationPanel extends React.Component {
class NavigationPanel extends Component {
static contextTypes = {
router: PropTypes.object.isRequired,
@ -51,11 +51,11 @@ class NavigationPanel extends React.Component {
</div>
{signedIn && (
<React.Fragment>
<Fragment>
<ColumnLink transparent to='/home' icon='home' text={intl.formatMessage(messages.home)} />
<ColumnLink transparent to='/notifications' icon={<NotificationsCounterIcon className='column-link__icon' />} text={intl.formatMessage(messages.notifications)} />
<FollowRequestsColumnLink />
</React.Fragment>
</Fragment>
)}
{showTrends ? (
@ -79,7 +79,7 @@ class NavigationPanel extends React.Component {
)}
{signedIn && (
<React.Fragment>
<Fragment>
<ColumnLink transparent to='/conversations' icon='at' text={intl.formatMessage(messages.direct)} />
<ColumnLink transparent to='/bookmarks' icon='bookmark' text={intl.formatMessage(messages.bookmarks)} />
<ColumnLink transparent to='/favourites' icon='star' text={intl.formatMessage(messages.favourites)} />
@ -90,7 +90,7 @@ class NavigationPanel extends React.Component {
<hr />
<ColumnLink transparent href='/settings/preferences' icon='cog' text={intl.formatMessage(messages.preferences)} />
</React.Fragment>
</Fragment>
)}
<div className='navigation-panel__legal'>

View File

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux';
import { submitReport } from 'mastodon/actions/reports';
import { expandAccountTimeline } from 'mastodon/actions/timelines';

View File

@ -1,4 +1,4 @@
import React, { useCallback } from 'react';
import { useCallback } from 'react';
import { FormattedMessage } from 'react-intl';
import { useDispatch } from 'react-redux';
import { registrationsOpen } from 'mastodon/initial_state';

View File

@ -1,10 +1,10 @@
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Motion from '../util/optional_motion';
import spring from 'react-motion/lib/spring';
import { FormattedMessage } from 'react-intl';
export default class UploadArea extends React.PureComponent {
export default class UploadArea extends PureComponent {
static propTypes = {
active: PropTypes.bool,

View File

@ -1,4 +1,3 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import Video from 'mastodon/features/video';

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import { IconButton } from 'mastodon/components/icon_button';
import { defineMessages, injectIntl } from 'react-intl';
@ -91,7 +91,7 @@ const normalizeWheel = event => {
};
};
class ZoomableImage extends React.PureComponent {
class ZoomableImage extends PureComponent {
static propTypes = {
alt: PropTypes.string,
@ -411,7 +411,7 @@ class ZoomableImage extends React.PureComponent {
const zoomButtonTitle = this.state.zoomState === 'compress' ? intl.formatMessage(messages.compress) : intl.formatMessage(messages.expand);
return (
<React.Fragment>
<Fragment>
<IconButton
className={`media-modal__zoom-button ${zoomButtonShouldHide}`}
title={zoomButtonTitle}
@ -445,7 +445,7 @@ class ZoomableImage extends React.PureComponent {
onMouseDown={this.handleMouseDown}
/>
</div>
</React.Fragment>
</Fragment>
);
}

View File

@ -1,5 +1,5 @@
import classNames from 'classnames';
import React from 'react';
import { PureComponent } from 'react';
import { HotKeys } from 'react-hotkeys';
import { defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
@ -111,7 +111,7 @@ const keyMap = {
openMedia: 'e',
};
class SwitchingColumnsArea extends React.PureComponent {
class SwitchingColumnsArea extends PureComponent {
static contextTypes = {
identity: PropTypes.object,
@ -229,7 +229,7 @@ class SwitchingColumnsArea extends React.PureComponent {
}
class UI extends React.PureComponent {
class UI extends PureComponent {
static contextTypes = {
router: PropTypes.object.isRequired,

View File

@ -1,4 +1,4 @@
import React from 'react';
import { Component, PureComponent, cloneElement, Children } from 'react';
import PropTypes from 'prop-types';
import { Switch, Route } from 'react-router-dom';
import StackTrace from 'stacktrace-js';
@ -7,14 +7,14 @@ import BundleColumnError from '../components/bundle_column_error';
import BundleContainer from '../containers/bundle_container';
// Small wrapper to pass multiColumn to the route components
export class WrappedSwitch extends React.PureComponent {
export class WrappedSwitch extends PureComponent {
render () {
const { multiColumn, children } = this.props;
return (
<Switch>
{React.Children.map(children, child => React.cloneElement(child, { multiColumn }))}
{Children.map(children, child => cloneElement(child, { multiColumn }))}
</Switch>
);
}
@ -29,7 +29,7 @@ WrappedSwitch.propTypes = {
// Small Wrapper to extract the params from the route and pass
// them to the rendered component, together with the content to
// be rendered inside (the children)
export class WrappedRoute extends React.Component {
export class WrappedRoute extends Component {
static propTypes = {
component: PropTypes.func.isRequired,

View File

@ -1,6 +1,6 @@
// Like react-motion's Motion, but reduces all animations to cross-fades
// for the benefit of users with motion sickness.
import React from 'react';
import { Component } from 'react';
import Motion from 'react-motion/lib/Motion';
import PropTypes from 'prop-types';
@ -11,7 +11,7 @@ const extractValue = (value) => {
return (typeof value === 'object' && value && 'val' in value) ? value.val : value;
};
class ReducedMotion extends React.Component {
class ReducedMotion extends Component {
static propTypes = {
defaultStyle: PropTypes.object,

View File

@ -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 { is } from 'immutable';
@ -94,7 +94,7 @@ export const fileNameFromURL = str => {
return pathname.slice(index + 1);
};
class Video extends React.PureComponent {
class Video extends PureComponent {
static propTypes = {
preview: PropTypes.string,

View File

@ -1,4 +1,3 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { setupBrowserNotifications } from 'mastodon/actions/notifications';
import Mastodon from 'mastodon/containers/mastodon';

View File

@ -1,5 +1,3 @@
import React from 'react';
// Copied from emoji-mart for consistency with emoji picker and since
// they don't export the icons in the package
export const loupeIcon = (

View File

@ -3,6 +3,7 @@ module.exports = (api) => {
const reactOptions = {
development: false,
runtime: 'automatic',
};
const envOptions = {

View File

@ -1,6 +1,6 @@
{
"compilerOptions": {
"jsx": "react",
"jsx": "react-jsx",
"target": "esnext",
"module": "CommonJS",
"moduleResolution": "node",