From 8f66126b1010e0aaaa8b5f2a2f4ea8a28824e2b7 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Tue, 23 May 2023 10:52:27 +0200 Subject: [PATCH] Use the new JSX transform (#25064) --- .eslintrc.js | 8 +++++++ .../__tests__/autosuggest_emoji-test.jsx | 1 - .../components/__tests__/avatar-test.jsx | 1 - .../__tests__/avatar_overlay-test.jsx | 1 - .../components/__tests__/button-test.jsx | 1 - .../__tests__/display_name-test.jsx | 1 - .../mastodon/components/account.jsx | 1 - .../mastodon/components/admin/Counter.jsx | 16 ++++++------- .../mastodon/components/admin/Dimension.jsx | 4 ++-- .../components/admin/ReportReasonSelector.jsx | 8 +++---- .../mastodon/components/admin/Retention.jsx | 4 ++-- .../mastodon/components/admin/Trends.jsx | 4 ++-- .../mastodon/components/animated_number.tsx | 2 +- .../mastodon/components/attachment_list.jsx | 1 - .../mastodon/components/autosuggest_emoji.jsx | 4 ++-- .../components/autosuggest_hashtag.jsx | 4 ++-- .../mastodon/components/autosuggest_input.jsx | 1 - .../components/autosuggest_textarea.jsx | 1 - app/javascript/mastodon/components/avatar.tsx | 2 -- .../mastodon/components/avatar_composite.jsx | 4 ++-- .../mastodon/components/avatar_overlay.tsx | 2 -- .../mastodon/components/blurhash.tsx | 4 ++-- app/javascript/mastodon/components/button.jsx | 4 ++-- app/javascript/mastodon/components/check.tsx | 2 -- app/javascript/mastodon/components/column.jsx | 4 ++-- .../components/column_back_button.jsx | 4 ++-- .../components/column_back_button_slim.jsx | 1 - .../mastodon/components/column_header.jsx | 4 ++-- .../mastodon/components/common_counter.jsx | 1 - .../components/dismissable_banner.jsx | 4 ++-- app/javascript/mastodon/components/domain.tsx | 2 +- .../mastodon/components/dropdown_menu.jsx | 12 +++++----- .../components/edited_timestamp/index.jsx | 4 ++-- .../mastodon/components/error_boundary.jsx | 4 ++-- app/javascript/mastodon/components/gifv.tsx | 2 +- .../mastodon/components/hashtag.jsx | 6 ++--- app/javascript/mastodon/components/icon.tsx | 2 -- .../mastodon/components/icon_button.tsx | 8 +++---- .../mastodon/components/icon_with_badge.tsx | 2 -- .../mastodon/components/inline_account.jsx | 4 ++-- .../intersection_observer_article.jsx | 8 +++---- .../mastodon/components/load_gap.jsx | 4 ++-- .../mastodon/components/load_more.jsx | 4 ++-- .../mastodon/components/load_pending.jsx | 4 ++-- .../mastodon/components/loading_indicator.jsx | 1 - app/javascript/mastodon/components/logo.tsx | 2 -- .../mastodon/components/media_attachments.jsx | 1 - .../mastodon/components/media_gallery.jsx | 6 ++--- .../mastodon/components/modal_root.jsx | 4 ++-- .../mastodon/components/navigation_portal.jsx | 4 ++-- .../components/not_signed_in_indicator.tsx | 2 -- .../picture_in_picture_placeholder.jsx | 4 ++-- app/javascript/mastodon/components/poll.jsx | 1 - .../mastodon/components/radio_button.tsx | 2 -- .../components/regeneration_indicator.jsx | 1 - .../components/relative_timestamp.tsx | 4 ++-- .../mastodon/components/scrollable_list.jsx | 12 +++++----- .../mastodon/components/server_banner.jsx | 4 ++-- .../mastodon/components/server_hero_image.tsx | 2 +- .../mastodon/components/short_number.jsx | 4 ++-- .../mastodon/components/skeleton.tsx | 2 -- app/javascript/mastodon/components/status.jsx | 1 - .../mastodon/components/status_action_bar.jsx | 1 - .../mastodon/components/status_content.jsx | 6 ++--- .../mastodon/components/status_list.jsx | 1 - .../mastodon/components/timeline_hint.tsx | 2 -- .../mastodon/components/verified_badge.tsx | 2 -- .../mastodon/containers/account_container.jsx | 1 - .../mastodon/containers/admin_component.jsx | 4 ++-- .../mastodon/containers/compose_container.jsx | 4 ++-- .../mastodon/containers/domain_container.jsx | 1 - .../mastodon/containers/mastodon.jsx | 4 ++-- .../mastodon/containers/media_container.jsx | 2 +- .../mastodon/containers/status_container.jsx | 1 - .../mastodon/features/about/index.jsx | 6 ++--- .../account/components/account_note.jsx | 4 ++-- .../account/components/featured_tags.jsx | 1 - .../components/follow_request_note.jsx | 1 - .../features/account/components/header.jsx | 6 ++--- .../mastodon/features/account/navigation.jsx | 4 ++-- .../account_gallery/components/media_item.jsx | 1 - .../features/account_gallery/index.jsx | 1 - .../account_timeline/components/header.jsx | 1 - .../components/limited_account_hint.jsx | 4 ++-- .../components/memorial_note.jsx | 1 - .../components/moved_note.jsx | 1 - .../containers/header_container.jsx | 1 - .../features/account_timeline/index.jsx | 1 - .../mastodon/features/audio/index.jsx | 4 ++-- .../mastodon/features/blocks/index.jsx | 1 - .../features/bookmarked_statuses/index.jsx | 1 - .../closed_registrations_modal/index.jsx | 1 - .../components/column_settings.jsx | 4 ++-- .../features/community_timeline/index.jsx | 4 ++-- .../compose/components/action_bar.jsx | 4 ++-- .../components/autosuggest_account.jsx | 1 - .../compose/components/character_counter.jsx | 4 ++-- .../compose/components/compose_form.jsx | 1 - .../components/emoji_picker_dropdown.jsx | 10 ++++---- .../compose/components/language_dropdown.jsx | 6 ++--- .../compose/components/navigation_bar.jsx | 1 - .../compose/components/poll_button.jsx | 4 ++-- .../features/compose/components/poll_form.jsx | 4 ++-- .../compose/components/privacy_dropdown.jsx | 6 ++--- .../compose/components/reply_indicator.jsx | 1 - .../features/compose/components/search.jsx | 4 ++-- .../compose/components/search_results.jsx | 1 - .../compose/components/text_icon_button.jsx | 4 ++-- .../features/compose/components/upload.jsx | 1 - .../compose/components/upload_button.jsx | 1 - .../compose/components/upload_form.jsx | 1 - .../compose/components/upload_progress.jsx | 4 ++-- .../features/compose/components/warning.jsx | 4 ++-- .../containers/sensitive_button_container.jsx | 4 ++-- .../compose/containers/warning_container.jsx | 1 - .../mastodon/features/compose/index.jsx | 4 ++-- .../components/conversation.jsx | 1 - .../components/conversations_list.jsx | 1 - .../features/direct_timeline/index.jsx | 4 ++-- .../directory/components/account_card.jsx | 1 - .../mastodon/features/directory/index.jsx | 4 ++-- .../mastodon/features/domain_blocks/index.jsx | 1 - .../features/explore/components/story.jsx | 8 +++---- .../mastodon/features/explore/index.jsx | 4 ++-- .../mastodon/features/explore/links.jsx | 4 ++-- .../mastodon/features/explore/results.jsx | 8 +++---- .../mastodon/features/explore/statuses.jsx | 4 ++-- .../mastodon/features/explore/suggestions.jsx | 4 ++-- .../mastodon/features/explore/tags.jsx | 4 ++-- .../features/favourited_statuses/index.jsx | 1 - .../mastodon/features/favourites/index.jsx | 1 - .../features/filters/added_to_filter.jsx | 16 ++++++------- .../features/filters/select_filter.jsx | 8 +++---- .../components/account_authorize.jsx | 1 - .../features/follow_requests/index.jsx | 1 - .../mastodon/features/followed_tags/index.jsx | 1 - .../mastodon/features/followers/index.jsx | 1 - .../mastodon/features/following/index.jsx | 1 - .../components/announcements.jsx | 4 ++-- .../getting_started/components/trends.jsx | 1 - .../features/getting_started/index.jsx | 1 - .../components/column_settings.jsx | 4 ++-- .../features/hashtag_timeline/index.jsx | 4 ++-- .../components/column_settings.jsx | 4 ++-- .../mastodon/features/home_timeline/index.jsx | 4 ++-- .../features/interaction_modal/index.jsx | 6 ++--- .../features/keyboard_shortcuts/index.jsx | 1 - .../list_adder/components/account.jsx | 1 - .../features/list_adder/components/list.jsx | 1 - .../mastodon/features/list_adder/index.jsx | 1 - .../list_editor/components/account.jsx | 1 - .../list_editor/components/edit_list_form.jsx | 4 ++-- .../list_editor/components/search.jsx | 4 ++-- .../mastodon/features/list_editor/index.jsx | 1 - .../mastodon/features/list_timeline/index.jsx | 4 ++-- .../lists/components/new_list_form.jsx | 4 ++-- .../mastodon/features/lists/index.jsx | 1 - .../mastodon/features/mutes/index.jsx | 1 - .../components/clear_column_button.jsx | 4 ++-- .../components/column_settings.jsx | 4 ++-- .../notifications/components/filter_bar.jsx | 4 ++-- .../components/follow_request.jsx | 6 ++--- .../components/grant_permission_button.jsx | 4 ++-- .../notifications/components/notification.jsx | 1 - .../notifications_permission_banner.jsx | 4 ++-- .../notifications/components/report.jsx | 2 +- .../components/setting_toggle.jsx | 4 ++-- .../mastodon/features/notifications/index.jsx | 4 ++-- .../components/arrow_small_right.jsx | 2 -- .../components/progress_indicator.jsx | 6 ++--- .../features/onboarding/components/step.jsx | 1 - .../mastodon/features/onboarding/follows.jsx | 4 ++-- .../mastodon/features/onboarding/index.jsx | 1 - .../mastodon/features/onboarding/share.jsx | 8 +++---- .../picture_in_picture/components/footer.jsx | 1 - .../picture_in_picture/components/header.jsx | 1 - .../features/picture_in_picture/index.jsx | 4 ++-- .../features/pinned_statuses/index.jsx | 1 - .../features/privacy_policy/index.jsx | 4 ++-- .../components/column_settings.jsx | 4 ++-- .../features/public_timeline/index.jsx | 4 ++-- .../mastodon/features/reblogs/index.jsx | 1 - .../mastodon/features/report/category.jsx | 8 +++---- .../mastodon/features/report/comment.jsx | 12 +++++----- .../features/report/components/option.jsx | 4 ++-- .../report/components/status_check_box.jsx | 4 ++-- .../mastodon/features/report/rules.jsx | 8 +++---- .../mastodon/features/report/statuses.jsx | 8 +++---- .../mastodon/features/report/thanks.jsx | 12 +++++----- .../features/standalone/compose/index.jsx | 4 ++-- .../features/status/components/action_bar.jsx | 4 ++-- .../features/status/components/card.jsx | 4 ++-- .../status/components/detailed_status.jsx | 24 +++++++++---------- .../mastodon/features/status/index.jsx | 1 - .../subscribed_languages_modal/index.jsx | 1 - .../ui/components/__tests__/column-test.jsx | 1 - .../features/ui/components/actions_modal.jsx | 1 - .../features/ui/components/audio_modal.jsx | 1 - .../features/ui/components/block_modal.jsx | 4 ++-- .../features/ui/components/boost_modal.jsx | 1 - .../features/ui/components/bundle.jsx | 4 ++-- .../ui/components/bundle_column_error.jsx | 8 +++---- .../ui/components/bundle_modal_error.jsx | 4 ++-- .../features/ui/components/column.jsx | 4 ++-- .../features/ui/components/column_header.jsx | 4 ++-- .../features/ui/components/column_link.jsx | 1 - .../features/ui/components/column_loading.jsx | 1 - .../ui/components/column_subheading.jsx | 1 - .../features/ui/components/columns_area.jsx | 4 ++-- .../ui/components/compare_history_modal.jsx | 8 +++---- .../features/ui/components/compose_panel.jsx | 12 +++++----- .../ui/components/confirmation_modal.jsx | 4 ++-- .../ui/components/disabled_account_banner.jsx | 4 ++-- .../features/ui/components/drawer_loading.jsx | 2 -- .../features/ui/components/embed_modal.jsx | 1 - .../features/ui/components/filter_modal.jsx | 1 - .../ui/components/focal_point_modal.jsx | 8 +++---- .../follow_requests_column_link.jsx | 4 ++-- .../features/ui/components/header.jsx | 4 ++-- .../features/ui/components/image_loader.jsx | 2 +- .../features/ui/components/image_modal.jsx | 4 ++-- .../features/ui/components/link_footer.jsx | 4 ++-- .../features/ui/components/list_panel.jsx | 1 - .../features/ui/components/media_modal.jsx | 1 - .../features/ui/components/modal_loading.jsx | 2 -- .../features/ui/components/modal_root.jsx | 4 ++-- .../features/ui/components/mute_modal.jsx | 4 ++-- .../ui/components/navigation_panel.jsx | 12 +++++----- .../features/ui/components/report_modal.jsx | 1 - .../features/ui/components/sign_in_banner.jsx | 2 +- .../features/ui/components/upload_area.jsx | 4 ++-- .../features/ui/components/video_modal.jsx | 1 - .../features/ui/components/zoomable_image.jsx | 8 +++---- app/javascript/mastodon/features/ui/index.jsx | 6 ++--- .../features/ui/util/react_router_helpers.jsx | 8 +++---- .../features/ui/util/reduced_motion.jsx | 4 ++-- .../mastodon/features/video/index.jsx | 4 ++-- app/javascript/mastodon/main.jsx | 1 - app/javascript/mastodon/utils/icons.jsx | 2 -- babel.config.js | 1 + tsconfig.json | 2 +- 241 files changed, 366 insertions(+), 473 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 1800daa55db90ca1776f1b3d379e54b6cd3deefd..1dbfd1d3ede714812332e0fa2df999a446a6afc9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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', }, }, { diff --git a/app/javascript/mastodon/components/__tests__/autosuggest_emoji-test.jsx b/app/javascript/mastodon/components/__tests__/autosuggest_emoji-test.jsx index 05616e444826cbaf4a8c65dfa30d3ef0f5e578a3..80aa33a187ad819f036512e1ae7b95fe4a13a743 100644 --- a/app/javascript/mastodon/components/__tests__/autosuggest_emoji-test.jsx +++ b/app/javascript/mastodon/components/__tests__/autosuggest_emoji-test.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import renderer from 'react-test-renderer'; import AutosuggestEmoji from '../autosuggest_emoji'; diff --git a/app/javascript/mastodon/components/__tests__/avatar-test.jsx b/app/javascript/mastodon/components/__tests__/avatar-test.jsx index 5a72fc19a143d886e0d6662ad02d71104fc7d0e0..b20c6f4e394c7de90e80527a1fe45ababd9263e7 100644 --- a/app/javascript/mastodon/components/__tests__/avatar-test.jsx +++ b/app/javascript/mastodon/components/__tests__/avatar-test.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import renderer from 'react-test-renderer'; import { fromJS } from 'immutable'; import { Avatar } from '../avatar'; diff --git a/app/javascript/mastodon/components/__tests__/avatar_overlay-test.jsx b/app/javascript/mastodon/components/__tests__/avatar_overlay-test.jsx index ea75dab574e2feaa203976c063bbd849091873cc..c03a9aa9d0dac8c02c13f5a2e4ce6df51a4202d9 100644 --- a/app/javascript/mastodon/components/__tests__/avatar_overlay-test.jsx +++ b/app/javascript/mastodon/components/__tests__/avatar_overlay-test.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import renderer from 'react-test-renderer'; import { fromJS } from 'immutable'; import { AvatarOverlay } from '../avatar_overlay'; diff --git a/app/javascript/mastodon/components/__tests__/button-test.jsx b/app/javascript/mastodon/components/__tests__/button-test.jsx index f5a649f70e32ccfc1a2f9b32b0bf605e92ce9d7a..82d307e84302ccde4ef0d0cde32eb6a7a25d5bb8 100644 --- a/app/javascript/mastodon/components/__tests__/button-test.jsx +++ b/app/javascript/mastodon/components/__tests__/button-test.jsx @@ -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'; diff --git a/app/javascript/mastodon/components/__tests__/display_name-test.jsx b/app/javascript/mastodon/components/__tests__/display_name-test.jsx index afb6c4758a93ea991b5ead1f10cee7c5adf59a1e..a1e6da87ad3d8c8a41f00631dc4c0bfa2d532131 100644 --- a/app/javascript/mastodon/components/__tests__/display_name-test.jsx +++ b/app/javascript/mastodon/components/__tests__/display_name-test.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import renderer from 'react-test-renderer'; import { fromJS } from 'immutable'; import { DisplayName } from '../display_name'; diff --git a/app/javascript/mastodon/components/account.jsx b/app/javascript/mastodon/components/account.jsx index 08dfb4793d8a45c2a2097345672ce455015b5cab..f40f5324dcfc248afa3f5d1f5f22ce9ae669f6f0 100644 --- a/app/javascript/mastodon/components/account.jsx +++ b/app/javascript/mastodon/components/account.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import { Avatar } from './avatar'; diff --git a/app/javascript/mastodon/components/admin/Counter.jsx b/app/javascript/mastodon/components/admin/Counter.jsx index 569f8628a9b52d6b4f49de68ec422aa570ce9c76..5eb836958296490d32bd06b31dade55a9b7354f2 100644 --- a/app/javascript/mastodon/components/admin/Counter.jsx +++ b/app/javascript/mastodon/components/admin/Counter.jsx @@ -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 = ( - + - + ); } else { const measure = data[0]; const percentChange = measure.previous_total && percIncrease(measure.previous_total * 1, measure.total * 1); content = ( - + {measure.human_value || } {measure.previous_total && ( 0, negative: percentChange < 0 })}>{percentChange > 0 && '+'})} - + ); } const inner = ( - +
{content}
@@ -96,7 +96,7 @@ export default class Counter extends React.PureComponent { )} -
+ ); if (href) { diff --git a/app/javascript/mastodon/components/admin/Dimension.jsx b/app/javascript/mastodon/components/admin/Dimension.jsx index 3005c15ae9c3f88f73a3e91941cfda0c93ecc949..1b4203a1832aef937e11e1d4da8e888d1c733d14 100644 --- a/app/javascript/mastodon/components/admin/Dimension.jsx +++ b/app/javascript/mastodon/components/admin/Dimension.jsx @@ -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, diff --git a/app/javascript/mastodon/components/admin/ReportReasonSelector.jsx b/app/javascript/mastodon/components/admin/ReportReasonSelector.jsx index cd14dac4e32632e78becd99caf41c4f852176963..ae0bfeef79be67458382c7393abac3223abd3546 100644 --- a/app/javascript/mastodon/components/admin/ReportReasonSelector.jsx +++ b/app/javascript/mastodon/components/admin/ReportReasonSelector.jsx @@ -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, diff --git a/app/javascript/mastodon/components/admin/Retention.jsx b/app/javascript/mastodon/components/admin/Retention.jsx index f312a45eb27406f15d33f6ad714713c66dba8a59..e51e0d15bdc7dae1a395afc4ddb8e257b962fed8 100644 --- a/app/javascript/mastodon/components/admin/Retention.jsx +++ b/app/javascript/mastodon/components/admin/Retention.jsx @@ -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, diff --git a/app/javascript/mastodon/components/admin/Trends.jsx b/app/javascript/mastodon/components/admin/Trends.jsx index d01b8437edef60c6f4ab4291dc0fe6a3e606b499..30b781e7cbc414cc66f4ac9e706a9687762e1c5c 100644 --- a/app/javascript/mastodon/components/admin/Trends.jsx +++ b/app/javascript/mastodon/components/admin/Trends.jsx @@ -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, diff --git a/app/javascript/mastodon/components/animated_number.tsx b/app/javascript/mastodon/components/animated_number.tsx index b6b073161b94c7bdacc093c89e50efde3e4e4f8e..ad985a29ea8091306930efdb45012a5dfd7bdb01 100644 --- a/app/javascript/mastodon/components/animated_number.tsx +++ b/app/javascript/mastodon/components/animated_number.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useState } from 'react'; +import { useCallback, useState } from 'react'; import { TransitionMotion, spring } from 'react-motion'; diff --git a/app/javascript/mastodon/components/attachment_list.jsx b/app/javascript/mastodon/components/attachment_list.jsx index 3354025c4a03cfbbc1e17cf83bc6704de8daeec9..502f68c7e2f18f4fce7686aa00afa7e8f4e7dc59 100644 --- a/app/javascript/mastodon/components/attachment_list.jsx +++ b/app/javascript/mastodon/components/attachment_list.jsx @@ -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'; diff --git a/app/javascript/mastodon/components/autosuggest_emoji.jsx b/app/javascript/mastodon/components/autosuggest_emoji.jsx index 4937e4d9845f4d46221fe002f2936d91460efe62..8afbdd9cb5c658d2ad8d876ac9cb53a6e5bf28df 100644 --- a/app/javascript/mastodon/components/autosuggest_emoji.jsx +++ b/app/javascript/mastodon/components/autosuggest_emoji.jsx @@ -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, diff --git a/app/javascript/mastodon/components/autosuggest_hashtag.jsx b/app/javascript/mastodon/components/autosuggest_hashtag.jsx index 9e9d888f83b48eb4b6ebe68daa0bfdccbc9289c0..4fd23ec9a8be3e534f7ca5ef8120acfe5a5aaff1 100644 --- a/app/javascript/mastodon/components/autosuggest_hashtag.jsx +++ b/app/javascript/mastodon/components/autosuggest_hashtag.jsx @@ -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({ diff --git a/app/javascript/mastodon/components/autosuggest_input.jsx b/app/javascript/mastodon/components/autosuggest_input.jsx index 218faabb7922ab92310db6a047de4fe22ec99ad5..2e0e8002becff0b53c60e3790b8a40f60ec97357 100644 --- a/app/javascript/mastodon/components/autosuggest_input.jsx +++ b/app/javascript/mastodon/components/autosuggest_input.jsx @@ -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'; diff --git a/app/javascript/mastodon/components/autosuggest_textarea.jsx b/app/javascript/mastodon/components/autosuggest_textarea.jsx index 50cc24b002ba68c677e1e48f78e98163e9506492..4c9091b333a2ce910e61e8940d37a151aa59be24 100644 --- a/app/javascript/mastodon/components/autosuggest_textarea.jsx +++ b/app/javascript/mastodon/components/autosuggest_textarea.jsx @@ -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'; diff --git a/app/javascript/mastodon/components/avatar.tsx b/app/javascript/mastodon/components/avatar.tsx index 2b46b05d65bd05ab88392914718a89a0ed4dbbf9..8e5e165fe7a8dbbaeb1b38b6720a167b2e770e11 100644 --- a/app/javascript/mastodon/components/avatar.tsx +++ b/app/javascript/mastodon/components/avatar.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import classNames from 'classnames'; import { useHovering } from '../../hooks/useHovering'; diff --git a/app/javascript/mastodon/components/avatar_composite.jsx b/app/javascript/mastodon/components/avatar_composite.jsx index e1fae95dc0b0b87ddcd571d571de297b6f179b6a..5b15e2a732b9fe8afdb09e2d3f3c9ed528daa6d6 100644 --- a/app/javascript/mastodon/components/avatar_composite.jsx +++ b/app/javascript/mastodon/components/avatar_composite.jsx @@ -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, diff --git a/app/javascript/mastodon/components/avatar_overlay.tsx b/app/javascript/mastodon/components/avatar_overlay.tsx index d1d15812683feffab116918798baef10c9501d47..602f9b4fa6c5c7e17503909c6347842050eddd23 100644 --- a/app/javascript/mastodon/components/avatar_overlay.tsx +++ b/app/javascript/mastodon/components/avatar_overlay.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { useHovering } from '../../hooks/useHovering'; import type { Account } from '../../types/resources'; import { autoPlayGif } from '../initial_state'; diff --git a/app/javascript/mastodon/components/blurhash.tsx b/app/javascript/mastodon/components/blurhash.tsx index 1550d0b7a5ca9f12d97f45f96ac14358f0e62950..8e2a8af23e593774f4da2c6b2f1d636e1064dff8 100644 --- a/app/javascript/mastodon/components/blurhash.tsx +++ b/app/javascript/mastodon/components/blurhash.tsx @@ -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 = ({ ); }; -const MemoizedBlurhash = React.memo(Blurhash); +const MemoizedBlurhash = memo(Blurhash); export { MemoizedBlurhash as Blurhash }; diff --git a/app/javascript/mastodon/components/button.jsx b/app/javascript/mastodon/components/button.jsx index a05a75e8934f2a6efc61f20c3e60f9a118c63370..1ad6cf4815bf98a06b7850d3f3628236a45bc26a 100644 --- a/app/javascript/mastodon/components/button.jsx +++ b/app/javascript/mastodon/components/button.jsx @@ -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, diff --git a/app/javascript/mastodon/components/check.tsx b/app/javascript/mastodon/components/check.tsx index 73d65595ea3e70b0111805bc44ca1c57deec45c0..901f89fc5b2bfa8abc03062399392f88a6cf84a9 100644 --- a/app/javascript/mastodon/components/check.tsx +++ b/app/javascript/mastodon/components/check.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - export const Check: React.FC = () => ( + {button} @@ -329,7 +329,7 @@ export default class Dropdown extends React.PureComponent { )} - + ); } diff --git a/app/javascript/mastodon/components/edited_timestamp/index.jsx b/app/javascript/mastodon/components/edited_timestamp/index.jsx index 745d8a4b6f6556457f5c2e741b3d5f1a8b2c0e1b..12ebfe056771cd2720e451ae3725e0ae63484792 100644 --- a/app/javascript/mastodon/components/edited_timestamp/index.jsx +++ b/app/javascript/mastodon/components/edited_timestamp/index.jsx @@ -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, diff --git a/app/javascript/mastodon/components/error_boundary.jsx b/app/javascript/mastodon/components/error_boundary.jsx index b711f1e461bd514a342cee367ae28b979060ceb4..43cce0679cca487ab78b444467c207a1c6e2302d 100644 --- a/app/javascript/mastodon/components/error_boundary.jsx +++ b/app/javascript/mastodon/components/error_boundary.jsx @@ -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, diff --git a/app/javascript/mastodon/components/gifv.tsx b/app/javascript/mastodon/components/gifv.tsx index c606a29048edf781fe9d59562b4577d8b56d5ea2..ac148c5a21f088dc1a70afa6ee98405879b18da6 100644 --- a/app/javascript/mastodon/components/gifv.tsx +++ b/app/javascript/mastodon/components/gifv.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useState } from 'react'; +import { useCallback, useState } from 'react'; interface Props { src: string; diff --git a/app/javascript/mastodon/components/hashtag.jsx b/app/javascript/mastodon/components/hashtag.jsx index 3efd679a52807302d3caccfa7eccadf9fa97bbba..0f1d3877c21f4f6cbf0c354ea806f3bd5abe1e40 100644 --- a/app/javascript/mastodon/components/hashtag.jsx +++ b/app/javascript/mastodon/components/hashtag.jsx @@ -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
- {name ? #{name} : } + {name ? #{name} : } {description ? ( diff --git a/app/javascript/mastodon/components/icon.tsx b/app/javascript/mastodon/components/icon.tsx index 6bd15da6aca7aa59c99ab10f0dbc8dab860d4bdb..3d091c7059e18c2d64dc190f596f5e5a4865f15d 100644 --- a/app/javascript/mastodon/components/icon.tsx +++ b/app/javascript/mastodon/components/icon.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import classNames from 'classnames'; interface Props extends React.HTMLAttributes { diff --git a/app/javascript/mastodon/components/icon_button.tsx b/app/javascript/mastodon/components/icon_button.tsx index c995ed0ebe08aa5c98a7df3287bf4e3d08a62da8..9dbee2cc246ed30452d3d3ce66871ff5f71746ef 100644 --- a/app/javascript/mastodon/components/icon_button.tsx +++ b/app/javascript/mastodon/components/icon_button.tsx @@ -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 { +export class IconButton extends PureComponent { static defaultProps = { size: 18, active: false, @@ -127,14 +127,14 @@ export class IconButton extends React.PureComponent { } let contents = ( - + <> + ); if (href != null) { diff --git a/app/javascript/mastodon/components/icon_with_badge.tsx b/app/javascript/mastodon/components/icon_with_badge.tsx index e427b7172bcc21d549aebeb7da061c72a613b4b6..8898f413299480bfa67e19e2869697e0dc3be35a 100644 --- a/app/javascript/mastodon/components/icon_with_badge.tsx +++ b/app/javascript/mastodon/components/icon_with_badge.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { Icon } from './icon'; const formatNumber = (num: number): number | string => (num > 40 ? '40+' : num); diff --git a/app/javascript/mastodon/components/inline_account.jsx b/app/javascript/mastodon/components/inline_account.jsx index ca11f8b1bcf0bdb72b09fcf643511e4ca1b4a12d..4366af3c7c0daa99e3fce8649d1825f9d5884309 100644 --- a/app/javascript/mastodon/components/inline_account.jsx +++ b/app/javascript/mastodon/components/inline_account.jsx @@ -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, diff --git a/app/javascript/mastodon/components/intersection_observer_article.jsx b/app/javascript/mastodon/components/intersection_observer_article.jsx index 77957a21da1c95ad8a401cdcb03f3b307ffaa6a8..faba01b80e252b032a195ec9b5fd2d68f083aaba 100644 --- a/app/javascript/mastodon/components/intersection_observer_article.jsx +++ b/app/javascript/mastodon/components/intersection_observer_article.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { cloneElement, Component } from 'react'; import PropTypes from 'prop-types'; import scheduleIdleTask from '../features/ui/util/schedule_idle_task'; import getRectFromEntry from '../features/ui/util/get_rect_from_entry'; @@ -6,7 +6,7 @@ import getRectFromEntry from '../features/ui/util/get_rect_from_entry'; // Diff these props in the "unrendered" state const updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'cachedHeight']; -export default class IntersectionObserverArticle extends React.Component { +export default class IntersectionObserverArticle extends Component { static propTypes = { intersectionObserverWrapper: PropTypes.object.isRequired, @@ -115,14 +115,14 @@ export default class IntersectionObserverArticle extends React.Component { data-id={id} tabIndex={0} > - {children && React.cloneElement(children, { hidden: true })} + {children && cloneElement(children, { hidden: true })} ); } return (
- {children && React.cloneElement(children, { hidden: false })} + {children && cloneElement(children, { hidden: false })}
); } diff --git a/app/javascript/mastodon/components/load_gap.jsx b/app/javascript/mastodon/components/load_gap.jsx index 2637bdbbc420f54a59e5faf750d201c1d13b093f..e4da2748a2ec40dd22d4717b75d569c027f79888 100644 --- a/app/javascript/mastodon/components/load_gap.jsx +++ b/app/javascript/mastodon/components/load_gap.jsx @@ -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, diff --git a/app/javascript/mastodon/components/load_more.jsx b/app/javascript/mastodon/components/load_more.jsx index 150525214b51e990d11cf465d608f62cdc37bc07..b077b89282a07e44f661f3afdf74b4505669d2dc 100644 --- a/app/javascript/mastodon/components/load_more.jsx +++ b/app/javascript/mastodon/components/load_more.jsx @@ -1,8 +1,8 @@ -import React from 'react'; +import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; -export default class LoadMore extends React.PureComponent { +export default class LoadMore extends PureComponent { static propTypes = { onClick: PropTypes.func, diff --git a/app/javascript/mastodon/components/load_pending.jsx b/app/javascript/mastodon/components/load_pending.jsx index a75259146ae8048a1143c9119848108c09e0d6e5..d05e6b1dc98801f7c44a412e1b45796290a2f508 100644 --- a/app/javascript/mastodon/components/load_pending.jsx +++ b/app/javascript/mastodon/components/load_pending.jsx @@ -1,8 +1,8 @@ -import React from 'react'; +import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; -export default class LoadPending extends React.PureComponent { +export default class LoadPending extends PureComponent { static propTypes = { onClick: PropTypes.func, diff --git a/app/javascript/mastodon/components/loading_indicator.jsx b/app/javascript/mastodon/components/loading_indicator.jsx index 33c59d94c02f494f75dca915d2dcd70ebe5386a1..c3f7a4e9ef0b408ecb0e5e7a62206e62f3d544d7 100644 --- a/app/javascript/mastodon/components/loading_indicator.jsx +++ b/app/javascript/mastodon/components/loading_indicator.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; export const CircularProgress = ({ size, strokeWidth }) => { diff --git a/app/javascript/mastodon/components/logo.tsx b/app/javascript/mastodon/components/logo.tsx index 6594ef1fd43ef3853a1dab72d7214dcd45b49c41..928aa29a7cbc42bcb641c1530bed2d2e00364e9f 100644 --- a/app/javascript/mastodon/components/logo.tsx +++ b/app/javascript/mastodon/components/logo.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import logo from 'mastodon/../images/logo.svg'; export const WordmarkLogo: React.FC = () => ( diff --git a/app/javascript/mastodon/components/media_attachments.jsx b/app/javascript/mastodon/components/media_attachments.jsx index 0e25e597342b52b7d4f5e229b73009d82eaf19f9..055be5d287fb356515c459c0288ed466e7731858 100644 --- a/app/javascript/mastodon/components/media_attachments.jsx +++ b/app/javascript/mastodon/components/media_attachments.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/mastodon/components/media_gallery.jsx b/app/javascript/mastodon/components/media_gallery.jsx index 6653f8632d6ddd72ad421eae0e7393b3b87b4dee..90345c867b00750e9b4626e1ca37f02cebffa5fd 100644 --- a/app/javascript/mastodon/components/media_gallery.jsx +++ b/app/javascript/mastodon/components/media_gallery.jsx @@ -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, diff --git a/app/javascript/mastodon/components/modal_root.jsx b/app/javascript/mastodon/components/modal_root.jsx index 7671d2725dc8970008280fd99a48f3b68aca9679..b735f7734e85d861bd8fc290774cbc886de65f79 100644 --- a/app/javascript/mastodon/components/modal_root.jsx +++ b/app/javascript/mastodon/components/modal_root.jsx @@ -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, diff --git a/app/javascript/mastodon/components/navigation_portal.jsx b/app/javascript/mastodon/components/navigation_portal.jsx index a100dc04a65b4b00284dbc67c63c82dfffd28cc0..40c47c0218da81a4141f5b56e1a9cf6983475d70 100644 --- a/app/javascript/mastodon/components/navigation_portal.jsx +++ b/app/javascript/mastodon/components/navigation_portal.jsx @@ -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 ( diff --git a/app/javascript/mastodon/components/not_signed_in_indicator.tsx b/app/javascript/mastodon/components/not_signed_in_indicator.tsx index ce94c5d873e9bf52f7dff6a832a00d7c9d92cea9..015f74dcaeabed1b4821c6ae1bf8336d8f3d566a 100644 --- a/app/javascript/mastodon/components/not_signed_in_indicator.tsx +++ b/app/javascript/mastodon/components/not_signed_in_indicator.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { FormattedMessage } from 'react-intl'; export const NotSignedInIndicator: React.FC = () => ( diff --git a/app/javascript/mastodon/components/picture_in_picture_placeholder.jsx b/app/javascript/mastodon/components/picture_in_picture_placeholder.jsx index 4763a28d10754a79d7846df5e243699e1f0c37cc..e44aafd0922e85cbd6549e0d1c7b524348e9791b 100644 --- a/app/javascript/mastodon/components/picture_in_picture_placeholder.jsx +++ b/app/javascript/mastodon/components/picture_in_picture_placeholder.jsx @@ -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, diff --git a/app/javascript/mastodon/components/poll.jsx b/app/javascript/mastodon/components/poll.jsx index 0ccdf472eb876a2bdcdc2d3168bdb7ab3a65e720..506b9d3f7e2e0ed98e1bf5e9296c9f9ac26622c6 100644 --- a/app/javascript/mastodon/components/poll.jsx +++ b/app/javascript/mastodon/components/poll.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/mastodon/components/radio_button.tsx b/app/javascript/mastodon/components/radio_button.tsx index 67acb09f42e2839ddcbe0dcba63fad31de5c44b7..d0a565b9e65aa3d64a394fc89bb505d9cfcf8eb6 100644 --- a/app/javascript/mastodon/components/radio_button.tsx +++ b/app/javascript/mastodon/components/radio_button.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import classNames from 'classnames'; interface Props { diff --git a/app/javascript/mastodon/components/regeneration_indicator.jsx b/app/javascript/mastodon/components/regeneration_indicator.jsx index 52696a4a724c63258a3fc652cc0f919beb183435..dbefc7a9b949176c4bd05320aa92ab2b94292d39 100644 --- a/app/javascript/mastodon/components/regeneration_indicator.jsx +++ b/app/javascript/mastodon/components/regeneration_indicator.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { FormattedMessage } from 'react-intl'; import illustration from 'mastodon/../images/elephant_ui_working.svg'; diff --git a/app/javascript/mastodon/components/relative_timestamp.tsx b/app/javascript/mastodon/components/relative_timestamp.tsx index e0e0d4bb53825577e6a564b10804789531c3285c..aaa424dca66d59803dbb699513e887a643019343 100644 --- a/app/javascript/mastodon/components/relative_timestamp.tsx +++ b/app/javascript/mastodon/components/relative_timestamp.tsx @@ -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 { +class RelativeTimestamp extends Component { state = { now: this.props.intl.now(), }; diff --git a/app/javascript/mastodon/components/scrollable_list.jsx b/app/javascript/mastodon/components/scrollable_list.jsx index 9b9e1e744938a215adea730fb6fc3e6b99b612a0..6fed295da49851641c529d3098d41740d998b7a4 100644 --- a/app/javascript/mastodon/components/scrollable_list.jsx +++ b/app/javascript/mastodon/components/scrollable_list.jsx @@ -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) ? : null; const loadPending = (numPending > 0) ? : 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) => ( - {React.cloneElement(child, { + {cloneElement(child, { getScrollPosition: this.getScrollPosition, updateScrollBottom: this.updateScrollBottom, cachedMediaWidth: this.state.cachedMediaWidth, diff --git a/app/javascript/mastodon/components/server_banner.jsx b/app/javascript/mastodon/components/server_banner.jsx index 6c3abd5b6f3c67545857a3eb3b89992184e10565..9d41700a189298e89059b46218f48fd9ac0d674a 100644 --- a/app/javascript/mastodon/components/server_banner.jsx +++ b/app/javascript/mastodon/components/server_banner.jsx @@ -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, diff --git a/app/javascript/mastodon/components/server_hero_image.tsx b/app/javascript/mastodon/components/server_hero_image.tsx index 973d1d1b370eb51e2c6608c379e3a53ba218e4ee..68b7f03df3974485ac9b10afadd6c4a8077b2a97 100644 --- a/app/javascript/mastodon/components/server_hero_image.tsx +++ b/app/javascript/mastodon/components/server_hero_image.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useState } from 'react'; +import { useCallback, useState } from 'react'; import classNames from 'classnames'; diff --git a/app/javascript/mastodon/components/short_number.jsx b/app/javascript/mastodon/components/short_number.jsx index 0c40941c0d13b2de6f6e852b1db0ee8be932a461..550ed7d0ac5bd74866b047fb2647a7deac9f917a 100644 --- a/app/javascript/mastodon/components/short_number.jsx +++ b/app/javascript/mastodon/components/short_number.jsx @@ -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); diff --git a/app/javascript/mastodon/components/skeleton.tsx b/app/javascript/mastodon/components/skeleton.tsx index 8d43e6827d17df6fd37402d1bff115998b0d3d9a..d6f1aed7238f8764fd063cbb38729de725639b27 100644 --- a/app/javascript/mastodon/components/skeleton.tsx +++ b/app/javascript/mastodon/components/skeleton.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - interface Props { width?: number | string; height?: number | string; diff --git a/app/javascript/mastodon/components/status.jsx b/app/javascript/mastodon/components/status.jsx index 070ec4672aaf0715abefbf14b2a63758f9c3a5b7..536ac1dd27ed14b1915bd5d341d01ecc809a78c1 100644 --- a/app/javascript/mastodon/components/status.jsx +++ b/app/javascript/mastodon/components/status.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import { Avatar } from './avatar'; diff --git a/app/javascript/mastodon/components/status_action_bar.jsx b/app/javascript/mastodon/components/status_action_bar.jsx index aee9cc19e8666fb0a621f5890d4450a8b0ca81f8..2e83597da8ce4f93863bf3dd079a66fd18884cf2 100644 --- a/app/javascript/mastodon/components/status_action_bar.jsx +++ b/app/javascript/mastodon/components/status_action_bar.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; diff --git a/app/javascript/mastodon/components/status_content.jsx b/app/javascript/mastodon/components/status_content.jsx index cece3ffc255529049f1ffca7f5e10bb195353600..ffaaae28eaf21f6e8eec4c5cb757fddb5f860718 100644 --- a/app/javascript/mastodon/components/status_content.jsx +++ b/app/javascript/mastodon/components/status_content.jsx @@ -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, diff --git a/app/javascript/mastodon/components/status_list.jsx b/app/javascript/mastodon/components/status_list.jsx index 34b7732787c0902b80fad2e0ee0313f1add72835..cd646be6ede8c49e73d8023914b91e7d49548419 100644 --- a/app/javascript/mastodon/components/status_list.jsx +++ b/app/javascript/mastodon/components/status_list.jsx @@ -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'; diff --git a/app/javascript/mastodon/components/timeline_hint.tsx b/app/javascript/mastodon/components/timeline_hint.tsx index 712b4c293b87ca040d094e609a39387c3ae48499..bf2a2d8bbaeda77ae7da0cafa06d241491d1f276 100644 --- a/app/javascript/mastodon/components/timeline_hint.tsx +++ b/app/javascript/mastodon/components/timeline_hint.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { FormattedMessage } from 'react-intl'; interface Props { diff --git a/app/javascript/mastodon/components/verified_badge.tsx b/app/javascript/mastodon/components/verified_badge.tsx index 4c5de312039fea1e71862eaf1b41150ab24a3831..6b421ba42c9008a1c2ba5dd305601d2bc4f02309 100644 --- a/app/javascript/mastodon/components/verified_badge.tsx +++ b/app/javascript/mastodon/components/verified_badge.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { Icon } from './icon'; interface Props { diff --git a/app/javascript/mastodon/containers/account_container.jsx b/app/javascript/mastodon/containers/account_container.jsx index 5a5136dd186d6fcded794be991a862e7e8c732cb..f3d3e039c7c26a67eb36988c388aeec24486d63e 100644 --- a/app/javascript/mastodon/containers/account_container.jsx +++ b/app/javascript/mastodon/containers/account_container.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { makeGetAccount } from '../selectors'; diff --git a/app/javascript/mastodon/containers/admin_component.jsx b/app/javascript/mastodon/containers/admin_component.jsx index 816b44bd17962b376e2c01c8e8801a9aaf54cd89..188485d40b47aa6b304731ad3f3fbfd477328700 100644 --- a/app/javascript/mastodon/containers/admin_component.jsx +++ b/app/javascript/mastodon/containers/admin_component.jsx @@ -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, diff --git a/app/javascript/mastodon/containers/compose_container.jsx b/app/javascript/mastodon/containers/compose_container.jsx index 9213c5614eddeaa8a2602212d36581d84a0c8015..289369f07a7f431c3c0fdbf8270cacce69bf982e 100644 --- a/app/javascript/mastodon/containers/compose_container.jsx +++ b/app/javascript/mastodon/containers/compose_container.jsx @@ -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, diff --git a/app/javascript/mastodon/containers/domain_container.jsx b/app/javascript/mastodon/containers/domain_container.jsx index 419d5d29f5cc1fa896f55944cd2e71e045da2292..bc2a4484940733d9d44fbead4d05c34f9144b443 100644 --- a/app/javascript/mastodon/containers/domain_container.jsx +++ b/app/javascript/mastodon/containers/domain_container.jsx @@ -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'; diff --git a/app/javascript/mastodon/containers/mastodon.jsx b/app/javascript/mastodon/containers/mastodon.jsx index 9c6c9e59209bb83ed8a418b460dd117deafc7792..319425e3fc050b99e960085f072e3f62f786b445 100644 --- a/app/javascript/mastodon/containers/mastodon.jsx +++ b/app/javascript/mastodon/containers/mastodon.jsx @@ -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, diff --git a/app/javascript/mastodon/containers/media_container.jsx b/app/javascript/mastodon/containers/media_container.jsx index 1b6caaba8cebe74d29909b8920f91d1453ccdb2e..4d1689c2356dd1c33715c54ef9d14661abc1328f 100644 --- a/app/javascript/mastodon/containers/media_container.jsx +++ b/app/javascript/mastodon/containers/media_container.jsx @@ -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'; diff --git a/app/javascript/mastodon/containers/status_container.jsx b/app/javascript/mastodon/containers/status_container.jsx index b54501f00931d17e308ca603722f63ca71d33170..45b384028dfd5700d011dd7cf0297213de6e5545 100644 --- a/app/javascript/mastodon/containers/status_container.jsx +++ b/app/javascript/mastodon/containers/status_container.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import Status from '../components/status'; import { makeGetStatus, makeGetPictureInPicture } from '../selectors'; diff --git a/app/javascript/mastodon/features/about/index.jsx b/app/javascript/mastodon/features/about/index.jsx index 61a9180a107e83a82c63a40e589be0948bbb311b..5697eb25bbf86b329f918c3c9c1ad655dc359c5d 100644 --- a/app/javascript/mastodon/features/about/index.jsx +++ b/app/javascript/mastodon/features/about/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/account/components/account_note.jsx b/app/javascript/mastodon/features/account/components/account_note.jsx index 9a81b0aee23efb39c0e04ec42f00a12aa33d581c..02746b4f0238b7b08bb21b88cbdc946bbafe37ca 100644 --- a/app/javascript/mastodon/features/account/components/account_note.jsx +++ b/app/javascript/mastodon/features/account/components/account_note.jsx @@ -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, diff --git a/app/javascript/mastodon/features/account/components/featured_tags.jsx b/app/javascript/mastodon/features/account/components/featured_tags.jsx index 52aa232caff5f743c6dcfb0fa256f37772709d32..ad903e215155d172b9c67726e3865a2f2d603fcf 100644 --- a/app/javascript/mastodon/features/account/components/featured_tags.jsx +++ b/app/javascript/mastodon/features/account/components/featured_tags.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/mastodon/features/account/components/follow_request_note.jsx b/app/javascript/mastodon/features/account/components/follow_request_note.jsx index 7972515af552ead1356755ae13a180c31e160933..beaed10ce93b4460489b49263a5757ded8ce0cd2 100644 --- a/app/javascript/mastodon/features/account/components/follow_request_note.jsx +++ b/app/javascript/mastodon/features/account/components/follow_request_note.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/account/components/header.jsx b/app/javascript/mastodon/features/account/components/header.jsx index bb0982b5e42d4ae03fd8bf527db80e42bf9fe9e3..2784441c9c111a8e2e4c223df1a150e97a80eec0 100644 --- a/app/javascript/mastodon/features/account/components/header.jsx +++ b/app/javascript/mastodon/features/account/components/header.jsx @@ -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 && (
{!hidden && ( - + {actionBtn} {bellBtn} - + )} diff --git a/app/javascript/mastodon/features/account/navigation.jsx b/app/javascript/mastodon/features/account/navigation.jsx index 07dc3757ccc3fef3728f1f2b823b62daf19715ae..e1558addaf59140d758771540fb86432e9d47a3c 100644 --- a/app/javascript/mastodon/features/account/navigation.jsx +++ b/app/javascript/mastodon/features/account/navigation.jsx @@ -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({ diff --git a/app/javascript/mastodon/features/account_gallery/components/media_item.jsx b/app/javascript/mastodon/features/account_gallery/components/media_item.jsx index 9e9b9e6e160bdc36c8573336d75357862d088f6c..ffbbe661e12155ef63e03228b12bbdf7111bcf99 100644 --- a/app/javascript/mastodon/features/account_gallery/components/media_item.jsx +++ b/app/javascript/mastodon/features/account_gallery/components/media_item.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/account_gallery/index.jsx b/app/javascript/mastodon/features/account_gallery/index.jsx index 8c44fa346f82a2b90465c0c74e6ab07deed0a79d..1d9954b668d82d6eb21904c027ac6055f2477b35 100644 --- a/app/javascript/mastodon/features/account_gallery/index.jsx +++ b/app/javascript/mastodon/features/account_gallery/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; diff --git a/app/javascript/mastodon/features/account_timeline/components/header.jsx b/app/javascript/mastodon/features/account_timeline/components/header.jsx index e64deaefa6f87ad5120f586fe8ae0d90e948d7bd..611efcc5cc4487c94076ba7c30f5839836a50050 100644 --- a/app/javascript/mastodon/features/account_timeline/components/header.jsx +++ b/app/javascript/mastodon/features/account_timeline/components/header.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/account_timeline/components/limited_account_hint.jsx b/app/javascript/mastodon/features/account_timeline/components/limited_account_hint.jsx index e6a11147069611c860bc13e0252e885135762c48..ebe96d7db8d43a85d5a2f38a192910ce55f74f10 100644 --- a/app/javascript/mastodon/features/account_timeline/components/limited_account_hint.jsx +++ b/app/javascript/mastodon/features/account_timeline/components/limited_account_hint.jsx @@ -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, diff --git a/app/javascript/mastodon/features/account_timeline/components/memorial_note.jsx b/app/javascript/mastodon/features/account_timeline/components/memorial_note.jsx index fed95ac2ab1d27b1aeaf6ea95fb19a53b7108231..a04808f1caf737eaf9b8d3b1dc91538b076ba332 100644 --- a/app/javascript/mastodon/features/account_timeline/components/memorial_note.jsx +++ b/app/javascript/mastodon/features/account_timeline/components/memorial_note.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { FormattedMessage } from 'react-intl'; const MemorialNote = () => ( diff --git a/app/javascript/mastodon/features/account_timeline/components/moved_note.jsx b/app/javascript/mastodon/features/account_timeline/components/moved_note.jsx index 29861612c3109ff23b539e4417f48fac92759747..7c8da1c2f46315331f116e2f6318e87a0a327124 100644 --- a/app/javascript/mastodon/features/account_timeline/components/moved_note.jsx +++ b/app/javascript/mastodon/features/account_timeline/components/moved_note.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/account_timeline/containers/header_container.jsx b/app/javascript/mastodon/features/account_timeline/containers/header_container.jsx index 419a9fa566443d4b87312fbcae3f220cc0793c60..15648612ce4c56a86522ba6dc10f9ec20398142a 100644 --- a/app/javascript/mastodon/features/account_timeline/containers/header_container.jsx +++ b/app/javascript/mastodon/features/account_timeline/containers/header_container.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import { makeGetAccount, getAccountHidden } from '../../../selectors'; import Header from '../components/header'; diff --git a/app/javascript/mastodon/features/account_timeline/index.jsx b/app/javascript/mastodon/features/account_timeline/index.jsx index ce9485216e76ee86f5d267cc95eb7999b0d080f0..2576d48cf2541afe39729c6fdb75f5c8a42aba86 100644 --- a/app/javascript/mastodon/features/account_timeline/index.jsx +++ b/app/javascript/mastodon/features/account_timeline/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; diff --git a/app/javascript/mastodon/features/audio/index.jsx b/app/javascript/mastodon/features/audio/index.jsx index 5ed02d9378d861155f467e73623c6d7a6b87e0eb..d81813cf0da38d4b3c24c970dac5e085947d6947 100644 --- a/app/javascript/mastodon/features/audio/index.jsx +++ b/app/javascript/mastodon/features/audio/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/blocks/index.jsx b/app/javascript/mastodon/features/blocks/index.jsx index da28f12d79001b9e5bb9cd99872d9e37677dbf48..088545bde9e828ccb80dfaeba7909c10641963a1 100644 --- a/app/javascript/mastodon/features/blocks/index.jsx +++ b/app/javascript/mastodon/features/blocks/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/bookmarked_statuses/index.jsx b/app/javascript/mastodon/features/bookmarked_statuses/index.jsx index 1ffe7e768d0dc902b8b45a749a527252834d1132..7a3ca39b742560104ce5d01ad5443e9996e98491 100644 --- a/app/javascript/mastodon/features/bookmarked_statuses/index.jsx +++ b/app/javascript/mastodon/features/bookmarked_statuses/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/closed_registrations_modal/index.jsx b/app/javascript/mastodon/features/closed_registrations_modal/index.jsx index 40df804f2d972f62a43176cdd668bf1550f9695b..9ff167ecfcdf738dd01fa3d1fcad67e88f0cba95 100644 --- a/app/javascript/mastodon/features/closed_registrations_modal/index.jsx +++ b/app/javascript/mastodon/features/closed_registrations_modal/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/community_timeline/components/column_settings.jsx b/app/javascript/mastodon/features/community_timeline/components/column_settings.jsx index d6181919ab7e15306d273defd3515edab2950281..c71f301cb0b1f342aaaece8fa21604c882ddca5f 100644 --- a/app/javascript/mastodon/features/community_timeline/components/column_settings.jsx +++ b/app/javascript/mastodon/features/community_timeline/components/column_settings.jsx @@ -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, diff --git a/app/javascript/mastodon/features/community_timeline/index.jsx b/app/javascript/mastodon/features/community_timeline/index.jsx index e41d11bb5cdb83f004c762b7cce0b06316e5b597..bdcefe73d0b0a8b3f99903878917375e5789b0a5 100644 --- a/app/javascript/mastodon/features/community_timeline/index.jsx +++ b/app/javascript/mastodon/features/community_timeline/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/compose/components/action_bar.jsx b/app/javascript/mastodon/features/compose/components/action_bar.jsx index 13760582ecc2afc892dcebca3adc5341ea4273f7..3382a5ce445e9540025dfab83bd0970d3124e671 100644 --- a/app/javascript/mastodon/features/compose/components/action_bar.jsx +++ b/app/javascript/mastodon/features/compose/components/action_bar.jsx @@ -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, diff --git a/app/javascript/mastodon/features/compose/components/autosuggest_account.jsx b/app/javascript/mastodon/features/compose/components/autosuggest_account.jsx index a635657d9f1daa457e1963dc9c45b24bdc454159..2231beb767550c225a3a6df156b71ede0f01c1ea 100644 --- a/app/javascript/mastodon/features/compose/components/autosuggest_account.jsx +++ b/app/javascript/mastodon/features/compose/components/autosuggest_account.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/compose/components/character_counter.jsx b/app/javascript/mastodon/features/compose/components/character_counter.jsx index 0ecfc9141d8f641e25197f42d431c516b70377b8..15fc77bdcd2fe65a9143be53adf4a9870385fd2b 100644 --- a/app/javascript/mastodon/features/compose/components/character_counter.jsx +++ b/app/javascript/mastodon/features/compose/components/character_counter.jsx @@ -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, diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx index 3f42cb885e425ba1597dbb4035cc90e951cc958c..7ac2526f20c624e5ba6e645646a8964a9f533620 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.jsx +++ b/app/javascript/mastodon/features/compose/components/compose_form.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import CharacterCounter from './character_counter'; import Button from '../../../components/button'; import ImmutablePropTypes from 'react-immutable-proptypes'; diff --git a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx index c12d56e4a93e6ff8db99ed7085adfb39bde057ed..0bef6ccdb0cae56b47631f54c5efa46381dc6ca6 100644 --- a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx +++ b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx @@ -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 = () => (
); -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, diff --git a/app/javascript/mastodon/features/compose/components/language_dropdown.jsx b/app/javascript/mastodon/features/compose/components/language_dropdown.jsx index 731d7b38dec32f73c6b4a6d3fd725c67207da94a..639832c452d62051aa98345bcc0de3e17fc8b9d1 100644 --- a/app/javascript/mastodon/features/compose/components/language_dropdown.jsx +++ b/app/javascript/mastodon/features/compose/components/language_dropdown.jsx @@ -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, diff --git a/app/javascript/mastodon/features/compose/components/navigation_bar.jsx b/app/javascript/mastodon/features/compose/components/navigation_bar.jsx index b5a7b6bda2343be81f4c53be77d19b0daf21b874..3a2e535948aa49bfb9a2a64232420afd2418a161 100644 --- a/app/javascript/mastodon/features/compose/components/navigation_bar.jsx +++ b/app/javascript/mastodon/features/compose/components/navigation_bar.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ActionBar from './action_bar'; diff --git a/app/javascript/mastodon/features/compose/components/poll_button.jsx b/app/javascript/mastodon/features/compose/components/poll_button.jsx index 5d90564bd1fd60862bb63be8cbda80aed29aabdf..9c9a94629e23542396c44f2c4afd12f1711a1b05 100644 --- a/app/javascript/mastodon/features/compose/components/poll_button.jsx +++ b/app/javascript/mastodon/features/compose/components/poll_button.jsx @@ -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, diff --git a/app/javascript/mastodon/features/compose/components/poll_form.jsx b/app/javascript/mastodon/features/compose/components/poll_form.jsx index 33afa3ad4812ced8ea70e1c7d21941009c4aeb0e..b319a2a6007a0bd423ef5239409cf40fe6d2e99b 100644 --- a/app/javascript/mastodon/features/compose/components/poll_form.jsx +++ b/app/javascript/mastodon/features/compose/components/poll_form.jsx @@ -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, diff --git a/app/javascript/mastodon/features/compose/components/privacy_dropdown.jsx b/app/javascript/mastodon/features/compose/components/privacy_dropdown.jsx index dd20cccc2872655f3e160218b99e3109a693137f..56f4cd253344c90d3873dd0ec3b1d2972f293f16 100644 --- a/app/javascript/mastodon/features/compose/components/privacy_dropdown.jsx +++ b/app/javascript/mastodon/features/compose/components/privacy_dropdown.jsx @@ -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, diff --git a/app/javascript/mastodon/features/compose/components/reply_indicator.jsx b/app/javascript/mastodon/features/compose/components/reply_indicator.jsx index b3f1b1b4827b6048a16691f8eab77e853080e8a1..8d65da62e0fedac9c08f752d963e8c83ab3e1db5 100644 --- a/app/javascript/mastodon/features/compose/components/reply_indicator.jsx +++ b/app/javascript/mastodon/features/compose/components/reply_indicator.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import { Avatar } from '../../../components/avatar'; diff --git a/app/javascript/mastodon/features/compose/components/search.jsx b/app/javascript/mastodon/features/compose/components/search.jsx index d20908b9df88ca6002c954107c79e95e799c8802..92a008e221b908cd3be31eb92960e78a1a3b9e02 100644 --- a/app/javascript/mastodon/features/compose/components/search.jsx +++ b/app/javascript/mastodon/features/compose/components/search.jsx @@ -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, diff --git a/app/javascript/mastodon/features/compose/components/search_results.jsx b/app/javascript/mastodon/features/compose/components/search_results.jsx index 9a44e2eaf7cef40d843d23a55f4b908dd4ef3c19..e13889e4397c40fed5076bd6bbcb7d2547c78f03 100644 --- a/app/javascript/mastodon/features/compose/components/search_results.jsx +++ b/app/javascript/mastodon/features/compose/components/search_results.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/compose/components/text_icon_button.jsx b/app/javascript/mastodon/features/compose/components/text_icon_button.jsx index 73da32ad5da4cf0f22fda126d0ece414613e87f3..01bea732e771504d1f8656ee3b312c2fa5183bc5 100644 --- a/app/javascript/mastodon/features/compose/components/text_icon_button.jsx +++ b/app/javascript/mastodon/features/compose/components/text_icon_button.jsx @@ -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, diff --git a/app/javascript/mastodon/features/compose/components/upload.jsx b/app/javascript/mastodon/features/compose/components/upload.jsx index d667f5ef71fa45039358e5f2308e1ed69ac8339b..aeddd622d60c45081af6235707a11be257c0463a 100644 --- a/app/javascript/mastodon/features/compose/components/upload.jsx +++ b/app/javascript/mastodon/features/compose/components/upload.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/compose/components/upload_button.jsx b/app/javascript/mastodon/features/compose/components/upload_button.jsx index 3870997c3d67e93dbc43aba4fe5eab001eee83cf..a89c7d98786a940e143b344025ddfb7596d20560 100644 --- a/app/javascript/mastodon/features/compose/components/upload_button.jsx +++ b/app/javascript/mastodon/features/compose/components/upload_button.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/compose/components/upload_form.jsx b/app/javascript/mastodon/features/compose/components/upload_form.jsx index 9ff2aa0fa631fdbcd64dfd3038d12e0166b08282..bfa72825841416be4a8453fdc2ceaf748d5f91e8 100644 --- a/app/javascript/mastodon/features/compose/components/upload_form.jsx +++ b/app/javascript/mastodon/features/compose/components/upload_form.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/compose/components/upload_progress.jsx b/app/javascript/mastodon/features/compose/components/upload_progress.jsx index c5740d9bf575496eb7c28a48bbc4d8ea730ba865..aa406b510a7d8b7dde5789311e5b46148e328d9d 100644 --- a/app/javascript/mastodon/features/compose/components/upload_progress.jsx +++ b/app/javascript/mastodon/features/compose/components/upload_progress.jsx @@ -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, diff --git a/app/javascript/mastodon/features/compose/components/warning.jsx b/app/javascript/mastodon/features/compose/components/warning.jsx index 803b7f86abd2d949a63ee502a7983d237a4dd17e..4947a4e28b996e6c0793eccbc395e8465e6d6b2f 100644 --- a/app/javascript/mastodon/features/compose/components/warning.jsx +++ b/app/javascript/mastodon/features/compose/components/warning.jsx @@ -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, diff --git a/app/javascript/mastodon/features/compose/containers/sensitive_button_container.jsx b/app/javascript/mastodon/features/compose/containers/sensitive_button_container.jsx index 03f831d2843587e168609cc9b500af8e17c32222..4ad938eea92b8fe814169f8a37141ae168ef5892 100644 --- a/app/javascript/mastodon/features/compose/containers/sensitive_button_container.jsx +++ b/app/javascript/mastodon/features/compose/containers/sensitive_button_container.jsx @@ -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, diff --git a/app/javascript/mastodon/features/compose/containers/warning_container.jsx b/app/javascript/mastodon/features/compose/containers/warning_container.jsx index e99f5dacd9194a4e4af044874ed68df7759637b1..6060d11edc7eda6524b8846f8b2670f0bef86ea6 100644 --- a/app/javascript/mastodon/features/compose/containers/warning_container.jsx +++ b/app/javascript/mastodon/features/compose/containers/warning_container.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import Warning from '../components/warning'; import PropTypes from 'prop-types'; diff --git a/app/javascript/mastodon/features/compose/index.jsx b/app/javascript/mastodon/features/compose/index.jsx index df60d4347e4214b9b59bd9e672d84d79f34367ca..a87f9b4d38bbb82524c5cf488e5626f6ed103a5c 100644 --- a/app/javascript/mastodon/features/compose/index.jsx +++ b/app/javascript/mastodon/features/compose/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/direct_timeline/components/conversation.jsx b/app/javascript/mastodon/features/direct_timeline/components/conversation.jsx index 452de116197b3eb3549bd9d584d41a78eadfeb7b..0bd00066121c8862ed7517b0f359be300575f564 100644 --- a/app/javascript/mastodon/features/direct_timeline/components/conversation.jsx +++ b/app/javascript/mastodon/features/direct_timeline/components/conversation.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/mastodon/features/direct_timeline/components/conversations_list.jsx b/app/javascript/mastodon/features/direct_timeline/components/conversations_list.jsx index 04c404e1d89746cf96d99595679c11545a187268..6c9dde1e378c53c4423e0002d8daa72d076494a7 100644 --- a/app/javascript/mastodon/features/direct_timeline/components/conversations_list.jsx +++ b/app/javascript/mastodon/features/direct_timeline/components/conversations_list.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/mastodon/features/direct_timeline/index.jsx b/app/javascript/mastodon/features/direct_timeline/index.jsx index fc45ea69a3cf5edbe45fdf5186eeb508fb99dcd6..f836b0ebe4af639db6f361e9077b1b9562cc29a4 100644 --- a/app/javascript/mastodon/features/direct_timeline/index.jsx +++ b/app/javascript/mastodon/features/direct_timeline/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/directory/components/account_card.jsx b/app/javascript/mastodon/features/directory/components/account_card.jsx index 1ef9d648136b3e098d27317f15c270c5a7ff26ba..96a6cfa30891f5ec41c2a9e837b3063057d17c57 100644 --- a/app/javascript/mastodon/features/directory/components/account_card.jsx +++ b/app/javascript/mastodon/features/directory/components/account_card.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/directory/index.jsx b/app/javascript/mastodon/features/directory/index.jsx index d98a0665ac7a75c3ca9cafc05c36a862861d8a04..c148937f887384195e31bb1f6493becdf4201d62 100644 --- a/app/javascript/mastodon/features/directory/index.jsx +++ b/app/javascript/mastodon/features/directory/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/domain_blocks/index.jsx b/app/javascript/mastodon/features/domain_blocks/index.jsx index 6a9f6e4cf5a2a7ed88fd25088bf9d3aaa185dc1f..9189cb4d82fc20a9292a52f17f1f6ba07f20d80c 100644 --- a/app/javascript/mastodon/features/domain_blocks/index.jsx +++ b/app/javascript/mastodon/features/domain_blocks/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/explore/components/story.jsx b/app/javascript/mastodon/features/explore/components/story.jsx index 6e8db62307cc2345faabf0c67b356621987e57fb..1cf9df5c408e20a6209a301c922e1d10f8d92162 100644 --- a/app/javascript/mastodon/features/explore/components/story.jsx +++ b/app/javascript/mastodon/features/explore/components/story.jsx @@ -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 {
{thumbnail ? ( - +
-
+ ) : }
diff --git a/app/javascript/mastodon/features/explore/index.jsx b/app/javascript/mastodon/features/explore/index.jsx index 35626226ecd49daa4760c5e1e946ecdbf8f2cf02..f858ee572ff5b4d7a722525d40d01a7fb444c4d9 100644 --- a/app/javascript/mastodon/features/explore/index.jsx +++ b/app/javascript/mastodon/features/explore/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/explore/links.jsx b/app/javascript/mastodon/features/explore/links.jsx index 193739916168e31250717e720130a2b088aab0c9..5fa3a29853dd5d6a3ce49bcf0d13c7863fe6098a 100644 --- a/app/javascript/mastodon/features/explore/links.jsx +++ b/app/javascript/mastodon/features/explore/links.jsx @@ -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, diff --git a/app/javascript/mastodon/features/explore/results.jsx b/app/javascript/mastodon/features/explore/results.jsx index 9725cf35cd2cc9193abd99872b5be1517105cfae..103cb447879ebcff94944dcbe760b2715350c491 100644 --- a/app/javascript/mastodon/features/explore/results.jsx +++ b/app/javascript/mastodon/features/explore/results.jsx @@ -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 )), 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 ( - +
@@ -117,7 +117,7 @@ class Results extends React.PureComponent { {intl.formatMessage(messages.title, { q })} - + ); } diff --git a/app/javascript/mastodon/features/explore/statuses.jsx b/app/javascript/mastodon/features/explore/statuses.jsx index a98a6d04653f1c087517fcc1042479a4f87462b4..1a606bb3b9f267a681ebba1db7d7d2660c6d6d70 100644 --- a/app/javascript/mastodon/features/explore/statuses.jsx +++ b/app/javascript/mastodon/features/explore/statuses.jsx @@ -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, diff --git a/app/javascript/mastodon/features/explore/suggestions.jsx b/app/javascript/mastodon/features/explore/suggestions.jsx index 53eb7ba4b46e3ab8cbf0c986096a79e7f10a7c6d..b7c15b4d250bb6c2ce546af86dedb253fd835db9 100644 --- a/app/javascript/mastodon/features/explore/suggestions.jsx +++ b/app/javascript/mastodon/features/explore/suggestions.jsx @@ -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, diff --git a/app/javascript/mastodon/features/explore/tags.jsx b/app/javascript/mastodon/features/explore/tags.jsx index 3ba813c3f8bb258e2da9ba4d7a8ec81d7adb7556..607420b9d514d502eb12d1888bc5cfbb85b0ad55 100644 --- a/app/javascript/mastodon/features/explore/tags.jsx +++ b/app/javascript/mastodon/features/explore/tags.jsx @@ -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, diff --git a/app/javascript/mastodon/features/favourited_statuses/index.jsx b/app/javascript/mastodon/features/favourited_statuses/index.jsx index 161297114de51c11928444cc0ce25e629db9205f..17369617f379dd2ad86e37e3256fb68013fb9b32 100644 --- a/app/javascript/mastodon/features/favourited_statuses/index.jsx +++ b/app/javascript/mastodon/features/favourited_statuses/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/favourites/index.jsx b/app/javascript/mastodon/features/favourites/index.jsx index ed210dad5bbba1ca8847ab02974b59746587db46..85d8686d1997e5eff177c9a1e25c8faa5851c7a8 100644 --- a/app/javascript/mastodon/features/favourites/index.jsx +++ b/app/javascript/mastodon/features/favourites/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/filters/added_to_filter.jsx b/app/javascript/mastodon/features/filters/added_to_filter.jsx index d935d96e2977c1aabd778ae374afc44fb0c8f892..139832ee98aeb1011409444c84a1a96c91be706c 100644 --- a/app/javascript/mastodon/features/filters/added_to_filter.jsx +++ b/app/javascript/mastodon/features/filters/added_to_filter.jsx @@ -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 = ( - +

-
+ ); } let contextMismatchMessage = null; if (contextType && !filter.get('context').includes(toServerSideType(contextType))) { contextMismatchMessage = ( - +

-
+ ); } @@ -67,7 +67,7 @@ class AddedToFilter extends React.PureComponent { ); return ( - +

-
+ ); } diff --git a/app/javascript/mastodon/features/filters/select_filter.jsx b/app/javascript/mastodon/features/filters/select_filter.jsx index 618f875dbe8df4fca6acc88b2312f44c2f4e8ebe..6d23d48cf2ddaf620f73785f6e1a790e5dd99f1c 100644 --- a/app/javascript/mastodon/features/filters/select_filter.jsx +++ b/app/javascript/mastodon/features/filters/select_filter.jsx @@ -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 ( - +

@@ -183,7 +183,7 @@ class SelectFilter extends React.PureComponent { {isSearching && this.renderCreateNew(searchValue) }
- + ); } diff --git a/app/javascript/mastodon/features/follow_requests/components/account_authorize.jsx b/app/javascript/mastodon/features/follow_requests/components/account_authorize.jsx index 5d0632b0f66f788b8b0131497612424cfafa6f8d..4cc46fb27f7dfe98c76434c9d04fc8d9380b802b 100644 --- a/app/javascript/mastodon/features/follow_requests/components/account_authorize.jsx +++ b/app/javascript/mastodon/features/follow_requests/components/account_authorize.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/follow_requests/index.jsx b/app/javascript/mastodon/features/follow_requests/index.jsx index 779bc473e422f93f7047f109ca4485fc75b5aab1..c59266461829a00ee397a1afd1865a9e2d39f300 100644 --- a/app/javascript/mastodon/features/follow_requests/index.jsx +++ b/app/javascript/mastodon/features/follow_requests/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/followed_tags/index.jsx b/app/javascript/mastodon/features/followed_tags/index.jsx index 7c53542c2e28553898f7ba0c97a2d4817e635089..e3bceed7269a9af394f0ef35d41168ed1b407a81 100644 --- a/app/javascript/mastodon/features/followed_tags/index.jsx +++ b/app/javascript/mastodon/features/followed_tags/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/followers/index.jsx b/app/javascript/mastodon/features/followers/index.jsx index 1a1fdf578bc948e36eb01d55e560466b4f360a40..bbf9cd71ee6d225ae8acf895f7241564d0f145f3 100644 --- a/app/javascript/mastodon/features/followers/index.jsx +++ b/app/javascript/mastodon/features/followers/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import ImmutablePureComponent from 'react-immutable-pure-component'; import PropTypes from 'prop-types'; diff --git a/app/javascript/mastodon/features/following/index.jsx b/app/javascript/mastodon/features/following/index.jsx index c024ff063b2f0d8d9798ed1a88182d10f6ea0b0d..c1463c895a02e3955115b9e0c9a758e90fd4a165 100644 --- a/app/javascript/mastodon/features/following/index.jsx +++ b/app/javascript/mastodon/features/following/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import ImmutablePureComponent from 'react-immutable-pure-component'; import PropTypes from 'prop-types'; diff --git a/app/javascript/mastodon/features/getting_started/components/announcements.jsx b/app/javascript/mastodon/features/getting_started/components/announcements.jsx index ab29e3dc86735840a42f48fca12b1a0de9b5068c..44fc25d2063c14add1e96f82c84a552a75b4a395 100644 --- a/app/javascript/mastodon/features/getting_started/components/announcements.jsx +++ b/app/javascript/mastodon/features/getting_started/components/announcements.jsx @@ -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, diff --git a/app/javascript/mastodon/features/getting_started/components/trends.jsx b/app/javascript/mastodon/features/getting_started/components/trends.jsx index 8dcdb4f61c3945e9a11a81d3e0537aba26bcf99f..59596b55466b414ed3163f7a8b14d62ed44d0e5c 100644 --- a/app/javascript/mastodon/features/getting_started/components/trends.jsx +++ b/app/javascript/mastodon/features/getting_started/components/trends.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ImmutablePureComponent from 'react-immutable-pure-component'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; diff --git a/app/javascript/mastodon/features/getting_started/index.jsx b/app/javascript/mastodon/features/getting_started/index.jsx index 29659acc73f32649f8122f95c1fb7cf7523a7a76..69c4fb502f9665735ffe938136608891a43bc129 100644 --- a/app/javascript/mastodon/features/getting_started/index.jsx +++ b/app/javascript/mastodon/features/getting_started/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/hashtag_timeline/components/column_settings.jsx b/app/javascript/mastodon/features/hashtag_timeline/components/column_settings.jsx index f140f2d0130560bd50cd17853eb86b55e356944e..528d4309fcfee01f7e9785e93b2e961593671488 100644 --- a/app/javascript/mastodon/features/hashtag_timeline/components/column_settings.jsx +++ b/app/javascript/mastodon/features/hashtag_timeline/components/column_settings.jsx @@ -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, diff --git a/app/javascript/mastodon/features/hashtag_timeline/index.jsx b/app/javascript/mastodon/features/hashtag_timeline/index.jsx index 116a5921c1ced811bd6d0e29bfdd0dcc0bb5bbd0..29507ee46fe4a54f888880ac0ed84dd61f7b8595 100644 --- a/app/javascript/mastodon/features/hashtag_timeline/index.jsx +++ b/app/javascript/mastodon/features/hashtag_timeline/index.jsx @@ -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 = []; diff --git a/app/javascript/mastodon/features/home_timeline/components/column_settings.jsx b/app/javascript/mastodon/features/home_timeline/components/column_settings.jsx index bd15390c0b9eeeecf785a80be05447572fe896f9..d78918d6ebf722c838a6e6b2628f51626fdf4275 100644 --- a/app/javascript/mastodon/features/home_timeline/components/column_settings.jsx +++ b/app/javascript/mastodon/features/home_timeline/components/column_settings.jsx @@ -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, diff --git a/app/javascript/mastodon/features/home_timeline/index.jsx b/app/javascript/mastodon/features/home_timeline/index.jsx index 26166b254c35422520eeac65a21aeda2a4ce4893..9735699f949186c28f25599212968ddb2ceb1417 100644 --- a/app/javascript/mastodon/features/home_timeline/index.jsx +++ b/app/javascript/mastodon/features/home_timeline/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/interaction_modal/index.jsx b/app/javascript/mastodon/features/interaction_modal/index.jsx index d9eff63cba37d85ebae5b30630b05123fa7f9ab1..0f3b36122b9c3c4d64b5c0ca1f4ff038f0c268e4 100644 --- a/app/javascript/mastodon/features/interaction_modal/index.jsx +++ b/app/javascript/mastodon/features/interaction_modal/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx b/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx index 70f019712e12041e0b4ab174ff6d38bd9ada8194..542d147e1d2c0c9af9447c7687d6d2184e61d934 100644 --- a/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx +++ b/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/list_adder/components/account.jsx b/app/javascript/mastodon/features/list_adder/components/account.jsx index 5dc384aba6f7a2fcc482e4fc05c60fd3666bc3ce..e2828f5ab36b74a3b2df235023407317eaa95b2e 100644 --- a/app/javascript/mastodon/features/list_adder/components/account.jsx +++ b/app/javascript/mastodon/features/list_adder/components/account.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import { makeGetAccount } from '../../../selectors'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/mastodon/features/list_adder/components/list.jsx b/app/javascript/mastodon/features/list_adder/components/list.jsx index 954a4a5cfedd019b42b484a4259a94d1996d4c61..d7f2a9f16688219e1bbde2e4e98abf7bbddd7c91 100644 --- a/app/javascript/mastodon/features/list_adder/components/list.jsx +++ b/app/javascript/mastodon/features/list_adder/components/list.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/mastodon/features/list_adder/index.jsx b/app/javascript/mastodon/features/list_adder/index.jsx index 45d5589f96eb3aaafcab79994593a55747d4fbe5..3ef29b212e6695c5d16221c1375495e4a03ec78d 100644 --- a/app/javascript/mastodon/features/list_adder/index.jsx +++ b/app/javascript/mastodon/features/list_adder/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; diff --git a/app/javascript/mastodon/features/list_editor/components/account.jsx b/app/javascript/mastodon/features/list_editor/components/account.jsx index fc1d2d6071905a702db8900b4ca7f9f111b057ad..6ce59bc3716f57c5fb07d48d26978822c28d2f26 100644 --- a/app/javascript/mastodon/features/list_editor/components/account.jsx +++ b/app/javascript/mastodon/features/list_editor/components/account.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { makeGetAccount } from '../../../selectors'; diff --git a/app/javascript/mastodon/features/list_editor/components/edit_list_form.jsx b/app/javascript/mastodon/features/list_editor/components/edit_list_form.jsx index 65bfe7f94a066de5d6a3586f236f39835abc999d..71532810855c865d69096b1291182b5829575159 100644 --- a/app/javascript/mastodon/features/list_editor/components/edit_list_form.jsx +++ b/app/javascript/mastodon/features/list_editor/components/edit_list_form.jsx @@ -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, diff --git a/app/javascript/mastodon/features/list_editor/components/search.jsx b/app/javascript/mastodon/features/list_editor/components/search.jsx index 59e4c7d939690818082d6e8aba270826f82d5a65..bc5cd136ff437c1660dfcc2c82f0affb1529eda5 100644 --- a/app/javascript/mastodon/features/list_editor/components/search.jsx +++ b/app/javascript/mastodon/features/list_editor/components/search.jsx @@ -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, diff --git a/app/javascript/mastodon/features/list_editor/index.jsx b/app/javascript/mastodon/features/list_editor/index.jsx index ed9d091326caf7ed862ff1c2551369490d33c45c..3ed390c6160e3ac8ad847a47370f8fe37bb4f651 100644 --- a/app/javascript/mastodon/features/list_editor/index.jsx +++ b/app/javascript/mastodon/features/list_editor/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; diff --git a/app/javascript/mastodon/features/list_timeline/index.jsx b/app/javascript/mastodon/features/list_timeline/index.jsx index e1408d8efb8d78da2da19f928fb10b59a404a44a..86d6e3881bab7a314d61ae7108018c6d308a32f8 100644 --- a/app/javascript/mastodon/features/list_timeline/index.jsx +++ b/app/javascript/mastodon/features/list_timeline/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/lists/components/new_list_form.jsx b/app/javascript/mastodon/features/lists/components/new_list_form.jsx index 50b52518e961e21732f2c16a6cff02ebdddef6f9..cab11682651e8d6ef46ae9259e6aa75d53e3b774 100644 --- a/app/javascript/mastodon/features/lists/components/new_list_form.jsx +++ b/app/javascript/mastodon/features/lists/components/new_list_form.jsx @@ -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, diff --git a/app/javascript/mastodon/features/lists/index.jsx b/app/javascript/mastodon/features/lists/index.jsx index 232b0c2d5a84e7abd4b00ea1789a0281c9ff9be1..6e741759d0159f7a25d231911d35c821b622385a 100644 --- a/app/javascript/mastodon/features/lists/index.jsx +++ b/app/javascript/mastodon/features/lists/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/mutes/index.jsx b/app/javascript/mastodon/features/mutes/index.jsx index 078d8779ec9eb76cc7d90e63749b89ec80b6f128..e5c6fbbec949e639f0f80b04345b0df422fedc7f 100644 --- a/app/javascript/mastodon/features/mutes/index.jsx +++ b/app/javascript/mastodon/features/mutes/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/notifications/components/clear_column_button.jsx b/app/javascript/mastodon/features/notifications/components/clear_column_button.jsx index e043f5ee1ea322e67fb4aa0116a73e665ce3595e..342f6a3fb09c7949d9da48f3514baa314b5fd711 100644 --- a/app/javascript/mastodon/features/notifications/components/clear_column_button.jsx +++ b/app/javascript/mastodon/features/notifications/components/clear_column_button.jsx @@ -1,9 +1,9 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { Icon } from 'mastodon/components/icon'; -export default class ClearColumnButton extends React.PureComponent { +export default class ClearColumnButton extends PureComponent { static propTypes = { onClick: PropTypes.func.isRequired, diff --git a/app/javascript/mastodon/features/notifications/components/column_settings.jsx b/app/javascript/mastodon/features/notifications/components/column_settings.jsx index 9251847bada9216bfcf3dd196c30723df0611a09..42a0eb827f9c2e2b39633456665751112312c199 100644 --- a/app/javascript/mastodon/features/notifications/components/column_settings.jsx +++ b/app/javascript/mastodon/features/notifications/components/column_settings.jsx @@ -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, diff --git a/app/javascript/mastodon/features/notifications/components/filter_bar.jsx b/app/javascript/mastodon/features/notifications/components/filter_bar.jsx index f16c84f97a2bcee2336f34d206f40a3c328ea6fb..2a047164142ed19645b74586a8a2217af0359e30 100644 --- a/app/javascript/mastodon/features/notifications/components/filter_bar.jsx +++ b/app/javascript/mastodon/features/notifications/components/filter_bar.jsx @@ -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, diff --git a/app/javascript/mastodon/features/notifications/components/follow_request.jsx b/app/javascript/mastodon/features/notifications/components/follow_request.jsx index d8b2ca1cc9f0a35df41d61a727ebe9053a1c3a24..9456c29adde1ff4f83779294088d51117e0c5502 100644 --- a/app/javascript/mastodon/features/notifications/components/follow_request.jsx +++ b/app/javascript/mastodon/features/notifications/components/follow_request.jsx @@ -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 ( - + {account.get('display_name')} {account.get('username')} - + ); } diff --git a/app/javascript/mastodon/features/notifications/components/grant_permission_button.jsx b/app/javascript/mastodon/features/notifications/components/grant_permission_button.jsx index 5b2db48fdbd44120772014a832e97937959bd478..96f5d67d9c27fbf142a0b5c772a1d19d3cf8758c 100644 --- a/app/javascript/mastodon/features/notifications/components/grant_permission_button.jsx +++ b/app/javascript/mastodon/features/notifications/components/grant_permission_button.jsx @@ -1,8 +1,8 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; -export default class GrantPermissionButton extends React.PureComponent { +export default class GrantPermissionButton extends PureComponent { static propTypes = { onClick: PropTypes.func.isRequired, diff --git a/app/javascript/mastodon/features/notifications/components/notification.jsx b/app/javascript/mastodon/features/notifications/components/notification.jsx index 0f1aef8db193706516e6b67ee359465b62a0b52b..7d5b18554ec6becf8470158a4c76a57431e4d102 100644 --- a/app/javascript/mastodon/features/notifications/components/notification.jsx +++ b/app/javascript/mastodon/features/notifications/components/notification.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { injectIntl, FormattedMessage, defineMessages } from 'react-intl'; import { HotKeys } from 'react-hotkeys'; diff --git a/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.jsx b/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.jsx index a1b4248e7c3eb2b5c7a5b0c80bd1857a88c274a3..d42b350b71c4b8c6b903040b65ab547509283ace 100644 --- a/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.jsx +++ b/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.jsx @@ -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, diff --git a/app/javascript/mastodon/features/notifications/components/report.jsx b/app/javascript/mastodon/features/notifications/components/report.jsx index 1c0e1a7750cd23fa01b13252f2441e7a76326895..301a9525a96d2f50f6735be0d677edeb0a9cdb48 100644 --- a/app/javascript/mastodon/features/notifications/components/report.jsx +++ b/app/javascript/mastodon/features/notifications/components/report.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/notifications/components/setting_toggle.jsx b/app/javascript/mastodon/features/notifications/components/setting_toggle.jsx index c979e4383b2472a3c1e19eaa23905e5474a2f35a..7eec664a1062c9cb8287d20cc6932a9505518418 100644 --- a/app/javascript/mastodon/features/notifications/components/setting_toggle.jsx +++ b/app/javascript/mastodon/features/notifications/components/setting_toggle.jsx @@ -1,9 +1,9 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import Toggle from 'react-toggle'; -export default class SettingToggle extends React.PureComponent { +export default class SettingToggle extends PureComponent { static propTypes = { prefix: PropTypes.string, diff --git a/app/javascript/mastodon/features/notifications/index.jsx b/app/javascript/mastodon/features/notifications/index.jsx index 8b77374c401a7b1823bfd4d964800c69f4ab29af..5375013d19a1ceb150b41db275598115c534d6d6 100644 --- a/app/javascript/mastodon/features/notifications/index.jsx +++ b/app/javascript/mastodon/features/notifications/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/onboarding/components/arrow_small_right.jsx b/app/javascript/mastodon/features/onboarding/components/arrow_small_right.jsx index 40e166f6dcd3df7ff9b57cc487991fa4fab3a27c..79b9db383f563deedeec7f663d28a4603414c349 100644 --- a/app/javascript/mastodon/features/onboarding/components/arrow_small_right.jsx +++ b/app/javascript/mastodon/features/onboarding/components/arrow_small_right.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - const ArrowSmallRight = () => ( diff --git a/app/javascript/mastodon/features/onboarding/components/progress_indicator.jsx b/app/javascript/mastodon/features/onboarding/components/progress_indicator.jsx index 7d75e50edb0dde6052c8db48255df38eb3846194..0d62f4e949ca0b3ab23ceac605c7b76383e38be6 100644 --- a/app/javascript/mastodon/features/onboarding/components/progress_indicator.jsx +++ b/app/javascript/mastodon/features/onboarding/components/progress_indicator.jsx @@ -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 }) => (
{(new Array(steps)).fill().map((_, i) => ( - + {i > 0 &&
i })} />}
i })}> {completed > i && }
- + ))}
); diff --git a/app/javascript/mastodon/features/onboarding/components/step.jsx b/app/javascript/mastodon/features/onboarding/components/step.jsx index 38e4b564a89aac15d957a18872245965e7ea52a1..e612f681e87374f01b26f0b150484feb0b26e201 100644 --- a/app/javascript/mastodon/features/onboarding/components/step.jsx +++ b/app/javascript/mastodon/features/onboarding/components/step.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/onboarding/follows.jsx b/app/javascript/mastodon/features/onboarding/follows.jsx index c96c69055b1a03281e24dd576fe430bcfc92638f..30e7b14190ceda0ee6bbe4167240601255416a97 100644 --- a/app/javascript/mastodon/features/onboarding/follows.jsx +++ b/app/javascript/mastodon/features/onboarding/follows.jsx @@ -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, diff --git a/app/javascript/mastodon/features/onboarding/index.jsx b/app/javascript/mastodon/features/onboarding/index.jsx index ca4a8bcf13bcd58384062b5e5e3081b9ff2e48b7..e9018f15e7b8589d6c5007e05225a8750876f08c 100644 --- a/app/javascript/mastodon/features/onboarding/index.jsx +++ b/app/javascript/mastodon/features/onboarding/index.jsx @@ -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'; diff --git a/app/javascript/mastodon/features/onboarding/share.jsx b/app/javascript/mastodon/features/onboarding/share.jsx index 82fdada413bd1008191e012e417cc4b23a65c314..30e148379de5e2992ad704b845a9ca0574688c41 100644 --- a/app/javascript/mastodon/features/onboarding/share.jsx +++ b/app/javascript/mastodon/features/onboarding/share.jsx @@ -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, diff --git a/app/javascript/mastodon/features/picture_in_picture/components/footer.jsx b/app/javascript/mastodon/features/picture_in_picture/components/footer.jsx index 5c60284d65f14a08dc6f7cb302e59afb163bc03d..eddddf48a929ca6d5b1ea4927fdb9292a12534cf 100644 --- a/app/javascript/mastodon/features/picture_in_picture/components/footer.jsx +++ b/app/javascript/mastodon/features/picture_in_picture/components/footer.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePropTypes from 'react-immutable-proptypes'; diff --git a/app/javascript/mastodon/features/picture_in_picture/components/header.jsx b/app/javascript/mastodon/features/picture_in_picture/components/header.jsx index c1c04da5483a66053aa22ec6b18d30d06fd7fbc0..4339c318dcf4dddfa0ffb3ef5ca457477337a37a 100644 --- a/app/javascript/mastodon/features/picture_in_picture/components/header.jsx +++ b/app/javascript/mastodon/features/picture_in_picture/components/header.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePropTypes from 'react-immutable-proptypes'; diff --git a/app/javascript/mastodon/features/picture_in_picture/index.jsx b/app/javascript/mastodon/features/picture_in_picture/index.jsx index ae48a1b4e59fd28a1ed1134134432afe915b4a13..788a302e9d1540e9665d1b821060ede6688a0c7c 100644 --- a/app/javascript/mastodon/features/picture_in_picture/index.jsx +++ b/app/javascript/mastodon/features/picture_in_picture/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/pinned_statuses/index.jsx b/app/javascript/mastodon/features/pinned_statuses/index.jsx index e58ce2bb8987682168f8666b006438671365315d..9ac9c2f5957b79e07966953221ad1ff202b49eaf 100644 --- a/app/javascript/mastodon/features/pinned_statuses/index.jsx +++ b/app/javascript/mastodon/features/pinned_statuses/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; diff --git a/app/javascript/mastodon/features/privacy_policy/index.jsx b/app/javascript/mastodon/features/privacy_policy/index.jsx index 07a691498937430f5e034235e322a7db3c2e60c1..10ec31c146e0b7e7a169bfd0a816669e4fbd2c71 100644 --- a/app/javascript/mastodon/features/privacy_policy/index.jsx +++ b/app/javascript/mastodon/features/privacy_policy/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/public_timeline/components/column_settings.jsx b/app/javascript/mastodon/features/public_timeline/components/column_settings.jsx index bf8a8323e0010a3b1cb907c41340aa392c431d68..34db9149cb81aa4ff1a8013b3c7c559457b1e9c3 100644 --- a/app/javascript/mastodon/features/public_timeline/components/column_settings.jsx +++ b/app/javascript/mastodon/features/public_timeline/components/column_settings.jsx @@ -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, diff --git a/app/javascript/mastodon/features/public_timeline/index.jsx b/app/javascript/mastodon/features/public_timeline/index.jsx index f89caa2c9519234d6b1a60616d9df8d612b61786..f61faa1e7fb6da8f3eff5a71ee2ff58704577f83 100644 --- a/app/javascript/mastodon/features/public_timeline/index.jsx +++ b/app/javascript/mastodon/features/public_timeline/index.jsx @@ -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, diff --git a/app/javascript/mastodon/features/reblogs/index.jsx b/app/javascript/mastodon/features/reblogs/index.jsx index 757ef0dd0ed98ecdc99485e0f31d01695993cd56..22480988636f369dd3492d65c02c63a18f08c22b 100644 --- a/app/javascript/mastodon/features/reblogs/index.jsx +++ b/app/javascript/mastodon/features/reblogs/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import ImmutablePureComponent from 'react-immutable-pure-component'; import PropTypes from 'prop-types'; diff --git a/app/javascript/mastodon/features/report/category.jsx b/app/javascript/mastodon/features/report/category.jsx index 492a533f20bcef153c51f3cd380a610380815a02..f1fbd9622de26dd701ed3db97da3361d09210c67 100644 --- a/app/javascript/mastodon/features/report/category.jsx +++ b/app/javascript/mastodon/features/report/category.jsx @@ -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 ( - +

@@ -97,7 +97,7 @@ class Category extends React.PureComponent {
-
+
); } diff --git a/app/javascript/mastodon/features/report/comment.jsx b/app/javascript/mastodon/features/report/comment.jsx index ab29f6c22732a41325ef62fa59f456d62d2a1af5..6cf43fca0dfd7fd3da6a2caaaa71893915c1799f 100644 --- a/app/javascript/mastodon/features/report/comment.jsx +++ b/app/javascript/mastodon/features/report/comment.jsx @@ -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 ( - +