From 960c43d24c3552031442607d5afa6e791e842524 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Wed, 29 Jan 2020 16:54:39 -0500 Subject: [PATCH] Updated PureComponent usage --- app/javascript/gabsocial/components/footer_bar/footer_bar.js | 2 +- .../gabsocial/components/progress_panel/progress_panel.js | 2 +- .../gabsocial/components/status_quote/status_quote.js | 2 +- .../features/community_timeline/community_timeline.js | 2 +- .../features/compose/components/quoted_status_preview.js | 2 +- .../features/compose/components/schedule_post_dropdown.js | 4 ++-- .../features/groups/timeline/components/column_settings.js | 2 +- app/javascript/gabsocial/features/ui/ui.js | 4 ++-- app/javascript/gabsocial/features/video/video.js | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/javascript/gabsocial/components/footer_bar/footer_bar.js b/app/javascript/gabsocial/components/footer_bar/footer_bar.js index 627e93c4..201bbce2 100644 --- a/app/javascript/gabsocial/components/footer_bar/footer_bar.js +++ b/app/javascript/gabsocial/components/footer_bar/footer_bar.js @@ -28,7 +28,7 @@ const links = [ export default @injectIntl @withRouter -class FooterBar extends React.PureComponent { +class FooterBar extends PureComponent { static propTypes = { intl: PropTypes.object.isRequired, diff --git a/app/javascript/gabsocial/components/progress_panel/progress_panel.js b/app/javascript/gabsocial/components/progress_panel/progress_panel.js index 3b4a3f38..9a90ef48 100644 --- a/app/javascript/gabsocial/components/progress_panel/progress_panel.js +++ b/app/javascript/gabsocial/components/progress_panel/progress_panel.js @@ -1,6 +1,6 @@ import { monthlyExpensesComplete } from '../../initial_state'; -export default class ProgressPanel extends React.PureComponent { +export default class ProgressPanel extends PureComponent { render() { if (!monthlyExpensesComplete) return null; diff --git a/app/javascript/gabsocial/components/status_quote/status_quote.js b/app/javascript/gabsocial/components/status_quote/status_quote.js index 0e8f3756..57a5e968 100644 --- a/app/javascript/gabsocial/components/status_quote/status_quote.js +++ b/app/javascript/gabsocial/components/status_quote/status_quote.js @@ -11,7 +11,7 @@ const mapStateToProps = (state, { id }) => ({ }); @connect(mapStateToProps) -export default class StatusQuote extends React.PureComponent { +export default class StatusQuote extends PureComponent { static contextTypes = { router: PropTypes.object, diff --git a/app/javascript/gabsocial/features/community_timeline/community_timeline.js b/app/javascript/gabsocial/features/community_timeline/community_timeline.js index 1879e65e..64c79bdf 100644 --- a/app/javascript/gabsocial/features/community_timeline/community_timeline.js +++ b/app/javascript/gabsocial/features/community_timeline/community_timeline.js @@ -32,7 +32,7 @@ const mapStateToProps = state => { export default @connect(mapStateToProps) @injectIntl -class CommunityTimeline extends React.PureComponent { +class CommunityTimeline extends PureComponent { static contextTypes = { router: PropTypes.object, diff --git a/app/javascript/gabsocial/features/compose/components/quoted_status_preview.js b/app/javascript/gabsocial/features/compose/components/quoted_status_preview.js index 8cd9c2ac..c2443ef6 100644 --- a/app/javascript/gabsocial/features/compose/components/quoted_status_preview.js +++ b/app/javascript/gabsocial/features/compose/components/quoted_status_preview.js @@ -2,7 +2,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import DisplayName from '../../../components/display_name'; import StatusContent from '../../../components/status_content'; -export default class QuotedStatusPreview extends React.PureComponent { +export default class QuotedStatusPreview extends PureComponent { static propTypes = { status: ImmutablePropTypes.map, account: ImmutablePropTypes.map, diff --git a/app/javascript/gabsocial/features/compose/components/schedule_post_dropdown.js b/app/javascript/gabsocial/features/compose/components/schedule_post_dropdown.js index 594c24a6..fe2e8ff8 100644 --- a/app/javascript/gabsocial/features/compose/components/schedule_post_dropdown.js +++ b/app/javascript/gabsocial/features/compose/components/schedule_post_dropdown.js @@ -9,7 +9,7 @@ const messages = defineMessages({ schedule_status: { id: 'schedule_status.title', defaultMessage: 'Schedule Status' }, }); -class DatePickerWrapper extends React.PureComponent { +class DatePickerWrapper extends PureComponent { static propTypes = { value: PropTypes.string, onClick: PropTypes.func, @@ -27,7 +27,7 @@ class DatePickerWrapper extends React.PureComponent { } export default @injectIntl -class SchedulePostDropdown extends React.PureComponent { +class SchedulePostDropdown extends PureComponent { static propTypes = { date: PropTypes.instanceOf(Date), diff --git a/app/javascript/gabsocial/features/groups/timeline/components/column_settings.js b/app/javascript/gabsocial/features/groups/timeline/components/column_settings.js index 8f44672b..936c69b2 100644 --- a/app/javascript/gabsocial/features/groups/timeline/components/column_settings.js +++ b/app/javascript/gabsocial/features/groups/timeline/components/column_settings.js @@ -3,7 +3,7 @@ import { injectIntl, FormattedMessage } from 'react-intl'; import SettingToggle from '../../../../components/setting_toggle'; export default @injectIntl -class ColumnSettings extends React.PureComponent { +class ColumnSettings extends PureComponent { static propTypes = { settings: ImmutablePropTypes.map.isRequired, diff --git a/app/javascript/gabsocial/features/ui/ui.js b/app/javascript/gabsocial/features/ui/ui.js index 9fe308d5..dffda6ec 100644 --- a/app/javascript/gabsocial/features/ui/ui.js +++ b/app/javascript/gabsocial/features/ui/ui.js @@ -144,7 +144,7 @@ const LAYOUT = { const shouldHideFAB = path => path.match(/^\/posts\/|^\/search|^\/getting-started/); -class SwitchingColumnsArea extends React.PureComponent { +class SwitchingColumnsArea extends PureComponent { static propTypes = { children: PropTypes.node, @@ -251,7 +251,7 @@ class SwitchingColumnsArea extends React.PureComponent { export default @connect(mapStateToProps) @injectIntl @withRouter -class UI extends React.PureComponent { +class UI extends PureComponent { static contextTypes = { router: PropTypes.object.isRequired, diff --git a/app/javascript/gabsocial/features/video/video.js b/app/javascript/gabsocial/features/video/video.js index e90e3db4..43cd85e9 100644 --- a/app/javascript/gabsocial/features/video/video.js +++ b/app/javascript/gabsocial/features/video/video.js @@ -86,7 +86,7 @@ export const getPointerPosition = (el, event) => { }; export default @injectIntl -class Video extends React.PureComponent { +class Video extends PureComponent { static propTypes = { preview: PropTypes.string,