From 6001f5ff361c85a4a047b1a3d7f00bc0e8ea5aae Mon Sep 17 00:00:00 2001 From: Claire Date: Sun, 28 May 2023 14:18:23 +0200 Subject: [PATCH] [Glitch] Use the new JSX transform everywhere Port 8f66126b1010e0aaaa8b5f2a2f4ea8a28824e2b7 to glitch-soc --- .../flavours/glitch/components/account.jsx | 2 +- .../glitch/components/admin/Counter.jsx | 16 ++++++------- .../glitch/components/admin/Dimension.jsx | 4 ++-- .../components/admin/ReportReasonSelector.jsx | 8 +++---- .../glitch/components/admin/Retention.jsx | 4 ++-- .../glitch/components/admin/Trends.jsx | 4 ++-- .../glitch/components/animated_number.tsx | 3 ++- .../glitch/components/attachment_list.jsx | 1 - .../glitch/components/autosuggest_emoji.jsx | 4 ++-- .../glitch/components/autosuggest_hashtag.jsx | 4 ++-- .../glitch/components/autosuggest_input.jsx | 1 - .../components/autosuggest_textarea.jsx | 1 - .../glitch/components/avatar_composite.jsx | 4 ++-- .../glitch/components/avatar_overlay.jsx | 4 ++-- .../flavours/glitch/components/blurhash.tsx | 3 ++- .../flavours/glitch/components/button.jsx | 4 ++-- .../flavours/glitch/components/check.jsx | 2 -- .../flavours/glitch/components/column.jsx | 4 ++-- .../glitch/components/column_back_button.jsx | 4 ++-- .../components/column_back_button_slim.jsx | 4 ++-- .../glitch/components/column_header.jsx | 4 ++-- .../glitch/components/common_counter.jsx | 1 - .../glitch/components/dismissable_banner.jsx | 4 ++-- .../flavours/glitch/components/domain.tsx | 3 ++- .../glitch/components/dropdown_menu.jsx | 12 +++++----- .../components/edited_timestamp/index.jsx | 4 ++-- .../glitch/components/error_boundary.jsx | 4 ++-- .../flavours/glitch/components/gifv.tsx | 3 ++- .../flavours/glitch/components/hashtag.jsx | 6 ++--- .../flavours/glitch/components/icon.tsx | 2 +- .../glitch/components/icon_button.tsx | 2 +- .../glitch/components/icon_with_badge.tsx | 2 +- .../glitch/components/inline_account.jsx | 4 ++-- .../intersection_observer_article.jsx | 6 ++--- .../flavours/glitch/components/link.jsx | 4 ++-- .../flavours/glitch/components/load_gap.jsx | 4 ++-- .../flavours/glitch/components/load_more.jsx | 4 ++-- .../glitch/components/load_pending.jsx | 4 ++-- .../glitch/components/loading_indicator.jsx | 1 - .../flavours/glitch/components/logo.jsx | 1 - .../glitch/components/media_attachments.jsx | 1 - .../glitch/components/media_gallery.jsx | 6 ++--- .../flavours/glitch/components/modal_root.jsx | 4 ++-- .../glitch/components/navigation_portal.jsx | 4 ++-- .../components/not_signed_in_indicator.tsx | 2 +- .../components/notification_purge_buttons.jsx | 1 - .../flavours/glitch/components/permalink.jsx | 4 ++-- .../picture_in_picture_placeholder.jsx | 4 ++-- .../flavours/glitch/components/poll.jsx | 1 - .../glitch/components/radio_button.tsx | 2 +- .../components/regeneration_indicator.jsx | 1 - .../glitch/components/relative_timestamp.tsx | 4 ++-- .../glitch/components/scrollable_list.jsx | 12 +++++----- .../glitch/components/server_banner.jsx | 4 ++-- .../glitch/components/server_hero_image.tsx | 3 ++- .../glitch/components/setting_text.jsx | 4 ++-- .../glitch/components/short_number.jsx | 4 ++-- .../flavours/glitch/components/skeleton.tsx | 2 +- .../flavours/glitch/components/status.jsx | 1 - .../glitch/components/status_action_bar.jsx | 1 - .../glitch/components/status_content.jsx | 6 ++--- .../glitch/components/status_header.jsx | 4 ++-- .../glitch/components/status_icons.jsx | 4 ++-- .../glitch/components/status_list.jsx | 1 - .../glitch/components/status_prepend.jsx | 4 ++-- .../components/status_visibility_icon.jsx | 1 - .../glitch/components/timeline_hint.tsx | 2 +- .../glitch/containers/account_container.jsx | 1 - .../glitch/containers/admin_component.jsx | 4 ++-- .../glitch/containers/compose_container.jsx | 4 ++-- .../glitch/containers/domain_container.jsx | 1 - .../flavours/glitch/containers/mastodon.jsx | 4 ++-- .../glitch/containers/media_container.jsx | 2 +- .../flavours/glitch/features/about/index.jsx | 6 ++--- .../account/components/account_note.jsx | 1 - .../account/components/action_bar.jsx | 4 ++-- .../account/components/featured_tags.jsx | 1 - .../components/follow_request_note.jsx | 1 - .../features/account/components/header.jsx | 6 ++--- .../components/profile_column_header.jsx | 4 ++-- .../glitch/features/account/navigation.jsx | 4 ++-- .../account_gallery/components/media_item.jsx | 1 - .../glitch/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 - .../flavours/glitch/features/audio/index.jsx | 4 ++-- .../flavours/glitch/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 - .../features/compose/components/dropdown.jsx | 4 ++-- .../compose/components/dropdown_menu.jsx | 8 +++---- .../components/emoji_picker_dropdown.jsx | 10 ++++---- .../features/compose/components/header.jsx | 1 - .../compose/components/language_dropdown.jsx | 6 ++--- .../compose/components/navigation_bar.jsx | 1 - .../features/compose/components/options.jsx | 6 ++--- .../features/compose/components/poll_form.jsx | 4 ++-- .../compose/components/privacy_dropdown.jsx | 4 ++-- .../features/compose/components/publisher.jsx | 1 - .../compose/components/reply_indicator.jsx | 1 - .../features/compose/components/search.jsx | 6 ++--- .../compose/components/search_results.jsx | 1 - .../compose/components/text_icon_button.jsx | 4 ++-- .../compose/components/textarea_icons.jsx | 1 - .../features/compose/components/upload.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 - .../glitch/features/compose/index.jsx | 4 ++-- .../components/column_settings.jsx | 4 ++-- .../components/conversation.jsx | 1 - .../components/conversations_list.jsx | 1 - .../glitch/features/direct_timeline/index.jsx | 4 ++-- .../directory/components/account_card.jsx | 1 - .../glitch/features/directory/index.jsx | 4 ++-- .../glitch/features/domain_blocks/index.jsx | 1 - .../features/explore/components/story.jsx | 8 +++---- .../glitch/features/explore/index.jsx | 4 ++-- .../glitch/features/explore/links.jsx | 4 ++-- .../glitch/features/explore/results.jsx | 8 +++---- .../glitch/features/explore/statuses.jsx | 4 ++-- .../glitch/features/explore/suggestions.jsx | 4 ++-- .../flavours/glitch/features/explore/tags.jsx | 4 ++-- .../features/favourited_statuses/index.jsx | 1 - .../glitch/features/favourites/index.jsx | 1 - .../features/filters/added_to_filter.jsx | 16 ++++++------- .../glitch/features/filters/select_filter.jsx | 8 +++---- .../components/account.jsx | 1 - .../features/follow_recommendations/index.jsx | 6 ++--- .../components/account_authorize.jsx | 1 - .../glitch/features/follow_requests/index.jsx | 1 - .../glitch/features/followed_tags/index.jsx | 1 - .../glitch/features/followers/index.jsx | 1 - .../glitch/features/following/index.jsx | 1 - .../components/announcements.jsx | 4 ++-- .../getting_started/components/trends.jsx | 1 - .../glitch/features/getting_started/index.jsx | 6 ++--- .../features/getting_started_misc/index.jsx | 1 - .../components/column_settings.jsx | 4 ++-- .../features/hashtag_timeline/index.jsx | 4 ++-- .../components/column_settings.jsx | 4 ++-- .../glitch/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 - .../glitch/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 ++-- .../glitch/features/list_editor/index.jsx | 1 - .../glitch/features/list_timeline/index.jsx | 4 ++-- .../lists/components/new_list_form.jsx | 4 ++-- .../flavours/glitch/features/lists/index.jsx | 1 - .../glitch/features/local_settings/index.jsx | 4 ++-- .../local_settings/navigation/index.jsx | 4 ++-- .../local_settings/navigation/item/index.jsx | 4 ++-- .../page/deprecated_item/index.jsx | 4 ++-- .../features/local_settings/page/index.jsx | 4 ++-- .../local_settings/page/item/index.jsx | 4 ++-- .../flavours/glitch/features/mutes/index.jsx | 1 - .../notifications/components/admin_report.jsx | 1 - .../notifications/components/admin_signup.jsx | 1 - .../components/clear_column_button.jsx | 4 ++-- .../components/column_settings.jsx | 4 ++-- .../notifications/components/filter_bar.jsx | 4 ++-- .../notifications/components/follow.jsx | 1 - .../components/follow_request.jsx | 2 +- .../components/grant_permission_button.jsx | 4 ++-- .../notifications/components/notification.jsx | 1 - .../notifications_permission_banner.jsx | 4 ++-- .../notifications/components/overlay.jsx | 1 - .../components/pill_bar_button.jsx | 4 ++-- .../notifications/components/report.jsx | 2 +- .../components/setting_toggle.jsx | 4 ++-- .../glitch/features/notifications/index.jsx | 4 ++-- .../picture_in_picture/components/footer.jsx | 1 - .../picture_in_picture/components/header.jsx | 1 - .../features/picture_in_picture/index.jsx | 4 ++-- .../features/pinned_accounts_editor/index.jsx | 1 - .../glitch/features/pinned_statuses/index.jsx | 1 - .../glitch/features/privacy_policy/index.jsx | 4 ++-- .../components/column_settings.jsx | 4 ++-- .../glitch/features/public_timeline/index.jsx | 4 ++-- .../glitch/features/reblogs/index.jsx | 1 - .../glitch/features/report/category.jsx | 8 +++---- .../glitch/features/report/comment.jsx | 12 +++++----- .../features/report/components/option.jsx | 4 ++-- .../report/components/status_check_box.jsx | 4 ++-- .../flavours/glitch/features/report/rules.jsx | 8 +++---- .../glitch/features/report/statuses.jsx | 8 +++---- .../glitch/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 +++++++++---------- .../flavours/glitch/features/status/index.jsx | 1 - .../subscribed_languages_modal/index.jsx | 1 - .../features/ui/components/actions_modal.jsx | 6 ++--- .../features/ui/components/audio_modal.jsx | 1 - .../features/ui/components/block_modal.jsx | 4 ++-- .../features/ui/components/boost_modal.jsx | 1 - .../glitch/features/ui/components/bundle.jsx | 4 ++-- .../ui/components/bundle_column_error.jsx | 8 +++---- .../ui/components/bundle_modal_error.jsx | 4 ++-- .../glitch/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 ++-- .../components/deprecated_settings_modal.jsx | 4 ++-- .../ui/components/disabled_account_banner.jsx | 4 ++-- .../features/ui/components/doodle_modal.jsx | 1 - .../features/ui/components/drawer_loading.jsx | 2 -- .../features/ui/components/embed_modal.jsx | 1 - .../ui/components/favourite_modal.jsx | 1 - .../features/ui/components/filter_modal.jsx | 1 - .../ui/components/focal_point_modal.jsx | 8 +++---- .../follow_requests_column_link.jsx | 4 ++-- .../glitch/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 +++++----- .../ui/components/onboarding_modal.jsx | 4 ++-- .../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 +++---- .../flavours/glitch/features/ui/index.jsx | 6 ++--- .../features/ui/util/react_router_helpers.jsx | 2 +- .../features/ui/util/reduced_motion.jsx | 4 ++-- .../flavours/glitch/features/video/index.jsx | 4 ++-- app/javascript/flavours/glitch/main.jsx | 1 - .../flavours/glitch/packs/admin.jsx | 1 - .../flavours/glitch/packs/public.jsx | 1 - .../flavours/glitch/packs/share.jsx | 1 - .../flavours/glitch/utils/icons.jsx | 4 ---- app/javascript/packs/admin.jsx | 1 - app/javascript/packs/public.jsx | 1 - app/javascript/packs/share.jsx | 1 - 263 files changed, 403 insertions(+), 502 deletions(-) diff --git a/app/javascript/flavours/glitch/components/account.jsx b/app/javascript/flavours/glitch/components/account.jsx index 35f83beab1..12758d2351 100644 --- a/app/javascript/flavours/glitch/components/account.jsx +++ b/app/javascript/flavours/glitch/components/account.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 { Avatar } from './avatar'; diff --git a/app/javascript/flavours/glitch/components/admin/Counter.jsx b/app/javascript/flavours/glitch/components/admin/Counter.jsx index 9c0b848d0b..9c0a958096 100644 --- a/app/javascript/flavours/glitch/components/admin/Counter.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/components/admin/Dimension.jsx b/app/javascript/flavours/glitch/components/admin/Dimension.jsx index 8b8466ee78..740a523df0 100644 --- a/app/javascript/flavours/glitch/components/admin/Dimension.jsx +++ b/app/javascript/flavours/glitch/components/admin/Dimension.jsx @@ -1,11 +1,11 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import api from 'flavours/glitch/api'; import { FormattedNumber } from 'react-intl'; import { roundTo10 } from 'flavours/glitch/utils/numbers'; import { Skeleton } from 'flavours/glitch/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/flavours/glitch/components/admin/ReportReasonSelector.jsx b/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.jsx index ecefe7a840..23e977baec 100644 --- a/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.jsx +++ b/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import api from 'flavours/glitch/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/flavours/glitch/components/admin/Retention.jsx b/app/javascript/flavours/glitch/components/admin/Retention.jsx index e1ba3f6c9d..543ba70e76 100644 --- a/app/javascript/flavours/glitch/components/admin/Retention.jsx +++ b/app/javascript/flavours/glitch/components/admin/Retention.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import api from 'flavours/glitch/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/flavours/glitch/components/admin/Trends.jsx b/app/javascript/flavours/glitch/components/admin/Trends.jsx index 774bf36e6e..f5fb1aef2b 100644 --- a/app/javascript/flavours/glitch/components/admin/Trends.jsx +++ b/app/javascript/flavours/glitch/components/admin/Trends.jsx @@ -1,11 +1,11 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import api from 'flavours/glitch/api'; import { FormattedMessage } from 'react-intl'; import classNames from 'classnames'; import Hashtag from 'flavours/glitch/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/flavours/glitch/components/animated_number.tsx b/app/javascript/flavours/glitch/components/animated_number.tsx index b6b073161b..81e0af395b 100644 --- a/app/javascript/flavours/glitch/components/animated_number.tsx +++ b/app/javascript/flavours/glitch/components/animated_number.tsx @@ -1,4 +1,5 @@ -import React, { useCallback, useState } from 'react'; +import { useCallback, useState } from 'react'; +import * as React from 'react'; import { TransitionMotion, spring } from 'react-motion'; diff --git a/app/javascript/flavours/glitch/components/attachment_list.jsx b/app/javascript/flavours/glitch/components/attachment_list.jsx index 92ba98126a..ed558acce2 100644 --- a/app/javascript/flavours/glitch/components/attachment_list.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/components/autosuggest_emoji.jsx b/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx index 83fafbd10d..3442889ec6 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx +++ b/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx @@ -1,10 +1,10 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import unicodeMapping from 'flavours/glitch/features/emoji/emoji_unicode_mapping_light'; import { assetHost } from 'flavours/glitch/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/flavours/glitch/components/autosuggest_hashtag.jsx b/app/javascript/flavours/glitch/components/autosuggest_hashtag.jsx index d787ed07ad..3406286772 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_hashtag.jsx +++ b/app/javascript/flavours/glitch/components/autosuggest_hashtag.jsx @@ -1,9 +1,9 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import ShortNumber from 'flavours/glitch/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/flavours/glitch/components/autosuggest_input.jsx b/app/javascript/flavours/glitch/components/autosuggest_input.jsx index 9e74590e60..743585f31d 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_input.jsx +++ b/app/javascript/flavours/glitch/components/autosuggest_input.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import AutosuggestAccountContainer from 'flavours/glitch/features/compose/containers/autosuggest_account_container'; import AutosuggestEmoji from './autosuggest_emoji'; import AutosuggestHashtag from './autosuggest_hashtag'; diff --git a/app/javascript/flavours/glitch/components/autosuggest_textarea.jsx b/app/javascript/flavours/glitch/components/autosuggest_textarea.jsx index fc763146eb..7c38b64340 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_textarea.jsx +++ b/app/javascript/flavours/glitch/components/autosuggest_textarea.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import AutosuggestAccountContainer from 'flavours/glitch/features/compose/containers/autosuggest_account_container'; import AutosuggestEmoji from './autosuggest_emoji'; import AutosuggestHashtag from './autosuggest_hashtag'; diff --git a/app/javascript/flavours/glitch/components/avatar_composite.jsx b/app/javascript/flavours/glitch/components/avatar_composite.jsx index 1c23a8b36e..2c80792276 100644 --- a/app/javascript/flavours/glitch/components/avatar_composite.jsx +++ b/app/javascript/flavours/glitch/components/avatar_composite.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 { autoPlayGif } from 'flavours/glitch/initial_state'; -export default class AvatarComposite extends React.PureComponent { +export default class AvatarComposite extends PureComponent { static propTypes = { accounts: ImmutablePropTypes.list.isRequired, diff --git a/app/javascript/flavours/glitch/components/avatar_overlay.jsx b/app/javascript/flavours/glitch/components/avatar_overlay.jsx index 01dec587a5..a37b8f586b 100644 --- a/app/javascript/flavours/glitch/components/avatar_overlay.jsx +++ b/app/javascript/flavours/glitch/components/avatar_overlay.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 { autoPlayGif } from 'flavours/glitch/initial_state'; -export default class AvatarOverlay extends React.PureComponent { +export default class AvatarOverlay extends PureComponent { static propTypes = { account: ImmutablePropTypes.map.isRequired, diff --git a/app/javascript/flavours/glitch/components/blurhash.tsx b/app/javascript/flavours/glitch/components/blurhash.tsx index 1550d0b7a5..d98e7d35db 100644 --- a/app/javascript/flavours/glitch/components/blurhash.tsx +++ b/app/javascript/flavours/glitch/components/blurhash.tsx @@ -1,4 +1,5 @@ -import React, { useRef, useEffect } from 'react'; +import { useRef, useEffect } from 'react'; +import * as React from 'react'; import { decode } from 'blurhash'; diff --git a/app/javascript/flavours/glitch/components/button.jsx b/app/javascript/flavours/glitch/components/button.jsx index 40b8f5a159..9529f4884c 100644 --- a/app/javascript/flavours/glitch/components/button.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/components/check.jsx b/app/javascript/flavours/glitch/components/check.jsx index ee2ef1595a..d818480b7b 100644 --- a/app/javascript/flavours/glitch/components/check.jsx +++ b/app/javascript/flavours/glitch/components/check.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - const Check = () => ( diff --git a/app/javascript/flavours/glitch/components/column.jsx b/app/javascript/flavours/glitch/components/column.jsx index fce6a6c408..0eb7ede5f2 100644 --- a/app/javascript/flavours/glitch/components/column.jsx +++ b/app/javascript/flavours/glitch/components/column.jsx @@ -1,11 +1,11 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { supportsPassiveEvents } from 'detect-passive-events'; import { scrollTop } from '../scroll'; const listenerOptions = supportsPassiveEvents ? { passive: true } : false; -export default class Column extends React.PureComponent { +export default class Column extends PureComponent { static propTypes = { children: PropTypes.node, diff --git a/app/javascript/flavours/glitch/components/column_back_button.jsx b/app/javascript/flavours/glitch/components/column_back_button.jsx index 003d37671a..d3aca49ea0 100644 --- a/app/javascript/flavours/glitch/components/column_back_button.jsx +++ b/app/javascript/flavours/glitch/components/column_back_button.jsx @@ -1,10 +1,10 @@ -import React from 'react'; +import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; import { Icon } from 'flavours/glitch/components/icon'; import { createPortal } from 'react-dom'; -export default class ColumnBackButton extends React.PureComponent { +export default class ColumnBackButton extends PureComponent { static contextTypes = { router: PropTypes.object, diff --git a/app/javascript/flavours/glitch/components/column_back_button_slim.jsx b/app/javascript/flavours/glitch/components/column_back_button_slim.jsx index 6fb800640c..ce0cd4cb4e 100644 --- a/app/javascript/flavours/glitch/components/column_back_button_slim.jsx +++ b/app/javascript/flavours/glitch/components/column_back_button_slim.jsx @@ -1,9 +1,9 @@ -import React from 'react'; +import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; import { Icon } from 'flavours/glitch/components/icon'; -export default class ColumnBackButtonSlim extends React.PureComponent { +export default class ColumnBackButtonSlim extends PureComponent { static contextTypes = { router: PropTypes.object, diff --git a/app/javascript/flavours/glitch/components/column_header.jsx b/app/javascript/flavours/glitch/components/column_header.jsx index c4b6e92474..3e8ff8b8c8 100644 --- a/app/javascript/flavours/glitch/components/column_header.jsx +++ b/app/javascript/flavours/glitch/components/column_header.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { createPortal } from 'react-dom'; import classNames from 'classnames'; @@ -12,7 +12,7 @@ const messages = defineMessages({ moveRight: { id: 'column_header.moveRight_settings', defaultMessage: 'Move column to the right' }, }); -class ColumnHeader extends React.PureComponent { +class ColumnHeader extends PureComponent { static contextTypes = { router: PropTypes.object, diff --git a/app/javascript/flavours/glitch/components/common_counter.jsx b/app/javascript/flavours/glitch/components/common_counter.jsx index 9964be5166..23e1f22638 100644 --- a/app/javascript/flavours/glitch/components/common_counter.jsx +++ b/app/javascript/flavours/glitch/components/common_counter.jsx @@ -1,5 +1,4 @@ // @ts-check -import React from 'react'; import { FormattedMessage } from 'react-intl'; /** diff --git a/app/javascript/flavours/glitch/components/dismissable_banner.jsx b/app/javascript/flavours/glitch/components/dismissable_banner.jsx index 2aed19b88f..d33a3ca98a 100644 --- a/app/javascript/flavours/glitch/components/dismissable_banner.jsx +++ b/app/javascript/flavours/glitch/components/dismissable_banner.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { PureComponent } from 'react'; import { IconButton } from './icon_button'; import PropTypes from 'prop-types'; import { injectIntl, defineMessages } from 'react-intl'; @@ -8,7 +8,7 @@ const messages = defineMessages({ dismiss: { id: 'dismissable_banner.dismiss', defaultMessage: 'Dismiss' }, }); -class DismissableBanner extends React.PureComponent { +class DismissableBanner extends PureComponent { static propTypes = { id: PropTypes.string.isRequired, diff --git a/app/javascript/flavours/glitch/components/domain.tsx b/app/javascript/flavours/glitch/components/domain.tsx index 9e8e04b65c..d61e4074ee 100644 --- a/app/javascript/flavours/glitch/components/domain.tsx +++ b/app/javascript/flavours/glitch/components/domain.tsx @@ -1,4 +1,5 @@ -import React, { useCallback } from 'react'; +import { useCallback } from 'react'; +import * as React from 'react'; import type { InjectedIntl } from 'react-intl'; import { defineMessages, injectIntl } from 'react-intl'; diff --git a/app/javascript/flavours/glitch/components/dropdown_menu.jsx b/app/javascript/flavours/glitch/components/dropdown_menu.jsx index 901c7fe22f..45ed2561c0 100644 --- a/app/javascript/flavours/glitch/components/dropdown_menu.jsx +++ b/app/javascript/flavours/glitch/components/dropdown_menu.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { PureComponent, cloneElement, Children, Fragment } from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { IconButton } from './icon_button'; @@ -10,7 +10,7 @@ import { CircularProgress } from 'flavours/glitch/components/loading_indicator'; const listenerOptions = supportsPassiveEvents ? { passive: true, capture: true } : true; let id = 0; -class DropdownMenu extends React.PureComponent { +class DropdownMenu extends PureComponent { static contextTypes = { router: PropTypes.object, @@ -155,7 +155,7 @@ class DropdownMenu extends React.PureComponent { } -export default class Dropdown extends React.PureComponent { +export default class Dropdown extends PureComponent { static contextTypes = { router: PropTypes.object, @@ -286,7 +286,7 @@ export default class Dropdown extends React.PureComponent { const open = this.state.id === openDropdownId; - const button = children ? React.cloneElement(React.Children.only(children), { + const button = children ? cloneElement(Children.only(children), { onClick: this.handleClick, onMouseDown: this.handleMouseDown, onKeyDown: this.handleButtonKeyDown, @@ -306,7 +306,7 @@ export default class Dropdown extends React.PureComponent { ); return ( - + {button} @@ -329,7 +329,7 @@ export default class Dropdown extends React.PureComponent { )} - + ); } diff --git a/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx b/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx index 5315b812fc..c823c76a53 100644 --- a/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/components/error_boundary.jsx b/app/javascript/flavours/glitch/components/error_boundary.jsx index 234a53417f..9475d2041b 100644 --- a/app/javascript/flavours/glitch/components/error_boundary.jsx +++ b/app/javascript/flavours/glitch/components/error_boundary.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { source_url } from 'flavours/glitch/initial_state'; @@ -6,7 +6,7 @@ import { preferencesLink } from 'flavours/glitch/utils/backend_links'; 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/flavours/glitch/components/gifv.tsx b/app/javascript/flavours/glitch/components/gifv.tsx index c606a29048..c9b9de29b6 100644 --- a/app/javascript/flavours/glitch/components/gifv.tsx +++ b/app/javascript/flavours/glitch/components/gifv.tsx @@ -1,4 +1,5 @@ -import React, { useCallback, useState } from 'react'; +import { useCallback, useState } from 'react'; +import * as React from 'react'; interface Props { src: string; diff --git a/app/javascript/flavours/glitch/components/hashtag.jsx b/app/javascript/flavours/glitch/components/hashtag.jsx index ced250b79a..0cd7953e49 100644 --- a/app/javascript/flavours/glitch/components/hashtag.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/components/short_number'; import { Skeleton } from 'flavours/glitch/components/skeleton'; import classNames from 'classnames'; -class SilentErrorBoundary extends React.Component { +class SilentErrorBoundary extends Component { static propTypes = { children: PropTypes.node, @@ -70,7 +70,7 @@ const Hashtag = ({ name, href, to, people, uses, history, className, description
- {name ? #{name} : } + {name ? #{name} : } {description ? ( diff --git a/app/javascript/flavours/glitch/components/icon.tsx b/app/javascript/flavours/glitch/components/icon.tsx index 6bd15da6ac..765aa89aec 100644 --- a/app/javascript/flavours/glitch/components/icon.tsx +++ b/app/javascript/flavours/glitch/components/icon.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import classNames from 'classnames'; diff --git a/app/javascript/flavours/glitch/components/icon_button.tsx b/app/javascript/flavours/glitch/components/icon_button.tsx index 0b81288241..8b7aa104c2 100644 --- a/app/javascript/flavours/glitch/components/icon_button.tsx +++ b/app/javascript/flavours/glitch/components/icon_button.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import classNames from 'classnames'; diff --git a/app/javascript/flavours/glitch/components/icon_with_badge.tsx b/app/javascript/flavours/glitch/components/icon_with_badge.tsx index e427b7172b..319c0b2389 100644 --- a/app/javascript/flavours/glitch/components/icon_with_badge.tsx +++ b/app/javascript/flavours/glitch/components/icon_with_badge.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { Icon } from './icon'; diff --git a/app/javascript/flavours/glitch/components/inline_account.jsx b/app/javascript/flavours/glitch/components/inline_account.jsx index eeb58b5533..911b6f2936 100644 --- a/app/javascript/flavours/glitch/components/inline_account.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/components/intersection_observer_article.jsx b/app/javascript/flavours/glitch/components/intersection_observer_article.jsx index 6c00e557d0..d31a24cad0 100644 --- a/app/javascript/flavours/glitch/components/intersection_observer_article.jsx +++ b/app/javascript/flavours/glitch/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, @@ -123,7 +123,7 @@ export default class IntersectionObserverArticle extends React.Component { tabIndex={0} style={style} > - {children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })} + {children && cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })} ); } diff --git a/app/javascript/flavours/glitch/components/link.jsx b/app/javascript/flavours/glitch/components/link.jsx index bbec121a86..f17a38b419 100644 --- a/app/javascript/flavours/glitch/components/link.jsx +++ b/app/javascript/flavours/glitch/components/link.jsx @@ -4,7 +4,7 @@ // Package imports. import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; // Utils. import { assignHandlers } from 'flavours/glitch/utils/react_helpers'; @@ -25,7 +25,7 @@ const handlers = { }; // The component. -export default class Link extends React.PureComponent { +export default class Link extends PureComponent { // Constructor. constructor (props) { diff --git a/app/javascript/flavours/glitch/components/load_gap.jsx b/app/javascript/flavours/glitch/components/load_gap.jsx index 9c81df6323..7e0f28243d 100644 --- a/app/javascript/flavours/glitch/components/load_gap.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/components/load_more.jsx b/app/javascript/flavours/glitch/components/load_more.jsx index ab9428e35a..ca834b71ee 100644 --- a/app/javascript/flavours/glitch/components/load_more.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/components/load_pending.jsx b/app/javascript/flavours/glitch/components/load_pending.jsx index a75259146a..d05e6b1dc9 100644 --- a/app/javascript/flavours/glitch/components/load_pending.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/components/loading_indicator.jsx b/app/javascript/flavours/glitch/components/loading_indicator.jsx index 59f721c50f..708b71d0f0 100644 --- a/app/javascript/flavours/glitch/components/loading_indicator.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/components/logo.jsx b/app/javascript/flavours/glitch/components/logo.jsx index 60e8f40b23..16ca9f80fd 100644 --- a/app/javascript/flavours/glitch/components/logo.jsx +++ b/app/javascript/flavours/glitch/components/logo.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import logo from 'mastodon/../images/logo.svg'; export const WordmarkLogo = () => ( diff --git a/app/javascript/flavours/glitch/components/media_attachments.jsx b/app/javascript/flavours/glitch/components/media_attachments.jsx index b11d3526f9..96a67e6617 100644 --- a/app/javascript/flavours/glitch/components/media_attachments.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/components/media_gallery.jsx b/app/javascript/flavours/glitch/components/media_gallery.jsx index 33ddb8a29c..0361a8470b 100644 --- a/app/javascript/flavours/glitch/components/media_gallery.jsx +++ b/app/javascript/flavours/glitch/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'; @@ -32,7 +32,7 @@ const messages = defineMessages({ }, }); -class Item extends React.PureComponent { +class Item extends PureComponent { static propTypes = { attachment: ImmutablePropTypes.map.isRequired, @@ -217,7 +217,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/flavours/glitch/components/modal_root.jsx b/app/javascript/flavours/glitch/components/modal_root.jsx index f08542e7fc..4df7afc1c4 100644 --- a/app/javascript/flavours/glitch/components/modal_root.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/components/navigation_portal.jsx b/app/javascript/flavours/glitch/components/navigation_portal.jsx index 9e84941793..8995c7e657 100644 --- a/app/javascript/flavours/glitch/components/navigation_portal.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/initial_state'; import Trends from 'flavours/glitch/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/flavours/glitch/components/not_signed_in_indicator.tsx b/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx index ce94c5d873..d0eedc6412 100644 --- a/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx +++ b/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { FormattedMessage } from 'react-intl'; diff --git a/app/javascript/flavours/glitch/components/notification_purge_buttons.jsx b/app/javascript/flavours/glitch/components/notification_purge_buttons.jsx index 532eb4358c..02e0603ac0 100644 --- a/app/javascript/flavours/glitch/components/notification_purge_buttons.jsx +++ b/app/javascript/flavours/glitch/components/notification_purge_buttons.jsx @@ -6,7 +6,6 @@ // Package imports // -import React from 'react'; import PropTypes from 'prop-types'; import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/flavours/glitch/components/permalink.jsx b/app/javascript/flavours/glitch/components/permalink.jsx index 1c58431836..2209c4c9aa 100644 --- a/app/javascript/flavours/glitch/components/permalink.jsx +++ b/app/javascript/flavours/glitch/components/permalink.jsx @@ -1,7 +1,7 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; -export default class Permalink extends React.PureComponent { +export default class Permalink extends PureComponent { static contextTypes = { router: PropTypes.object, diff --git a/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx b/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx index e8c9611a34..b796b01f27 100644 --- a/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/components/icon'; import { removePictureInPicture } from 'flavours/glitch/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/flavours/glitch/components/poll.jsx b/app/javascript/flavours/glitch/components/poll.jsx index df23919563..3a9c987b8c 100644 --- a/app/javascript/flavours/glitch/components/poll.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/components/radio_button.tsx b/app/javascript/flavours/glitch/components/radio_button.tsx index 67acb09f42..fbd7859d80 100644 --- a/app/javascript/flavours/glitch/components/radio_button.tsx +++ b/app/javascript/flavours/glitch/components/radio_button.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import classNames from 'classnames'; diff --git a/app/javascript/flavours/glitch/components/regeneration_indicator.jsx b/app/javascript/flavours/glitch/components/regeneration_indicator.jsx index 68ce09df9b..a28587fb25 100644 --- a/app/javascript/flavours/glitch/components/regeneration_indicator.jsx +++ b/app/javascript/flavours/glitch/components/regeneration_indicator.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { FormattedMessage } from 'react-intl'; import illustration from 'flavours/glitch/images/elephant_ui_working.svg'; diff --git a/app/javascript/flavours/glitch/components/relative_timestamp.tsx b/app/javascript/flavours/glitch/components/relative_timestamp.tsx index e0e0d4bb53..aaa424dca6 100644 --- a/app/javascript/flavours/glitch/components/relative_timestamp.tsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/components/scrollable_list.jsx b/app/javascript/flavours/glitch/components/scrollable_list.jsx index 69925321bd..7293eb3904 100644 --- a/app/javascript/flavours/glitch/components/scrollable_list.jsx +++ b/app/javascript/flavours/glitch/components/scrollable_list.jsx @@ -1,4 +1,4 @@ -import React, { PureComponent } from 'react'; +import { Children, cloneElement, PureComponent } from 'react'; import ScrollContainer from 'flavours/glitch/containers/scroll_container'; import PropTypes from 'prop-types'; import IntersectionObserverArticleContainer from 'flavours/glitch/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/flavours/glitch/components/server_banner.jsx b/app/javascript/flavours/glitch/components/server_banner.jsx index 25ec405603..1b55b31408 100644 --- a/app/javascript/flavours/glitch/components/server_banner.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/components/server_hero_image.tsx b/app/javascript/flavours/glitch/components/server_hero_image.tsx index 973d1d1b37..be05059e49 100644 --- a/app/javascript/flavours/glitch/components/server_hero_image.tsx +++ b/app/javascript/flavours/glitch/components/server_hero_image.tsx @@ -1,4 +1,5 @@ -import React, { useCallback, useState } from 'react'; +import { useCallback, useState } from 'react'; +import * as React from 'react'; import classNames from 'classnames'; diff --git a/app/javascript/flavours/glitch/components/setting_text.jsx b/app/javascript/flavours/glitch/components/setting_text.jsx index 3a21a06018..11427f2d65 100644 --- a/app/javascript/flavours/glitch/components/setting_text.jsx +++ b/app/javascript/flavours/glitch/components/setting_text.jsx @@ -1,8 +1,8 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; -export default class SettingText extends React.PureComponent { +export default class SettingText extends PureComponent { static propTypes = { settings: ImmutablePropTypes.map.isRequired, diff --git a/app/javascript/flavours/glitch/components/short_number.jsx b/app/javascript/flavours/glitch/components/short_number.jsx index 0c40941c0d..550ed7d0ac 100644 --- a/app/javascript/flavours/glitch/components/short_number.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/components/skeleton.tsx b/app/javascript/flavours/glitch/components/skeleton.tsx index 8d43e6827d..30ff0d8525 100644 --- a/app/javascript/flavours/glitch/components/skeleton.tsx +++ b/app/javascript/flavours/glitch/components/skeleton.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; interface Props { width?: number | string; diff --git a/app/javascript/flavours/glitch/components/status.jsx b/app/javascript/flavours/glitch/components/status.jsx index 441936a431..69e5204d92 100644 --- a/app/javascript/flavours/glitch/components/status.jsx +++ b/app/javascript/flavours/glitch/components/status.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import StatusPrepend from './status_prepend'; diff --git a/app/javascript/flavours/glitch/components/status_action_bar.jsx b/app/javascript/flavours/glitch/components/status_action_bar.jsx index 20f6dd800a..b7c928175d 100644 --- a/app/javascript/flavours/glitch/components/status_action_bar.jsx +++ b/app/javascript/flavours/glitch/components/status_action_bar.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import { IconButton } from './icon_button'; diff --git a/app/javascript/flavours/glitch/components/status_content.jsx b/app/javascript/flavours/glitch/components/status_content.jsx index 3fefef2c93..440ee367db 100644 --- a/app/javascript/flavours/glitch/components/status_content.jsx +++ b/app/javascript/flavours/glitch/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'; @@ -63,7 +63,7 @@ const isLinkMisleading = (link) => { return !(textMatchesTarget(text, origin, host) || textMatchesTarget(text.toLowerCase(), origin, host)); }; -class TranslateButton extends React.PureComponent { +class TranslateButton extends PureComponent { static propTypes = { translation: ImmutablePropTypes.map, @@ -104,7 +104,7 @@ const mapStateToProps = state => ({ languages: state.getIn(['server', 'translationLanguages', 'items']), }); -class StatusContent extends React.PureComponent { +class StatusContent extends PureComponent { static contextTypes = { identity: PropTypes.object, diff --git a/app/javascript/flavours/glitch/components/status_header.jsx b/app/javascript/flavours/glitch/components/status_header.jsx index 8f54613579..176f2c6477 100644 --- a/app/javascript/flavours/glitch/components/status_header.jsx +++ b/app/javascript/flavours/glitch/components/status_header.jsx @@ -1,5 +1,5 @@ // Package imports. -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; @@ -8,7 +8,7 @@ import { Avatar } from './avatar'; import AvatarOverlay from './avatar_overlay'; import { DisplayName } from './display_name'; -export default class StatusHeader extends React.PureComponent { +export default class StatusHeader extends PureComponent { static propTypes = { status: ImmutablePropTypes.map.isRequired, diff --git a/app/javascript/flavours/glitch/components/status_icons.jsx b/app/javascript/flavours/glitch/components/status_icons.jsx index 59912d4391..60f1732636 100644 --- a/app/javascript/flavours/glitch/components/status_icons.jsx +++ b/app/javascript/flavours/glitch/components/status_icons.jsx @@ -1,5 +1,5 @@ // Package imports. -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { defineMessages, injectIntl } from 'react-intl'; @@ -40,7 +40,7 @@ LanguageIcon.propTypes = { language: PropTypes.string.isRequired, }; -class StatusIcons extends React.PureComponent { +class StatusIcons extends PureComponent { static propTypes = { status: ImmutablePropTypes.map.isRequired, diff --git a/app/javascript/flavours/glitch/components/status_list.jsx b/app/javascript/flavours/glitch/components/status_list.jsx index a225883a82..ef628dbc73 100644 --- a/app/javascript/flavours/glitch/components/status_list.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/containers/status_container'; diff --git a/app/javascript/flavours/glitch/components/status_prepend.jsx b/app/javascript/flavours/glitch/components/status_prepend.jsx index 127636c51d..401b8ed127 100644 --- a/app/javascript/flavours/glitch/components/status_prepend.jsx +++ b/app/javascript/flavours/glitch/components/status_prepend.jsx @@ -1,12 +1,12 @@ // Package imports // -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { FormattedMessage } from 'react-intl'; import { Icon } from 'flavours/glitch/components/icon'; import { me } from 'flavours/glitch/initial_state'; -export default class StatusPrepend extends React.PureComponent { +export default class StatusPrepend extends PureComponent { static propTypes = { type: PropTypes.string.isRequired, diff --git a/app/javascript/flavours/glitch/components/status_visibility_icon.jsx b/app/javascript/flavours/glitch/components/status_visibility_icon.jsx index cee56a2391..d68d245470 100644 --- a/app/javascript/flavours/glitch/components/status_visibility_icon.jsx +++ b/app/javascript/flavours/glitch/components/status_visibility_icon.jsx @@ -1,5 +1,4 @@ // Package imports // -import React from 'react'; import PropTypes from 'prop-types'; import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/flavours/glitch/components/timeline_hint.tsx b/app/javascript/flavours/glitch/components/timeline_hint.tsx index 712b4c293b..df7787bf67 100644 --- a/app/javascript/flavours/glitch/components/timeline_hint.tsx +++ b/app/javascript/flavours/glitch/components/timeline_hint.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { FormattedMessage } from 'react-intl'; diff --git a/app/javascript/flavours/glitch/containers/account_container.jsx b/app/javascript/flavours/glitch/containers/account_container.jsx index 5b57d730f0..53604d8de7 100644 --- a/app/javascript/flavours/glitch/containers/account_container.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/selectors'; diff --git a/app/javascript/flavours/glitch/containers/admin_component.jsx b/app/javascript/flavours/glitch/containers/admin_component.jsx index 64dabac8ba..00c0efe3d7 100644 --- a/app/javascript/flavours/glitch/containers/admin_component.jsx +++ b/app/javascript/flavours/glitch/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 'mastodon/locales'; @@ -6,7 +6,7 @@ import { getLocale } from 'mastodon/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/flavours/glitch/containers/compose_container.jsx b/app/javascript/flavours/glitch/containers/compose_container.jsx index 9b84ed583d..8926c2724b 100644 --- a/app/javascript/flavours/glitch/containers/compose_container.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/containers/domain_container.jsx b/app/javascript/flavours/glitch/containers/domain_container.jsx index 419d5d29f5..bc2a448494 100644 --- a/app/javascript/flavours/glitch/containers/domain_container.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/containers/mastodon.jsx b/app/javascript/flavours/glitch/containers/mastodon.jsx index 1044fdd160..a9d0256e42 100644 --- a/app/javascript/flavours/glitch/containers/mastodon.jsx +++ b/app/javascript/flavours/glitch/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'; @@ -38,7 +38,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/flavours/glitch/containers/media_container.jsx b/app/javascript/flavours/glitch/containers/media_container.jsx index 99e1ed55c3..4378f93ad1 100644 --- a/app/javascript/flavours/glitch/containers/media_container.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/about/index.jsx b/app/javascript/flavours/glitch/features/about/index.jsx index 8b65d95716..d267056863 100644 --- a/app/javascript/flavours/glitch/features/about/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/account/components/account_note.jsx b/app/javascript/flavours/glitch/features/account/components/account_note.jsx index a548db2699..0962b99e3e 100644 --- a/app/javascript/flavours/glitch/features/account/components/account_note.jsx +++ b/app/javascript/flavours/glitch/features/account/components/account_note.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; diff --git a/app/javascript/flavours/glitch/features/account/components/action_bar.jsx b/app/javascript/flavours/glitch/features/account/components/action_bar.jsx index 60ac06f910..8cdcd745fc 100644 --- a/app/javascript/flavours/glitch/features/account/components/action_bar.jsx +++ b/app/javascript/flavours/glitch/features/account/components/action_bar.jsx @@ -1,10 +1,10 @@ -import React from 'react'; +import { PureComponent } from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { NavLink } from 'react-router-dom'; import { FormattedMessage, FormattedNumber } from 'react-intl'; import { Icon } from 'flavours/glitch/components/icon'; -class ActionBar extends React.PureComponent { +class ActionBar extends PureComponent { static propTypes = { account: ImmutablePropTypes.map.isRequired, diff --git a/app/javascript/flavours/glitch/features/account/components/featured_tags.jsx b/app/javascript/flavours/glitch/features/account/components/featured_tags.jsx index 42e0a8d2f7..51d74e18d2 100644 --- a/app/javascript/flavours/glitch/features/account/components/featured_tags.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/account/components/follow_request_note.jsx b/app/javascript/flavours/glitch/features/account/components/follow_request_note.jsx index 5c2940b749..0d880355bf 100644 --- a/app/javascript/flavours/glitch/features/account/components/follow_request_note.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/account/components/header.jsx b/app/javascript/flavours/glitch/features/account/components/header.jsx index a447750c2d..a1bdfeb5d4 100644 --- a/app/javascript/flavours/glitch/features/account/components/header.jsx +++ b/app/javascript/flavours/glitch/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'; @@ -345,10 +345,10 @@ class Header extends ImmutablePureComponent { {!suspended && (
{!hidden && ( - + {actionBtn} {bellBtn} - + )} diff --git a/app/javascript/flavours/glitch/features/account/components/profile_column_header.jsx b/app/javascript/flavours/glitch/features/account/components/profile_column_header.jsx index 62a459fffb..5ba1166169 100644 --- a/app/javascript/flavours/glitch/features/account/components/profile_column_header.jsx +++ b/app/javascript/flavours/glitch/features/account/components/profile_column_header.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import ColumnHeader from '../../../components/column_header'; import { injectIntl, defineMessages } from 'react-intl'; @@ -7,7 +7,7 @@ const messages = defineMessages({ profile: { id: 'column_header.profile', defaultMessage: 'Profile' }, }); -class ProfileColumnHeader extends React.PureComponent { +class ProfileColumnHeader extends PureComponent { static propTypes = { onClick: PropTypes.func, diff --git a/app/javascript/flavours/glitch/features/account/navigation.jsx b/app/javascript/flavours/glitch/features/account/navigation.jsx index b8b8e54deb..2739ca24e3 100644 --- a/app/javascript/flavours/glitch/features/account/navigation.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/features/account_gallery/components/media_item.jsx b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx index 0dfbec30c0..b8c85fd369 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx +++ b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx @@ -3,7 +3,6 @@ import classNames from 'classnames'; import { Icon } from 'flavours/glitch/components/icon'; import { autoPlayGif, displayMedia, useBlurhash } from 'flavours/glitch/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/flavours/glitch/features/account_gallery/index.jsx b/app/javascript/flavours/glitch/features/account_gallery/index.jsx index 26c45eff6d..45ded50902 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/account_timeline/components/header.jsx b/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx index 9b3c273bc2..c36fdda779 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/features/account/components/header'; diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.jsx b/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.jsx index c622b76072..ea5fd75bc3 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/features/account_timeline/components/memorial_note.jsx b/app/javascript/flavours/glitch/features/account_timeline/components/memorial_note.jsx index fed95ac2ab..a04808f1ca 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/memorial_note.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/account_timeline/components/moved_note.jsx b/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.jsx index 7d025ed418..b6ee3963fe 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.jsx +++ b/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { FormattedMessage } from 'react-intl'; diff --git a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx index c5432c64f1..86447a56d0 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx +++ b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import { makeGetAccount, getAccountHidden } from 'flavours/glitch/selectors'; import Header from '../components/header'; diff --git a/app/javascript/flavours/glitch/features/account_timeline/index.jsx b/app/javascript/flavours/glitch/features/account_timeline/index.jsx index b90918a01c..3a2afeb7ad 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/audio/index.jsx b/app/javascript/flavours/glitch/features/audio/index.jsx index 25252c01c3..13343f941f 100644 --- a/app/javascript/flavours/glitch/features/audio/index.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/features/blocks/index.jsx b/app/javascript/flavours/glitch/features/blocks/index.jsx index 669425c7f4..dbf7ae1207 100644 --- a/app/javascript/flavours/glitch/features/blocks/index.jsx +++ b/app/javascript/flavours/glitch/features/blocks/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { debounce } from 'lodash'; diff --git a/app/javascript/flavours/glitch/features/bookmarked_statuses/index.jsx b/app/javascript/flavours/glitch/features/bookmarked_statuses/index.jsx index d9c0746825..cc31427b69 100644 --- a/app/javascript/flavours/glitch/features/bookmarked_statuses/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/closed_registrations_modal/index.jsx b/app/javascript/flavours/glitch/features/closed_registrations_modal/index.jsx index 1f17ea9cfd..bf71904762 100644 --- a/app/javascript/flavours/glitch/features/closed_registrations_modal/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/community_timeline/components/column_settings.jsx b/app/javascript/flavours/glitch/features/community_timeline/components/column_settings.jsx index 0ea874e959..62a1e54926 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/components/column_settings.jsx +++ b/app/javascript/flavours/glitch/features/community_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'; @@ -10,7 +10,7 @@ const messages = defineMessages({ settings: { id: 'home.settings', defaultMessage: 'Column settings' }, }); -class ColumnSettings extends React.PureComponent { +class ColumnSettings extends PureComponent { static propTypes = { settings: ImmutablePropTypes.map.isRequired, diff --git a/app/javascript/flavours/glitch/features/community_timeline/index.jsx b/app/javascript/flavours/glitch/features/community_timeline/index.jsx index 8f3e10fe9b..3685f8bd17 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/index.jsx +++ b/app/javascript/flavours/glitch/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'; @@ -32,7 +32,7 @@ const mapStateToProps = (state, { columnId }) => { }; }; -class CommunityTimeline extends React.PureComponent { +class CommunityTimeline extends PureComponent { static defaultProps = { onlyMedia: false, diff --git a/app/javascript/flavours/glitch/features/compose/components/action_bar.jsx b/app/javascript/flavours/glitch/features/compose/components/action_bar.jsx index af1f02efc9..1dda335263 100644 --- a/app/javascript/flavours/glitch/features/compose/components/action_bar.jsx +++ b/app/javascript/flavours/glitch/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'; @@ -21,7 +21,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/flavours/glitch/features/compose/components/autosuggest_account.jsx b/app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx index db17c6e727..1361f660ce 100644 --- a/app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { Avatar } from 'flavours/glitch/components/avatar'; import { DisplayName } from 'flavours/glitch/components/display_name'; import ImmutablePropTypes from 'react-immutable-proptypes'; diff --git a/app/javascript/flavours/glitch/features/compose/components/character_counter.jsx b/app/javascript/flavours/glitch/features/compose/components/character_counter.jsx index 0ecfc9141d..15fc77bdcd 100644 --- a/app/javascript/flavours/glitch/features/compose/components/character_counter.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/compose/components/compose_form.jsx b/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx index 77062b8136..d8a403f2a1 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import CharacterCounter from './character_counter'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; diff --git a/app/javascript/flavours/glitch/features/compose/components/dropdown.jsx b/app/javascript/flavours/glitch/features/compose/components/dropdown.jsx index e791faa6bc..9c49fa5a1a 100644 --- a/app/javascript/flavours/glitch/features/compose/components/dropdown.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/dropdown.jsx @@ -1,7 +1,7 @@ // Package imports. import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import Overlay from 'react-overlays/Overlay'; // Components. @@ -9,7 +9,7 @@ import { IconButton } from 'flavours/glitch/components/icon_button'; import DropdownMenu from './dropdown_menu'; // The component. -export default class ComposerOptionsDropdown extends React.PureComponent { +export default class ComposerOptionsDropdown extends PureComponent { static propTypes = { isUserTouching: PropTypes.func, diff --git a/app/javascript/flavours/glitch/features/compose/components/dropdown_menu.jsx b/app/javascript/flavours/glitch/features/compose/components/dropdown_menu.jsx index 28f316619c..1ff28d29c1 100644 --- a/app/javascript/flavours/glitch/features/compose/components/dropdown_menu.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/dropdown_menu.jsx @@ -1,6 +1,6 @@ // Package imports. import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent, Fragment } from 'react'; import classNames from 'classnames'; import { supportsPassiveEvents } from 'detect-passive-events'; @@ -10,7 +10,7 @@ import { Icon } from 'flavours/glitch/components/icon'; const listenerOptions = supportsPassiveEvents ? { passive: true, capture: true } : true; // The component. -export default class ComposerOptionsDropdownContent extends React.PureComponent { +export default class ComposerOptionsDropdownContent extends PureComponent { static propTypes = { items: PropTypes.arrayOf(PropTypes.shape({ @@ -152,14 +152,14 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent if (!contents) { contents = ( - + {icon && }
{text} {meta}
-
+ ); } diff --git a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx index 68ff37b80e..c5f4ca6ba7 100644 --- a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx +++ b/app/javascript/flavours/glitch/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'; @@ -48,7 +48,7 @@ const notFoundFn = () => (
); -class ModifierPickerMenu extends React.PureComponent { +class ModifierPickerMenu extends PureComponent { static propTypes = { active: PropTypes.bool, @@ -109,7 +109,7 @@ class ModifierPickerMenu extends React.PureComponent { } -class ModifierPicker extends React.PureComponent { +class ModifierPicker extends PureComponent { static propTypes = { active: PropTypes.bool, @@ -145,7 +145,7 @@ class ModifierPicker extends React.PureComponent { } -class EmojiPickerMenuImpl extends React.PureComponent { +class EmojiPickerMenuImpl extends PureComponent { static propTypes = { custom_emojis: ImmutablePropTypes.list, @@ -308,7 +308,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/flavours/glitch/features/compose/components/header.jsx b/app/javascript/flavours/glitch/features/compose/components/header.jsx index 0a94ca5fc7..6a7d057b10 100644 --- a/app/javascript/flavours/glitch/features/compose/components/header.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/header.jsx @@ -1,6 +1,5 @@ // Package imports. import PropTypes from 'prop-types'; -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { injectIntl, defineMessages } from 'react-intl'; import { Link } from 'react-router-dom'; diff --git a/app/javascript/flavours/glitch/features/compose/components/language_dropdown.jsx b/app/javascript/flavours/glitch/features/compose/components/language_dropdown.jsx index 2d4ae72d40..5ffcf9aa88 100644 --- a/app/javascript/flavours/glitch/features/compose/components/language_dropdown.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/compose/components/navigation_bar.jsx b/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx index 371ad6d245..699949523f 100644 --- a/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/compose/components/options.jsx b/app/javascript/flavours/glitch/features/compose/components/options.jsx index 079065f8c6..f6a9b2e2ea 100644 --- a/app/javascript/flavours/glitch/features/compose/components/options.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/options.jsx @@ -1,6 +1,6 @@ // Package imports. import PropTypes from 'prop-types'; -import React from 'react'; +import { Fragment } from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { defineMessages, injectIntl } from 'react-intl'; import Toggle from 'react-toggle'; @@ -101,14 +101,14 @@ class ToggleOptionImpl extends ImmutablePureComponent { const { meta, text, checked } = this.props; return ( - +
{text} {meta}
-
+ ); } diff --git a/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx b/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx index 8b0f01a9ec..a92d08f863 100644 --- a/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx +++ b/app/javascript/flavours/glitch/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'; @@ -21,7 +21,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/flavours/glitch/features/compose/components/privacy_dropdown.jsx b/app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx index 5b1f48bc50..a9ebbaf10e 100644 --- a/app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import { defineMessages, injectIntl } from 'react-intl'; import Dropdown from './dropdown'; @@ -15,7 +15,7 @@ const messages = defineMessages({ change_privacy: { id: 'privacy.change', defaultMessage: 'Adjust status privacy' }, }); -class PrivacyDropdown extends React.PureComponent { +class PrivacyDropdown extends PureComponent { static propTypes = { isUserTouching: PropTypes.func, diff --git a/app/javascript/flavours/glitch/features/compose/components/publisher.jsx b/app/javascript/flavours/glitch/features/compose/components/publisher.jsx index 04c3926abf..216b8e223d 100644 --- a/app/javascript/flavours/glitch/features/compose/components/publisher.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/publisher.jsx @@ -1,7 +1,6 @@ // Package imports. import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; import { defineMessages, injectIntl } from 'react-intl'; import { length } from 'stringz'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx index 4077a29644..8a3c5dacdd 100644 --- a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx @@ -1,6 +1,5 @@ // Package imports. import PropTypes from 'prop-types'; -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/flavours/glitch/features/compose/components/search.jsx b/app/javascript/flavours/glitch/features/compose/components/search.jsx index 3d1aaf2646..737599ee60 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/search.jsx @@ -1,5 +1,5 @@ // Package imports. -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { injectIntl, @@ -20,7 +20,7 @@ const messages = defineMessages({ placeholderSignedIn: { id: 'search.search_or_paste', defaultMessage: 'Search or paste URL' }, }); -class SearchPopout extends React.PureComponent { +class SearchPopout extends PureComponent { render () { const extraInformation = searchEnabled ? : ; @@ -43,7 +43,7 @@ class SearchPopout extends React.PureComponent { } // The component. -class Search extends React.PureComponent { +class Search extends PureComponent { static contextTypes = { router: PropTypes.object.isRequired, diff --git a/app/javascript/flavours/glitch/features/compose/components/search_results.jsx b/app/javascript/flavours/glitch/features/compose/components/search_results.jsx index 8533d4b234..1cd7d07d18 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search_results.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/compose/components/text_icon_button.jsx b/app/javascript/flavours/glitch/features/compose/components/text_icon_button.jsx index a35bd4ff52..ddb9923695 100644 --- a/app/javascript/flavours/glitch/features/compose/components/text_icon_button.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/compose/components/textarea_icons.jsx b/app/javascript/flavours/glitch/features/compose/components/textarea_icons.jsx index 33e29797dc..4afc7ab925 100644 --- a/app/javascript/flavours/glitch/features/compose/components/textarea_icons.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/textarea_icons.jsx @@ -1,6 +1,5 @@ // Package imports. import PropTypes from 'prop-types'; -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/flavours/glitch/features/compose/components/upload.jsx b/app/javascript/flavours/glitch/features/compose/components/upload.jsx index 4a2c5176b4..dff365e839 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/compose/components/upload_form.jsx b/app/javascript/flavours/glitch/features/compose/components/upload_form.jsx index f2e7fe7a23..155ec27a10 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload_form.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/compose/components/upload_progress.jsx b/app/javascript/flavours/glitch/features/compose/components/upload_progress.jsx index 61047762d1..a329e1c879 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload_progress.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/features/compose/components/warning.jsx b/app/javascript/flavours/glitch/features/compose/components/warning.jsx index 803b7f86ab..4947a4e28b 100644 --- a/app/javascript/flavours/glitch/features/compose/components/warning.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/compose/containers/sensitive_button_container.jsx b/app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.jsx index 9c23d3f47a..8a771cdecb 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.jsx +++ b/app/javascript/flavours/glitch/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'; @@ -34,7 +34,7 @@ const mapDispatchToProps = dispatch => ({ }); -class SensitiveButton extends React.PureComponent { +class SensitiveButton extends PureComponent { static propTypes = { active: PropTypes.bool, diff --git a/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx b/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx index 8abc668fc6..7e8ec2b04e 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/compose/index.jsx b/app/javascript/flavours/glitch/features/compose/index.jsx index 611d83ad0e..99f2579f7f 100644 --- a/app/javascript/flavours/glitch/features/compose/index.jsx +++ b/app/javascript/flavours/glitch/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 mapDispatchToProps = (dispatch) => ({ }, }); -class Compose extends React.PureComponent { +class Compose extends PureComponent { static propTypes = { multiColumn: PropTypes.bool, diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.jsx b/app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.jsx index 79e98ec6fc..017159cf63 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.jsx +++ b/app/javascript/flavours/glitch/features/direct_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'; @@ -10,7 +10,7 @@ const messages = defineMessages({ settings: { id: 'home.settings', defaultMessage: 'Column settings' }, }); -class ColumnSettings extends React.PureComponent { +class ColumnSettings extends PureComponent { static propTypes = { settings: ImmutablePropTypes.map.isRequired, diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx index 18bc6e575e..2c3fa23afd 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/direct_timeline/components/conversations_list.jsx b/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.jsx index 2bfe6fbf12..5b5d636a14 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/direct_timeline/index.jsx b/app/javascript/flavours/glitch/features/direct_timeline/index.jsx index 2fe3f25686..14abca5d83 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/index.jsx +++ b/app/javascript/flavours/glitch/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'; @@ -22,7 +22,7 @@ const mapStateToProps = state => ({ conversationsMode: state.getIn(['settings', 'direct', 'conversations']), }); -class DirectTimeline extends React.PureComponent { +class DirectTimeline extends PureComponent { static propTypes = { dispatch: PropTypes.func.isRequired, diff --git a/app/javascript/flavours/glitch/features/directory/components/account_card.jsx b/app/javascript/flavours/glitch/features/directory/components/account_card.jsx index da11f881fc..1f8a632963 100644 --- a/app/javascript/flavours/glitch/features/directory/components/account_card.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/directory/index.jsx b/app/javascript/flavours/glitch/features/directory/index.jsx index 22280bbfdb..fcbce3bf01 100644 --- a/app/javascript/flavours/glitch/features/directory/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/domain_blocks/index.jsx b/app/javascript/flavours/glitch/features/domain_blocks/index.jsx index b9ef739593..771906c678 100644 --- a/app/javascript/flavours/glitch/features/domain_blocks/index.jsx +++ b/app/javascript/flavours/glitch/features/domain_blocks/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { debounce } from 'lodash'; diff --git a/app/javascript/flavours/glitch/features/explore/components/story.jsx b/app/javascript/flavours/glitch/features/explore/components/story.jsx index cadc710d4d..3d67340e77 100644 --- a/app/javascript/flavours/glitch/features/explore/components/story.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/components/blurhash'; import { accountsCountRenderer } from 'flavours/glitch/components/hashtag'; @@ -6,7 +6,7 @@ import ShortNumber from 'flavours/glitch/components/short_number'; import { Skeleton } from 'flavours/glitch/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/flavours/glitch/features/explore/index.jsx b/app/javascript/flavours/glitch/features/explore/index.jsx index a64c8183c4..4906819246 100644 --- a/app/javascript/flavours/glitch/features/explore/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/explore/links.jsx b/app/javascript/flavours/glitch/features/explore/links.jsx index 425934c4ab..557a4bd840 100644 --- a/app/javascript/flavours/glitch/features/explore/links.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/explore/results.jsx b/app/javascript/flavours/glitch/features/explore/results.jsx index 0d6c0e8f1d..c9cd707464 100644 --- a/app/javascript/flavours/glitch/features/explore/results.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/explore/statuses.jsx b/app/javascript/flavours/glitch/features/explore/statuses.jsx index 381c50c5d5..5f336d18e8 100644 --- a/app/javascript/flavours/glitch/features/explore/statuses.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/features/explore/suggestions.jsx b/app/javascript/flavours/glitch/features/explore/suggestions.jsx index e1b84098a0..cdc6955245 100644 --- a/app/javascript/flavours/glitch/features/explore/suggestions.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/features/explore/tags.jsx b/app/javascript/flavours/glitch/features/explore/tags.jsx index e0fdd1d912..78563a3eec 100644 --- a/app/javascript/flavours/glitch/features/explore/tags.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/features/favourited_statuses/index.jsx b/app/javascript/flavours/glitch/features/favourited_statuses/index.jsx index 9b63dec23b..df4e5359e7 100644 --- a/app/javascript/flavours/glitch/features/favourited_statuses/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/favourites/index.jsx b/app/javascript/flavours/glitch/features/favourites/index.jsx index 3287c5989d..8d2cbf7f1d 100644 --- a/app/javascript/flavours/glitch/features/favourites/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/filters/added_to_filter.jsx b/app/javascript/flavours/glitch/features/filters/added_to_filter.jsx index 2f3f98c813..a7deb5a06b 100644 --- a/app/javascript/flavours/glitch/features/filters/added_to_filter.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/filters/select_filter.jsx b/app/javascript/flavours/glitch/features/filters/select_filter.jsx index e7cdd4e197..23d9d1582a 100644 --- a/app/javascript/flavours/glitch/features/filters/select_filter.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/follow_recommendations/components/account.jsx b/app/javascript/flavours/glitch/features/follow_recommendations/components/account.jsx index 4eeffc402b..09015e7a04 100644 --- a/app/javascript/flavours/glitch/features/follow_recommendations/components/account.jsx +++ b/app/javascript/flavours/glitch/features/follow_recommendations/components/account.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/flavours/glitch/features/follow_recommendations/index.jsx b/app/javascript/flavours/glitch/features/follow_recommendations/index.jsx index 70f2191f11..fae99a5991 100644 --- a/app/javascript/flavours/glitch/features/follow_recommendations/index.jsx +++ b/app/javascript/flavours/glitch/features/follow_recommendations/index.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { Fragment } from 'react'; import PropTypes from 'prop-types'; import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePropTypes from 'react-immutable-proptypes'; @@ -86,7 +86,7 @@ class FollowRecommendations extends ImmutablePureComponent {
{!isLoading && ( - +
{suggestions.size > 0 ? suggestions.map(suggestion => ( @@ -101,7 +101,7 @@ class FollowRecommendations extends ImmutablePureComponent {
-
+ )} diff --git a/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx b/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx index 31e79f042e..1f06690564 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx +++ b/app/javascript/flavours/glitch/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 Permalink from 'flavours/glitch/components/permalink'; diff --git a/app/javascript/flavours/glitch/features/follow_requests/index.jsx b/app/javascript/flavours/glitch/features/follow_requests/index.jsx index 7ca707ec95..63c367f474 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/index.jsx +++ b/app/javascript/flavours/glitch/features/follow_requests/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/flavours/glitch/features/followed_tags/index.jsx b/app/javascript/flavours/glitch/features/followed_tags/index.jsx index a5abb151f3..10bb4249c8 100644 --- a/app/javascript/flavours/glitch/features/followed_tags/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/followers/index.jsx b/app/javascript/flavours/glitch/features/followers/index.jsx index 39eaed1285..00977d3b72 100644 --- a/app/javascript/flavours/glitch/features/followers/index.jsx +++ b/app/javascript/flavours/glitch/features/followers/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/flavours/glitch/features/following/index.jsx b/app/javascript/flavours/glitch/features/following/index.jsx index 39f87eef9c..6cd9448504 100644 --- a/app/javascript/flavours/glitch/features/following/index.jsx +++ b/app/javascript/flavours/glitch/features/following/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/flavours/glitch/features/getting_started/components/announcements.jsx b/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx index fd76f9773d..8f77227554 100644 --- a/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/getting_started/components/trends.jsx b/app/javascript/flavours/glitch/features/getting_started/components/trends.jsx index d7e222d716..37310d93d0 100644 --- a/app/javascript/flavours/glitch/features/getting_started/components/trends.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/getting_started/index.jsx b/app/javascript/flavours/glitch/features/getting_started/index.jsx index 8356e977ef..9537180d60 100644 --- a/app/javascript/flavours/glitch/features/getting_started/index.jsx +++ b/app/javascript/flavours/glitch/features/getting_started/index.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { Fragment } from 'react'; import Column from 'flavours/glitch/features/ui/components/column'; import ColumnLink from 'flavours/glitch/features/ui/components/column_link'; import ColumnSubheading from 'flavours/glitch/features/ui/components/column_subheading'; @@ -173,13 +173,13 @@ class GettingStarted extends ImmutablePureComponent { {multiColumn && } {navItems} {signedIn && ( - + {listItems} { preferencesLink !== undefined && } - + )} diff --git a/app/javascript/flavours/glitch/features/getting_started_misc/index.jsx b/app/javascript/flavours/glitch/features/getting_started_misc/index.jsx index ad40edd75e..4e8098bbf8 100644 --- a/app/javascript/flavours/glitch/features/getting_started_misc/index.jsx +++ b/app/javascript/flavours/glitch/features/getting_started_misc/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import Column from 'flavours/glitch/features/ui/components/column'; import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim'; diff --git a/app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.jsx b/app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.jsx index f140f2d013..528d4309fc 100644 --- a/app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/hashtag_timeline/index.jsx b/app/javascript/flavours/glitch/features/hashtag_timeline/index.jsx index cd3639d968..9568580ab8 100644 --- a/app/javascript/flavours/glitch/features/hashtag_timeline/index.jsx +++ b/app/javascript/flavours/glitch/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 StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container'; @@ -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/flavours/glitch/features/home_timeline/components/column_settings.jsx b/app/javascript/flavours/glitch/features/home_timeline/components/column_settings.jsx index 1eeeaa378a..435af2216c 100644 --- a/app/javascript/flavours/glitch/features/home_timeline/components/column_settings.jsx +++ b/app/javascript/flavours/glitch/features/home_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'; @@ -10,7 +10,7 @@ const messages = defineMessages({ settings: { id: 'home.settings', defaultMessage: 'Column settings' }, }); -class ColumnSettings extends React.PureComponent { +class ColumnSettings extends PureComponent { static propTypes = { settings: ImmutablePropTypes.map.isRequired, diff --git a/app/javascript/flavours/glitch/features/home_timeline/index.jsx b/app/javascript/flavours/glitch/features/home_timeline/index.jsx index a8dfa1d08f..ee256dae58 100644 --- a/app/javascript/flavours/glitch/features/home_timeline/index.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/actions/timelines'; import PropTypes from 'prop-types'; @@ -31,7 +31,7 @@ const mapStateToProps = state => ({ regex: state.getIn(['settings', 'home', 'regex', 'body']), }); -class HomeTimeline extends React.PureComponent { +class HomeTimeline extends PureComponent { static contextTypes = { identity: PropTypes.object, diff --git a/app/javascript/flavours/glitch/features/interaction_modal/index.jsx b/app/javascript/flavours/glitch/features/interaction_modal/index.jsx index 515e47de2a..2ef26f65f4 100644 --- a/app/javascript/flavours/glitch/features/interaction_modal/index.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/features/keyboard_shortcuts/index.jsx b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx index 7160e7efbf..fcad938277 100644 --- a/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx +++ b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import Column from 'flavours/glitch/components/column'; import { connect } from 'react-redux'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; diff --git a/app/javascript/flavours/glitch/features/list_adder/components/account.jsx b/app/javascript/flavours/glitch/features/list_adder/components/account.jsx index 0e4b098d92..5466d83c3a 100644 --- a/app/javascript/flavours/glitch/features/list_adder/components/account.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/list_adder/components/list.jsx b/app/javascript/flavours/glitch/features/list_adder/components/list.jsx index 587a953b01..7fbf9004a1 100644 --- a/app/javascript/flavours/glitch/features/list_adder/components/list.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/list_adder/index.jsx b/app/javascript/flavours/glitch/features/list_adder/index.jsx index 45d5589f96..3ef29b212e 100644 --- a/app/javascript/flavours/glitch/features/list_adder/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/list_editor/components/account.jsx b/app/javascript/flavours/glitch/features/list_editor/components/account.jsx index b94b7e3f62..4481c9a468 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/account.jsx +++ b/app/javascript/flavours/glitch/features/list_editor/components/account.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/flavours/glitch/features/list_editor/components/edit_list_form.jsx b/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.jsx index 3f4e9ded60..1d7c399116 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/features/list_editor/components/search.jsx b/app/javascript/flavours/glitch/features/list_editor/components/search.jsx index 3a51a7b4e5..e04c02ee1b 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/search.jsx +++ b/app/javascript/flavours/glitch/features/list_editor/components/search.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { defineMessages } from 'react-intl'; import classNames from 'classnames'; @@ -8,7 +8,7 @@ const messages = defineMessages({ search: { id: 'lists.search', defaultMessage: 'Search among people you follow' }, }); -export default class Search extends React.PureComponent { +export default class Search extends PureComponent { static propTypes = { intl: PropTypes.object.isRequired, diff --git a/app/javascript/flavours/glitch/features/list_editor/index.jsx b/app/javascript/flavours/glitch/features/list_editor/index.jsx index 44951d1c64..bb1aa3162e 100644 --- a/app/javascript/flavours/glitch/features/list_editor/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/list_timeline/index.jsx b/app/javascript/flavours/glitch/features/list_timeline/index.jsx index 8803664761..fb2ef79a62 100644 --- a/app/javascript/flavours/glitch/features/list_timeline/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/lists/components/new_list_form.jsx b/app/javascript/flavours/glitch/features/lists/components/new_list_form.jsx index aa743dea4a..f3720e900d 100644 --- a/app/javascript/flavours/glitch/features/lists/components/new_list_form.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/features/lists/index.jsx b/app/javascript/flavours/glitch/features/lists/index.jsx index 375ab5faed..836bd7ba64 100644 --- a/app/javascript/flavours/glitch/features/lists/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/local_settings/index.jsx b/app/javascript/flavours/glitch/features/local_settings/index.jsx index 4e4605ea9d..71a2f3a6e9 100644 --- a/app/javascript/flavours/glitch/features/local_settings/index.jsx +++ b/app/javascript/flavours/glitch/features/local_settings/index.jsx @@ -1,5 +1,5 @@ // Package imports. -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; @@ -23,7 +23,7 @@ const mapDispatchToProps = dispatch => ({ }, }); -class LocalSettings extends React.PureComponent { +class LocalSettings extends PureComponent { static propTypes = { onChange: PropTypes.func.isRequired, diff --git a/app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx b/app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx index fe08e5d7b0..4b37312d09 100644 --- a/app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx +++ b/app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx @@ -1,5 +1,5 @@ // Package imports -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { injectIntl, defineMessages } from 'react-intl'; @@ -19,7 +19,7 @@ const messages = defineMessages({ close: { id: 'settings.close', defaultMessage: 'Close' }, }); -class LocalSettingsNavigation extends React.PureComponent { +class LocalSettingsNavigation extends PureComponent { static propTypes = { index : PropTypes.number, diff --git a/app/javascript/flavours/glitch/features/local_settings/navigation/item/index.jsx b/app/javascript/flavours/glitch/features/local_settings/navigation/item/index.jsx index 2de7c952c8..867613f9bc 100644 --- a/app/javascript/flavours/glitch/features/local_settings/navigation/item/index.jsx +++ b/app/javascript/flavours/glitch/features/local_settings/navigation/item/index.jsx @@ -1,5 +1,5 @@ // Package imports -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; @@ -7,7 +7,7 @@ import { Icon } from 'flavours/glitch/components/icon'; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -export default class LocalSettingsPage extends React.PureComponent { +export default class LocalSettingsPage extends PureComponent { static propTypes = { active: PropTypes.bool, diff --git a/app/javascript/flavours/glitch/features/local_settings/page/deprecated_item/index.jsx b/app/javascript/flavours/glitch/features/local_settings/page/deprecated_item/index.jsx index 0f0dc3ce37..1ea20ed07b 100644 --- a/app/javascript/flavours/glitch/features/local_settings/page/deprecated_item/index.jsx +++ b/app/javascript/flavours/glitch/features/local_settings/page/deprecated_item/index.jsx @@ -1,10 +1,10 @@ // Package imports -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -export default class LocalSettingsPageItem extends React.PureComponent { +export default class LocalSettingsPageItem extends PureComponent { static propTypes = { children: PropTypes.node.isRequired, diff --git a/app/javascript/flavours/glitch/features/local_settings/page/index.jsx b/app/javascript/flavours/glitch/features/local_settings/page/index.jsx index 91582a3183..a94d71e660 100644 --- a/app/javascript/flavours/glitch/features/local_settings/page/index.jsx +++ b/app/javascript/flavours/glitch/features/local_settings/page/index.jsx @@ -1,5 +1,5 @@ // Package imports -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { defineMessages, FormattedMessage, injectIntl } from 'react-intl'; @@ -35,7 +35,7 @@ const messages = defineMessages({ direct: { id: 'privacy.direct.short', defaultMessage: 'Mentioned people only' }, }); -class LocalSettingsPage extends React.PureComponent { +class LocalSettingsPage extends PureComponent { static propTypes = { index : PropTypes.number, diff --git a/app/javascript/flavours/glitch/features/local_settings/page/item/index.jsx b/app/javascript/flavours/glitch/features/local_settings/page/item/index.jsx index 99bb65ca03..0e17925513 100644 --- a/app/javascript/flavours/glitch/features/local_settings/page/item/index.jsx +++ b/app/javascript/flavours/glitch/features/local_settings/page/item/index.jsx @@ -1,11 +1,11 @@ // Package imports -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -export default class LocalSettingsPageItem extends React.PureComponent { +export default class LocalSettingsPageItem extends PureComponent { static propTypes = { children: PropTypes.node.isRequired, diff --git a/app/javascript/flavours/glitch/features/mutes/index.jsx b/app/javascript/flavours/glitch/features/mutes/index.jsx index e1a76e2fe3..10bbd8395d 100644 --- a/app/javascript/flavours/glitch/features/mutes/index.jsx +++ b/app/javascript/flavours/glitch/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 PropTypes from 'prop-types'; diff --git a/app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx b/app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx index 3d5f67a178..a6da442493 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx @@ -1,5 +1,4 @@ // Package imports. -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; diff --git a/app/javascript/flavours/glitch/features/notifications/components/admin_signup.jsx b/app/javascript/flavours/glitch/features/notifications/components/admin_signup.jsx index 7c872e182f..4edaa7581e 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/admin_signup.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/admin_signup.jsx @@ -1,5 +1,4 @@ // Package imports. -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; diff --git a/app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx b/app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx index 0602b4cf00..fa653a13ec 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx @@ -1,9 +1,9 @@ -import React from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { Icon } from 'flavours/glitch/components/icon'; -export default class ClearColumnButton extends React.Component { +export default class ClearColumnButton extends Component { static propTypes = { onClick: PropTypes.func.isRequired, diff --git a/app/javascript/flavours/glitch/features/notifications/components/column_settings.jsx b/app/javascript/flavours/glitch/features/notifications/components/column_settings.jsx index 1c04218bac..6819ea4cee 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/column_settings.jsx +++ b/app/javascript/flavours/glitch/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'; @@ -8,7 +8,7 @@ import SettingToggle from './setting_toggle'; import PillBarButton from './pill_bar_button'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_REPORTS } from 'flavours/glitch/permissions'; -export default class ColumnSettings extends React.PureComponent { +export default class ColumnSettings extends PureComponent { static contextTypes = { identity: PropTypes.object, diff --git a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx index cc83fa5cfd..153ae79801 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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/flavours/glitch/features/notifications/components/follow.jsx b/app/javascript/flavours/glitch/features/notifications/components/follow.jsx index 88c90f3ce6..c6dc1bbcbd 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/follow.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/follow.jsx @@ -1,5 +1,4 @@ // Package imports. -import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; diff --git a/app/javascript/flavours/glitch/features/notifications/components/follow_request.jsx b/app/javascript/flavours/glitch/features/notifications/components/follow_request.jsx index c61f656f69..ba19258779 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/follow_request.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/follow_request.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 { Avatar } from 'flavours/glitch/components/avatar'; diff --git a/app/javascript/flavours/glitch/features/notifications/components/grant_permission_button.jsx b/app/javascript/flavours/glitch/features/notifications/components/grant_permission_button.jsx index 5b2db48fdb..96f5d67d9c 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/grant_permission_button.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/notifications/components/notification.jsx b/app/javascript/flavours/glitch/features/notifications/components/notification.jsx index d1aea1b21d..c4e6e8dd25 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/notification.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/notification.jsx @@ -1,5 +1,4 @@ // Package imports. -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/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx b/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx index 8868cc0cb4..2dc66a70b4 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { PureComponent } from 'react'; import { Icon } from 'flavours/glitch/components/icon'; import Button from 'flavours/glitch/components/button'; import { IconButton } from 'flavours/glitch/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/flavours/glitch/features/notifications/components/overlay.jsx b/app/javascript/flavours/glitch/features/notifications/components/overlay.jsx index 00e6257380..9d761b849f 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/overlay.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/overlay.jsx @@ -4,7 +4,6 @@ // Package imports. -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/flavours/glitch/features/notifications/components/pill_bar_button.jsx b/app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.jsx index 2f0b48ef98..17a3000fe1 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.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 classNames from 'classnames'; -export default class PillBarButton extends React.PureComponent { +export default class PillBarButton extends PureComponent { static propTypes = { prefix: PropTypes.string, diff --git a/app/javascript/flavours/glitch/features/notifications/components/report.jsx b/app/javascript/flavours/glitch/features/notifications/components/report.jsx index b2e795b2d1..ef58891077 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/report.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/notifications/components/setting_toggle.jsx b/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.jsx index dc7b89b7fd..a0515bef93 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/notifications/index.jsx b/app/javascript/flavours/glitch/features/notifications/index.jsx index c1042c1367..6a87aff86f 100644 --- a/app/javascript/flavours/glitch/features/notifications/index.jsx +++ b/app/javascript/flavours/glitch/features/notifications/index.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import classNames from 'classnames'; import PropTypes from 'prop-types'; @@ -82,7 +82,7 @@ const mapDispatchToProps = dispatch => ({ dispatch, }); -class Notifications extends React.PureComponent { +class Notifications extends PureComponent { static contextTypes = { identity: PropTypes.object, diff --git a/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx b/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx index 01a823f173..93d28ffe7b 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/picture_in_picture/components/header.jsx b/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx index 43a910c505..f32c108668 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/picture_in_picture/index.jsx b/app/javascript/flavours/glitch/features/picture_in_picture/index.jsx index e6fb64ff99..dc90a95d2c 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/index.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/features/video'; @@ -13,7 +13,7 @@ const mapStateToProps = state => ({ left: state.getIn(['local_settings', 'media', 'pop_in_position']) === 'left', }); -class PictureInPicture extends React.Component { +class PictureInPicture extends Component { static propTypes = { statusId: PropTypes.string, diff --git a/app/javascript/flavours/glitch/features/pinned_accounts_editor/index.jsx b/app/javascript/flavours/glitch/features/pinned_accounts_editor/index.jsx index 834de652f5..5473f536e5 100644 --- a/app/javascript/flavours/glitch/features/pinned_accounts_editor/index.jsx +++ b/app/javascript/flavours/glitch/features/pinned_accounts_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/flavours/glitch/features/pinned_statuses/index.jsx b/app/javascript/flavours/glitch/features/pinned_statuses/index.jsx index 5f6035cb1e..ad51f3efcc 100644 --- a/app/javascript/flavours/glitch/features/pinned_statuses/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/privacy_policy/index.jsx b/app/javascript/flavours/glitch/features/privacy_policy/index.jsx index 44cb9b0d0a..cce2bba361 100644 --- a/app/javascript/flavours/glitch/features/privacy_policy/index.jsx +++ b/app/javascript/flavours/glitch/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/flavours/glitch/features/public_timeline/components/column_settings.jsx b/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.jsx index a44d5c784d..8d653930c3 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.jsx +++ b/app/javascript/flavours/glitch/features/public_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'; @@ -9,7 +9,7 @@ const messages = defineMessages({ filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' }, }); -class ColumnSettings extends React.PureComponent { +class ColumnSettings extends PureComponent { static propTypes = { settings: ImmutablePropTypes.map.isRequired, diff --git a/app/javascript/flavours/glitch/features/public_timeline/index.jsx b/app/javascript/flavours/glitch/features/public_timeline/index.jsx index 737e5723f4..496908d72a 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/index.jsx +++ b/app/javascript/flavours/glitch/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'; @@ -35,7 +35,7 @@ const mapStateToProps = (state, { columnId }) => { }; }; -class PublicTimeline extends React.PureComponent { +class PublicTimeline extends PureComponent { static defaultProps = { onlyMedia: false, diff --git a/app/javascript/flavours/glitch/features/reblogs/index.jsx b/app/javascript/flavours/glitch/features/reblogs/index.jsx index 5b03500c2c..9d681a9713 100644 --- a/app/javascript/flavours/glitch/features/reblogs/index.jsx +++ b/app/javascript/flavours/glitch/features/reblogs/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/flavours/glitch/features/report/category.jsx b/app/javascript/flavours/glitch/features/report/category.jsx index 43e311f3d0..3f88631866 100644 --- a/app/javascript/flavours/glitch/features/report/category.jsx +++ b/app/javascript/flavours/glitch/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, @@ -72,7 +72,7 @@ class Category extends React.PureComponent { ]; return ( - +

@@ -95,7 +95,7 @@ class Category extends React.PureComponent {
-
+ ); } diff --git a/app/javascript/flavours/glitch/features/report/comment.jsx b/app/javascript/flavours/glitch/features/report/comment.jsx index afcb7afa4f..507ecdd6e7 100644 --- a/app/javascript/flavours/glitch/features/report/comment.jsx +++ b/app/javascript/flavours/glitch/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 'flavours/glitch/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 ( - +