From 8a19b89c169288f879264bfdc25d30d3681d8d05 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 14 Apr 2020 16:47:35 -0500 Subject: [PATCH] Enforce spacing of function parameters in eslint --- .eslintrc.js | 2 + app/gabsocial/actions/compose.js | 8 +- app/gabsocial/actions/height_cache.js | 4 +- app/gabsocial/actions/interactions.js | 14 ++-- app/gabsocial/actions/notifications.js | 2 +- .../actions/push_notifications/registerer.js | 2 +- .../actions/push_notifications/setter.js | 8 +- app/gabsocial/actions/streaming.js | 4 +- app/gabsocial/api.js | 2 +- app/gabsocial/components/account.js | 2 +- app/gabsocial/components/attachment_list.js | 2 +- app/gabsocial/components/autosuggest_emoji.js | 2 +- app/gabsocial/components/autosuggest_input.js | 4 +- .../components/autosuggest_textarea.js | 4 +- app/gabsocial/components/avatar.js | 2 +- app/gabsocial/components/avatar_composite.js | 2 +- app/gabsocial/components/button.js | 2 +- app/gabsocial/components/column.js | 2 +- .../components/column_back_button.js | 2 +- .../components/column_back_button_slim.js | 2 +- app/gabsocial/components/column_header.js | 2 +- app/gabsocial/components/display_name.js | 2 +- app/gabsocial/components/domain.js | 2 +- app/gabsocial/components/dropdown_menu.js | 10 +-- .../components/extended_video_player.js | 6 +- .../components/home_column_header.js | 2 +- app/gabsocial/components/icon.js | 2 +- app/gabsocial/components/icon_button.js | 2 +- .../intersection_observer_article.js | 8 +- app/gabsocial/components/load_gap.js | 2 +- app/gabsocial/components/media_gallery.js | 14 ++-- app/gabsocial/components/modal_root.js | 10 +-- app/gabsocial/components/permalink.js | 2 +- app/gabsocial/components/poll.js | 4 +- .../components/relative_timestamp.js | 14 ++-- app/gabsocial/components/scrollable_list.js | 20 ++--- app/gabsocial/components/setting_text.js | 2 +- app/gabsocial/components/sidebar_menu.js | 4 +- app/gabsocial/components/status.js | 14 ++-- app/gabsocial/components/status_action_bar.js | 2 +- app/gabsocial/components/status_content.js | 8 +- app/gabsocial/components/status_list.js | 4 +- .../timeline_queue_button_header.js | 2 +- app/gabsocial/containers/account_container.js | 8 +- app/gabsocial/containers/compose_container.js | 2 +- app/gabsocial/containers/domain_container.js | 4 +- app/gabsocial/containers/gabsocial.js | 4 +- ...intersection_observer_article_container.js | 2 +- app/gabsocial/containers/media_container.js | 2 +- app/gabsocial/containers/status_container.js | 32 ++++---- .../containers/timeline_container.js | 2 +- .../features/account/components/header.js | 6 +- .../account_gallery/components/media_item.js | 10 +-- .../features/account_gallery/index.js | 8 +- .../account_timeline/components/header.js | 2 +- .../account_timeline/components/moved_note.js | 2 +- .../containers/header_container.js | 20 ++--- .../features/account_timeline/index.js | 6 +- app/gabsocial/features/blocks/index.js | 4 +- .../components/column_settings.js | 2 +- .../containers/column_settings_container.js | 2 +- .../features/community_timeline/index.js | 8 +- .../features/compose/components/action_bar.js | 2 +- .../compose/components/autosuggest_account.js | 2 +- .../compose/components/character_counter.js | 4 +- .../compose/components/compose_form.js | 4 +- .../components/emoji_picker_dropdown.js | 20 ++--- .../compose/components/navigation_bar.js | 2 +- .../compose/components/poll_button.js | 2 +- .../features/compose/components/poll_form.js | 4 +- .../compose/components/privacy_dropdown.js | 10 +-- .../compose/components/reply_indicator.js | 2 +- .../features/compose/components/search.js | 4 +- .../compose/components/search_results.js | 2 +- .../compose/components/text_icon_button.js | 2 +- .../features/compose/components/upload.js | 2 +- .../compose/components/upload_button.js | 2 +- .../compose/components/upload_form.js | 2 +- .../compose/components/upload_progress.js | 2 +- .../features/compose/components/warning.js | 2 +- .../containers/compose_form_container.js | 16 ++-- .../emoji_picker_dropdown_container.js | 2 +- .../containers/poll_button_container.js | 2 +- .../compose/containers/poll_form_container.js | 6 +- .../containers/privacy_dropdown_container.js | 2 +- .../containers/reply_indicator_container.js | 2 +- .../compose/containers/search_container.js | 8 +- .../containers/sensitive_button_container.js | 4 +- .../containers/spoiler_button_container.js | 2 +- .../containers/upload_button_container.js | 2 +- .../compose/containers/upload_container.js | 2 +- app/gabsocial/features/compose/index.js | 6 +- .../components/conversation.js | 2 +- .../components/conversations_list.js | 4 +- .../features/direct_timeline/index.js | 6 +- app/gabsocial/features/domain_blocks/index.js | 4 +- app/gabsocial/features/emoji/emoji_utils.js | 2 +- .../features/favourited_statuses/index.js | 4 +- app/gabsocial/features/favourites/index.js | 6 +- .../components/account_authorize.js | 2 +- .../containers/account_authorize_container.js | 4 +- .../features/follow_requests/index.js | 4 +- app/gabsocial/features/followers/index.js | 6 +- app/gabsocial/features/following/index.js | 6 +- .../features/getting_started/index.js | 4 +- app/gabsocial/features/groups/create/index.js | 2 +- app/gabsocial/features/groups/edit/index.js | 2 +- app/gabsocial/features/groups/index/index.js | 4 +- .../features/groups/members/index.js | 6 +- .../features/groups/removed_accounts/index.js | 6 +- .../groups/timeline/components/header.js | 2 +- .../timeline/containers/header_container.js | 2 +- .../features/groups/timeline/index.js | 6 +- .../features/hashtag_timeline/index.js | 12 +-- .../components/column_settings.js | 2 +- .../containers/column_settings_container.js | 4 +- app/gabsocial/features/home_timeline/index.js | 12 +-- app/gabsocial/features/introduction/index.js | 4 +- .../features/list_adder/components/account.js | 2 +- .../features/list_adder/components/list.js | 2 +- app/gabsocial/features/list_adder/index.js | 6 +- .../list_editor/components/account.js | 2 +- .../list_editor/components/edit_list_form.js | 2 +- .../features/list_editor/components/search.js | 2 +- app/gabsocial/features/list_editor/index.js | 6 +- app/gabsocial/features/list_timeline/index.js | 6 +- .../lists/components/new_list_form.js | 2 +- app/gabsocial/features/lists/index.js | 4 +- app/gabsocial/features/mutes/index.js | 4 +- .../components/clear_column_button.js | 2 +- .../components/column_settings.js | 2 +- .../notifications/components/filter_bar.js | 4 +- .../notifications/components/notification.js | 14 ++-- .../components/setting_toggle.js | 2 +- .../containers/column_settings_container.js | 4 +- .../containers/filter_bar_container.js | 2 +- .../containers/notification_container.js | 8 +- app/gabsocial/features/notifications/index.js | 6 +- .../features/pinned_statuses/index.js | 4 +- .../components/column_settings.js | 2 +- .../containers/column_settings_container.js | 2 +- .../features/public_timeline/index.js | 8 +- app/gabsocial/features/reblogs/index.js | 4 +- .../report/components/status_check_box.js | 2 +- .../containers/status_check_box_container.js | 2 +- .../features/search/components/header.js | 4 +- .../features/standalone/compose/index.js | 2 +- .../standalone/hashtag_timeline/index.js | 4 +- .../standalone/public_timeline/index.js | 8 +- .../features/status/components/action_bar.js | 2 +- .../features/status/components/card.js | 6 +- .../status/components/detailed_status.js | 6 +- .../containers/detailed_status_container.js | 32 ++++---- app/gabsocial/features/status/index.js | 16 ++-- .../features/ui/components/actions_modal.js | 2 +- .../features/ui/components/boost_modal.js | 2 +- .../features/ui/components/bundle.js | 2 +- .../ui/components/bundle_column_error.js | 2 +- .../ui/components/bundle_modal_error.js | 2 +- .../features/ui/components/column.js | 2 +- .../features/ui/components/column_header.js | 2 +- .../features/ui/components/columns_area.js | 2 +- .../features/ui/components/compose_modal.js | 2 +- .../ui/components/confirmation_modal.js | 2 +- .../features/ui/components/embed_modal.js | 4 +- .../ui/components/focal_point_modal.js | 8 +- .../ui/components/follow_requests_nav_link.js | 4 +- .../features/ui/components/funding_panel.js | 2 +- .../features/ui/components/hotkeys_modal.js | 2 +- .../features/ui/components/image_loader.js | 16 ++-- .../features/ui/components/list_panel.js | 4 +- .../features/ui/components/media_modal.js | 8 +- .../features/ui/components/modal_root.js | 6 +- .../features/ui/components/mute_modal.js | 2 +- .../ui/components/profile_info_panel.js | 2 +- .../features/ui/components/report_modal.js | 6 +- .../features/ui/components/tabs_bar.js | 10 +-- .../features/ui/components/trends_panel.js | 2 +- .../ui/components/unauthorized_modal.js | 2 +- .../features/ui/components/upload_area.js | 6 +- .../features/ui/components/video_modal.js | 6 +- .../ui/components/who_to_follow_panel.js | 2 +- .../features/ui/components/zoomable_image.js | 8 +- .../ui/containers/bundle_container.js | 6 +- .../features/ui/containers/modal_container.js | 2 +- app/gabsocial/features/ui/index.js | 14 ++-- .../features/ui/util/async-components.js | 80 +++++++++---------- .../ui/util/intersection_observer_wrapper.js | 8 +- .../features/ui/util/react_router_helpers.js | 2 +- app/gabsocial/features/video/index.js | 12 +-- app/gabsocial/locales/locale-data/co.js | 2 +- app/gabsocial/locales/locale-data/oc.js | 2 +- app/gabsocial/pages/group_page.js | 2 +- app/gabsocial/pages/groups_page.js | 2 +- app/gabsocial/pages/home_page.js | 2 +- app/gabsocial/pages/profile_page.js | 2 +- app/gabsocial/stream.js | 8 +- app/packs/public.js | 6 +- 198 files changed, 518 insertions(+), 516 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 86f4e296a..1c06e739e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -59,6 +59,8 @@ module.exports = { }, ], 'comma-style': ['warn', 'last'], + 'space-before-function-paren': ['error', 'never'], + 'space-in-parens': ['error', 'never'], 'consistent-return': 'error', 'dot-notation': 'error', eqeqeq: 'error', diff --git a/app/gabsocial/actions/compose.js b/app/gabsocial/actions/compose.js index aaa5aebc9..45dab4bfe 100644 --- a/app/gabsocial/actions/compose.js +++ b/app/gabsocial/actions/compose.js @@ -151,7 +151,7 @@ export function handleComposeSubmit(dispatch, getState, response, status) { } export function submitCompose(routerHistory, group) { - return function (dispatch, getState) { + return function(dispatch, getState) { if (!getState().get('me')) return; const status = getState().getIn(['compose', 'text'], ''); @@ -177,12 +177,12 @@ export function submitCompose(routerHistory, group) { headers: { 'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey']), }, - }).then(function (response) { + }).then(function(response) { if (response.data.visibility === 'direct' && getState().getIn(['conversations', 'mounted']) <= 0 && routerHistory) { routerHistory.push('/messages'); } handleComposeSubmit(dispatch, getState, response, status); - }).catch(function (error) { + }).catch(function(error) { dispatch(submitComposeFail(error)); }); }; @@ -209,7 +209,7 @@ export function submitComposeFail(error) { }; export function uploadCompose(files) { - return function (dispatch, getState) { + return function(dispatch, getState) { if (!getState().get('me')) return; const uploadLimit = 4; diff --git a/app/gabsocial/actions/height_cache.js b/app/gabsocial/actions/height_cache.js index 4c752993f..8612b2a88 100644 --- a/app/gabsocial/actions/height_cache.js +++ b/app/gabsocial/actions/height_cache.js @@ -1,7 +1,7 @@ export const HEIGHT_CACHE_SET = 'HEIGHT_CACHE_SET'; export const HEIGHT_CACHE_CLEAR = 'HEIGHT_CACHE_CLEAR'; -export function setHeight (key, id, height) { +export function setHeight(key, id, height) { return { type: HEIGHT_CACHE_SET, key, @@ -10,7 +10,7 @@ export function setHeight (key, id, height) { }; }; -export function clearHeight () { +export function clearHeight() { return { type: HEIGHT_CACHE_CLEAR, }; diff --git a/app/gabsocial/actions/interactions.js b/app/gabsocial/actions/interactions.js index b3099a785..7451c14f9 100644 --- a/app/gabsocial/actions/interactions.js +++ b/app/gabsocial/actions/interactions.js @@ -34,17 +34,17 @@ export const UNPIN_SUCCESS = 'UNPIN_SUCCESS'; export const UNPIN_FAIL = 'UNPIN_FAIL'; export function reblog(status) { - return function (dispatch, getState) { + return function(dispatch, getState) { if (!getState().get('me')) return; dispatch(reblogRequest(status)); - api(getState).post(`/api/v1/statuses/${status.get('id')}/reblog`).then(function (response) { + api(getState).post(`/api/v1/statuses/${status.get('id')}/reblog`).then(function(response) { // The reblog API method returns a new status wrapped around the original. In this case we are only // interested in how the original is modified, hence passing it skipping the wrapper dispatch(importFetchedStatus(response.data.reblog)); dispatch(reblogSuccess(status)); - }).catch(function (error) { + }).catch(function(error) { dispatch(reblogFail(status, error)); }); }; @@ -116,15 +116,15 @@ export function unreblogFail(status, error) { }; export function favourite(status) { - return function (dispatch, getState) { + return function(dispatch, getState) { if (!getState().get('me')) return; dispatch(favouriteRequest(status)); - api(getState).post(`/api/v1/statuses/${status.get('id')}/favourite`).then(function (response) { + api(getState).post(`/api/v1/statuses/${status.get('id')}/favourite`).then(function(response) { dispatch(importFetchedStatus(response.data)); dispatch(favouriteSuccess(status)); - }).catch(function (error) { + }).catch(function(error) { dispatch(favouriteFail(status, error)); }); }; @@ -309,7 +309,7 @@ export function pinFail(status, error) { }; }; -export function unpin (status) { +export function unpin(status) { return (dispatch, getState) => { if (!getState().get('me')) return; diff --git a/app/gabsocial/actions/notifications.js b/app/gabsocial/actions/notifications.js index fa0964ac7..9024d2ea6 100644 --- a/app/gabsocial/actions/notifications.js +++ b/app/gabsocial/actions/notifications.js @@ -240,7 +240,7 @@ export function scrollTopNotifications(top) { }; } -export function setFilter (filterType) { +export function setFilter(filterType) { return dispatch => { dispatch({ type: NOTIFICATIONS_FILTER_SET, diff --git a/app/gabsocial/actions/push_notifications/registerer.js b/app/gabsocial/actions/push_notifications/registerer.js index 875c9c187..a07998fc2 100644 --- a/app/gabsocial/actions/push_notifications/registerer.js +++ b/app/gabsocial/actions/push_notifications/registerer.js @@ -46,7 +46,7 @@ const sendSubscriptionToBackend = (subscription, me) => { // Last one checks for payload support: https://web-push-book.gauntface.com/chapter-06/01-non-standards-browsers/#no-payload const supportsPushNotifications = ('serviceWorker' in navigator && 'PushManager' in window && 'getKey' in PushSubscription.prototype); -export function register () { +export function register() { return (dispatch, getState) => { const me = getState().get('me'); dispatch(setBrowserSupport(supportsPushNotifications)); diff --git a/app/gabsocial/actions/push_notifications/setter.js b/app/gabsocial/actions/push_notifications/setter.js index 5561766bf..d77f1e4cd 100644 --- a/app/gabsocial/actions/push_notifications/setter.js +++ b/app/gabsocial/actions/push_notifications/setter.js @@ -3,27 +3,27 @@ export const SET_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_SET_SUBSCRIPTION'; export const CLEAR_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_CLEAR_SUBSCRIPTION'; export const SET_ALERTS = 'PUSH_NOTIFICATIONS_SET_ALERTS'; -export function setBrowserSupport (value) { +export function setBrowserSupport(value) { return { type: SET_BROWSER_SUPPORT, value, }; } -export function setSubscription (subscription) { +export function setSubscription(subscription) { return { type: SET_SUBSCRIPTION, subscription, }; } -export function clearSubscription () { +export function clearSubscription() { return { type: CLEAR_SUBSCRIPTION, }; } -export function setAlerts (path, value) { +export function setAlerts(path, value) { return dispatch => { dispatch({ type: SET_ALERTS, diff --git a/app/gabsocial/actions/streaming.js b/app/gabsocial/actions/streaming.js index e599805e7..d02e18746 100644 --- a/app/gabsocial/actions/streaming.js +++ b/app/gabsocial/actions/streaming.js @@ -13,7 +13,7 @@ import { getLocale } from '../locales'; const { messages } = getLocale(); -export function connectTimelineStream (timelineId, path, pollingRefresh = null, accept = null) { +export function connectTimelineStream(timelineId, path, pollingRefresh = null, accept = null) { return connectStream (path, pollingRefresh, (dispatch, getState) => { const locale = getState().getIn(['meta', 'locale']); @@ -27,7 +27,7 @@ export function connectTimelineStream (timelineId, path, pollingRefresh = null, dispatch(disconnectTimeline(timelineId)); }, - onReceive (data) { + onReceive(data) { switch(data.event) { case 'update': dispatch(updateTimelineQueue(timelineId, JSON.parse(data.payload), accept)); diff --git a/app/gabsocial/api.js b/app/gabsocial/api.js index d7eaec283..99c46dcaf 100644 --- a/app/gabsocial/api.js +++ b/app/gabsocial/api.js @@ -34,7 +34,7 @@ export default getState => { 'Authorization': `Bearer ${access_token}`, } : {}), - transformResponse: [function (data) { + transformResponse: [function(data) { try { return JSON.parse(data); } catch(Exception) { diff --git a/app/gabsocial/components/account.js b/app/gabsocial/components/account.js index 99713ad32..bc236da85 100644 --- a/app/gabsocial/components/account.js +++ b/app/gabsocial/components/account.js @@ -67,7 +67,7 @@ class Account extends ImmutablePureComponent { this.props.onActionClick(this.props.account); } - render () { + render() { const { account, intl, hidden, onActionClick, actionIcon, actionTitle, me } = this.props; if (!account) { diff --git a/app/gabsocial/components/attachment_list.js b/app/gabsocial/components/attachment_list.js index 2f873ada1..cd401f26a 100644 --- a/app/gabsocial/components/attachment_list.js +++ b/app/gabsocial/components/attachment_list.js @@ -13,7 +13,7 @@ export default class AttachmentList extends ImmutablePureComponent { compact: PropTypes.bool, }; - render () { + render() { const { media, compact } = this.props; if (compact) { diff --git a/app/gabsocial/components/autosuggest_emoji.js b/app/gabsocial/components/autosuggest_emoji.js index ce4383a60..2f4936f92 100644 --- a/app/gabsocial/components/autosuggest_emoji.js +++ b/app/gabsocial/components/autosuggest_emoji.js @@ -10,7 +10,7 @@ export default class AutosuggestEmoji extends React.PureComponent { emoji: PropTypes.object.isRequired, }; - render () { + render() { const { emoji } = this.props; let url; diff --git a/app/gabsocial/components/autosuggest_input.js b/app/gabsocial/components/autosuggest_input.js index c7d965b53..3136325a0 100644 --- a/app/gabsocial/components/autosuggest_input.js +++ b/app/gabsocial/components/autosuggest_input.js @@ -153,7 +153,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { this.input.focus(); } - componentWillReceiveProps (nextProps) { + componentWillReceiveProps(nextProps) { if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { this.setState({ suggestionsHidden: false }); } @@ -185,7 +185,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { ); } - render () { + render() { const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength } = this.props; const { suggestionsHidden } = this.state; const style = { direction: 'ltr' }; diff --git a/app/gabsocial/components/autosuggest_textarea.js b/app/gabsocial/components/autosuggest_textarea.js index a892bfae1..cae6116d4 100644 --- a/app/gabsocial/components/autosuggest_textarea.js +++ b/app/gabsocial/components/autosuggest_textarea.js @@ -159,7 +159,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { this.textarea.focus(); } - componentWillReceiveProps (nextProps) { + componentWillReceiveProps(nextProps) { if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { this.setState({ suggestionsHidden: false }); } @@ -198,7 +198,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { ); } - render () { + render() { const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, children } = this.props; const { suggestionsHidden } = this.state; const style = { direction: 'ltr' }; diff --git a/app/gabsocial/components/avatar.js b/app/gabsocial/components/avatar.js index 07a74760b..c64cb4bf7 100644 --- a/app/gabsocial/components/avatar.js +++ b/app/gabsocial/components/avatar.js @@ -32,7 +32,7 @@ export default class Avatar extends React.PureComponent { this.setState({ hovering: false }); } - render () { + render() { const { account, size, animate, inline } = this.props; if (!account) return null; const { hovering } = this.state; diff --git a/app/gabsocial/components/avatar_composite.js b/app/gabsocial/components/avatar_composite.js index 4a9a73c51..3ff3a69f1 100644 --- a/app/gabsocial/components/avatar_composite.js +++ b/app/gabsocial/components/avatar_composite.js @@ -15,7 +15,7 @@ export default class AvatarComposite extends React.PureComponent { animate: autoPlayGif, }; - renderItem (account, size, index) { + renderItem(account, size, index) { const { animate } = this.props; let width = 50; diff --git a/app/gabsocial/components/button.js b/app/gabsocial/components/button.js index 51e2e6a7a..2e8cf1cc1 100644 --- a/app/gabsocial/components/button.js +++ b/app/gabsocial/components/button.js @@ -34,7 +34,7 @@ export default class Button extends React.PureComponent { this.node.focus(); } - render () { + render() { const style = { padding: `0 ${this.props.size / 2.25}px`, height: `${this.props.size}px`, diff --git a/app/gabsocial/components/column.js b/app/gabsocial/components/column.js index 885f77f37..f7466c15e 100644 --- a/app/gabsocial/components/column.js +++ b/app/gabsocial/components/column.js @@ -8,7 +8,7 @@ export default class Column extends React.PureComponent { label: PropTypes.string, }; - render () { + render() { const { label, children } = this.props; return ( diff --git a/app/gabsocial/components/column_back_button.js b/app/gabsocial/components/column_back_button.js index f7190e5bb..4fa6a6ab8 100644 --- a/app/gabsocial/components/column_back_button.js +++ b/app/gabsocial/components/column_back_button.js @@ -17,7 +17,7 @@ export default class ColumnBackButton extends React.PureComponent { } } - render () { + render() { return ( ); diff --git a/app/gabsocial/features/notifications/components/column_settings.js b/app/gabsocial/features/notifications/components/column_settings.js index 464c05444..47edf3431 100644 --- a/app/gabsocial/features/notifications/components/column_settings.js +++ b/app/gabsocial/features/notifications/components/column_settings.js @@ -18,7 +18,7 @@ export default class ColumnSettings extends React.PureComponent { this.props.onChange(['push', ...path], checked); } - render () { + render() { const { settings, pushSettings, onChange, onClear } = this.props; const filterShowStr = ; diff --git a/app/gabsocial/features/notifications/components/filter_bar.js b/app/gabsocial/features/notifications/components/filter_bar.js index 7444d48e6..5fa131fd7 100644 --- a/app/gabsocial/features/notifications/components/filter_bar.js +++ b/app/gabsocial/features/notifications/components/filter_bar.js @@ -21,11 +21,11 @@ class FilterBar extends React.PureComponent { intl: PropTypes.object.isRequired, }; - onClick (notificationType) { + onClick(notificationType) { return () => this.props.selectFilter(notificationType); } - render () { + render() { const { selectedFilter, advancedMode, intl } = this.props; const renderedElement = !advancedMode ? (
diff --git a/app/gabsocial/features/notifications/components/notification.js b/app/gabsocial/features/notifications/components/notification.js index 68e4bf327..5094ade36 100644 --- a/app/gabsocial/features/notifications/components/notification.js +++ b/app/gabsocial/features/notifications/components/notification.js @@ -88,7 +88,7 @@ class Notification extends ImmutablePureComponent { if (status) this.props.onToggleHidden(status); } - getHandlers () { + getHandlers() { return { reply: this.handleMention, favourite: this.handleHotkeyFavourite, @@ -102,7 +102,7 @@ class Notification extends ImmutablePureComponent { }; } - renderFollow (notification, account, link) { + renderFollow(notification, account, link) { const { intl } = this.props; return ( @@ -124,7 +124,7 @@ class Notification extends ImmutablePureComponent { ); } - renderMention (notification) { + renderMention(notification) { return ( ({ const mapDispatchToProps = (dispatch, { intl }) => ({ - onChange (path, checked) { + onChange(path, checked) { if (path[0] === 'push') { dispatch(changePushNotifications(path.slice(1), checked)); } else if (path[0] === 'quickFilter') { @@ -30,7 +30,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ } }, - onClear () { + onClear() { dispatch(openModal('CONFIRM', { message: intl.formatMessage(messages.clearMessage), confirm: intl.formatMessage(messages.clearConfirm), diff --git a/app/gabsocial/features/notifications/containers/filter_bar_container.js b/app/gabsocial/features/notifications/containers/filter_bar_container.js index 4d495c290..297067dd6 100644 --- a/app/gabsocial/features/notifications/containers/filter_bar_container.js +++ b/app/gabsocial/features/notifications/containers/filter_bar_container.js @@ -8,7 +8,7 @@ const makeMapStateToProps = state => ({ }); const mapDispatchToProps = (dispatch) => ({ - selectFilter (newActiveFilter) { + selectFilter(newActiveFilter) { dispatch(setFilter(newActiveFilter)); }, }); diff --git a/app/gabsocial/features/notifications/containers/notification_container.js b/app/gabsocial/features/notifications/containers/notification_container.js index 78576c760..1f225df5d 100644 --- a/app/gabsocial/features/notifications/containers/notification_container.js +++ b/app/gabsocial/features/notifications/containers/notification_container.js @@ -35,11 +35,11 @@ const mapDispatchToProps = dispatch => ({ dispatch(mentionCompose(account, router)); }, - onModalReblog (status) { + onModalReblog(status) { dispatch(reblog(status)); }, - onReblog (status, e) { + onReblog(status, e) { if (status.get('reblogged')) { dispatch(unreblog(status)); } else { @@ -51,7 +51,7 @@ const mapDispatchToProps = dispatch => ({ } }, - onFavourite (status) { + onFavourite(status) { if (status.get('favourited')) { dispatch(unfavourite(status)); } else { @@ -59,7 +59,7 @@ const mapDispatchToProps = dispatch => ({ } }, - onToggleHidden (status) { + onToggleHidden(status) { if (status.get('hidden')) { dispatch(revealStatus(status.get('id'))); } else { diff --git a/app/gabsocial/features/notifications/index.js b/app/gabsocial/features/notifications/index.js index 0f932627c..d0eeafc0d 100644 --- a/app/gabsocial/features/notifications/index.js +++ b/app/gabsocial/features/notifications/index.js @@ -64,7 +64,7 @@ class Notifications extends React.PureComponent { totalQueuedNotificationsCount: PropTypes.number, }; - componentWillUnmount () { + componentWillUnmount() { this.handleLoadOlder.cancel(); this.handleScrollToTop.cancel(); this.handleScroll.cancel(); @@ -107,7 +107,7 @@ class Notifications extends React.PureComponent { this._selectChild(elementIndex, false); } - _selectChild (index, align_top) { + _selectChild(index, align_top) { const container = this.column.node; const element = container.querySelector(`article:nth-of-type(${index + 1}) .focusable`); @@ -125,7 +125,7 @@ class Notifications extends React.PureComponent { this.props.dispatch(dequeueNotifications()); }; - render () { + render() { const { intl, notifications, isLoading, isUnread, hasMore, showFilterBar, totalQueuedNotificationsCount } = this.props; const emptyMessage = ; diff --git a/app/gabsocial/features/pinned_statuses/index.js b/app/gabsocial/features/pinned_statuses/index.js index 8328ae616..be10e2914 100644 --- a/app/gabsocial/features/pinned_statuses/index.js +++ b/app/gabsocial/features/pinned_statuses/index.js @@ -30,11 +30,11 @@ class PinnedStatuses extends ImmutablePureComponent { isMyAccount: PropTypes.bool.isRequired, }; - componentWillMount () { + componentWillMount() { this.props.dispatch(fetchPinnedStatuses()); } - render () { + render() { const { statusIds, hasMore, isMyAccount } = this.props; if (!isMyAccount) { diff --git a/app/gabsocial/features/public_timeline/components/column_settings.js b/app/gabsocial/features/public_timeline/components/column_settings.js index 7adeb674a..d46dd0176 100644 --- a/app/gabsocial/features/public_timeline/components/column_settings.js +++ b/app/gabsocial/features/public_timeline/components/column_settings.js @@ -13,7 +13,7 @@ class ColumnSettings extends React.PureComponent { intl: PropTypes.object.isRequired, }; - render () { + render() { const { settings, onChange } = this.props; return ( diff --git a/app/gabsocial/features/public_timeline/containers/column_settings_container.js b/app/gabsocial/features/public_timeline/containers/column_settings_container.js index 192b793a9..93ef2c4df 100644 --- a/app/gabsocial/features/public_timeline/containers/column_settings_container.js +++ b/app/gabsocial/features/public_timeline/containers/column_settings_container.js @@ -8,7 +8,7 @@ const mapStateToProps = state => ({ const mapDispatchToProps = (dispatch) => { return { - onChange (key, checked) { + onChange(key, checked) { dispatch(changeSetting(['public', ...key], checked)); }, }; diff --git a/app/gabsocial/features/public_timeline/index.js b/app/gabsocial/features/public_timeline/index.js index 46b009484..79e5d01ce 100644 --- a/app/gabsocial/features/public_timeline/index.js +++ b/app/gabsocial/features/public_timeline/index.js @@ -45,13 +45,13 @@ class CommunityTimeline extends React.PureComponent { siteTitle: PropTypes.string, }; - componentDidMount () { + componentDidMount() { const { dispatch, onlyMedia } = this.props; dispatch(expandPublicTimeline({ onlyMedia })); this.disconnect = dispatch(connectPublicStream({ onlyMedia })); } - componentDidUpdate (prevProps) { + componentDidUpdate(prevProps) { if (prevProps.onlyMedia !== this.props.onlyMedia) { const { dispatch, onlyMedia } = this.props; this.disconnect(); @@ -61,7 +61,7 @@ class CommunityTimeline extends React.PureComponent { } } - componentWillUnmount () { + componentWillUnmount() { if (this.disconnect) { this.disconnect(); this.disconnect = null; @@ -73,7 +73,7 @@ class CommunityTimeline extends React.PureComponent { dispatch(expandPublicTimeline({ maxId, onlyMedia })); } - render () { + render() { const { intl, hasUnread, onlyMedia, timelineId, siteTitle } = this.props; return ( diff --git a/app/gabsocial/features/reblogs/index.js b/app/gabsocial/features/reblogs/index.js index 5e746a4ee..d71c4330b 100644 --- a/app/gabsocial/features/reblogs/index.js +++ b/app/gabsocial/features/reblogs/index.js @@ -36,7 +36,7 @@ class Reblogs extends ImmutablePureComponent { status: ImmutablePropTypes.map, }; - componentWillMount () { + componentWillMount() { this.props.dispatch(fetchReblogs(this.props.params.statusId)); this.props.dispatch(fetchStatus(this.props.params.statusId)); } @@ -48,7 +48,7 @@ class Reblogs extends ImmutablePureComponent { } } - render () { + render() { const { accountIds, status } = this.props; if (!accountIds) { diff --git a/app/gabsocial/features/report/components/status_check_box.js b/app/gabsocial/features/report/components/status_check_box.js index 9991216d4..c3853736f 100644 --- a/app/gabsocial/features/report/components/status_check_box.js +++ b/app/gabsocial/features/report/components/status_check_box.js @@ -16,7 +16,7 @@ export default class StatusCheckBox extends React.PureComponent { disabled: PropTypes.bool, }; - render () { + render() { const { status, checked, onToggle, disabled } = this.props; let media = null; diff --git a/app/gabsocial/features/report/containers/status_check_box_container.js b/app/gabsocial/features/report/containers/status_check_box_container.js index 48cd0319b..b3ef4cbd6 100644 --- a/app/gabsocial/features/report/containers/status_check_box_container.js +++ b/app/gabsocial/features/report/containers/status_check_box_container.js @@ -10,7 +10,7 @@ const mapStateToProps = (state, { id }) => ({ const mapDispatchToProps = (dispatch, { id }) => ({ - onToggle (e) { + onToggle(e) { dispatch(toggleStatusReport(id, e.target.checked)); }, diff --git a/app/gabsocial/features/search/components/header.js b/app/gabsocial/features/search/components/header.js index 058aad92f..cf9415b8f 100644 --- a/app/gabsocial/features/search/components/header.js +++ b/app/gabsocial/features/search/components/header.js @@ -21,14 +21,14 @@ class Header extends ImmutablePureComponent { submittedValue: '', }; - componentWillReceiveProps (nextProps) { + componentWillReceiveProps(nextProps) { if (nextProps.submitted) { const submittedValue = nextProps.value; this.setState({ submittedValue }); } } - render () { + render() { const { submittedValue } = this.state; if (!submittedValue) { diff --git a/app/gabsocial/features/standalone/compose/index.js b/app/gabsocial/features/standalone/compose/index.js index 0d764575f..c9ac782e7 100644 --- a/app/gabsocial/features/standalone/compose/index.js +++ b/app/gabsocial/features/standalone/compose/index.js @@ -6,7 +6,7 @@ import ModalContainer from '../../ui/containers/modal_container'; export default class Compose extends React.PureComponent { - render () { + render() { return (
diff --git a/app/gabsocial/features/standalone/hashtag_timeline/index.js b/app/gabsocial/features/standalone/hashtag_timeline/index.js index 0868965a0..bc0280fde 100644 --- a/app/gabsocial/features/standalone/hashtag_timeline/index.js +++ b/app/gabsocial/features/standalone/hashtag_timeline/index.js @@ -26,7 +26,7 @@ class HashtagTimeline extends React.PureComponent { hashtag: PropTypes.string.isRequired, }; - componentDidMount () { + componentDidMount() { const { dispatch, hashtag } = this.props; dispatch(expandHashtagTimeline(hashtag)); @@ -52,7 +52,7 @@ class HashtagTimeline extends React.PureComponent { this.masonry.forcePack(); }, 50) - render () { + render() { const { statusIds, hasMore, isLoading } = this.props; const sizes = [ diff --git a/app/gabsocial/features/standalone/public_timeline/index.js b/app/gabsocial/features/standalone/public_timeline/index.js index e1565e997..f700efe31 100644 --- a/app/gabsocial/features/standalone/public_timeline/index.js +++ b/app/gabsocial/features/standalone/public_timeline/index.js @@ -30,17 +30,17 @@ class PublicTimeline extends React.PureComponent { local: PropTypes.bool, }; - componentDidMount () { + componentDidMount() { this._connect(); } - componentDidUpdate (prevProps) { + componentDidUpdate(prevProps) { if (prevProps.local !== this.props.local) { this._connect(); } } - _connect () { + _connect() { const { dispatch, local } = this.props; dispatch(local ? expandCommunityTimeline() : expandPublicTimeline()); @@ -67,7 +67,7 @@ class PublicTimeline extends React.PureComponent { this.masonry.forcePack(); }, 50) - render () { + render() { const { statusIds, hasMore, isLoading } = this.props; const sizes = [ diff --git a/app/gabsocial/features/status/components/action_bar.js b/app/gabsocial/features/status/components/action_bar.js index c78a2f8f9..e9798e1a6 100644 --- a/app/gabsocial/features/status/components/action_bar.js +++ b/app/gabsocial/features/status/components/action_bar.js @@ -163,7 +163,7 @@ class ActionBar extends React.PureComponent { } } - render () { + render() { const { status, intl, me } = this.props; const publicStatus = ['public', 'unlisted'].includes(status.get('visibility')); diff --git a/app/gabsocial/features/status/components/card.js b/app/gabsocial/features/status/components/card.js index b050e928e..fe02a9bf4 100644 --- a/app/gabsocial/features/status/components/card.js +++ b/app/gabsocial/features/status/components/card.js @@ -75,7 +75,7 @@ export default class Card extends React.PureComponent { embedded: false, }; - componentWillReceiveProps (nextProps) { + componentWillReceiveProps(nextProps) { if (!Immutable.is(this.props.card, nextProps.card)) { this.setState({ embedded: false }); } @@ -119,7 +119,7 @@ export default class Card extends React.PureComponent { } } - renderVideo () { + renderVideo() { const { card } = this.props; const content = { __html: addAutoPlay(card.get('html')) }; const { width } = this.state; @@ -136,7 +136,7 @@ export default class Card extends React.PureComponent { ); } - render () { + render() { const { card, maxDescription, compact } = this.props; const { width, embedded } = this.state; diff --git a/app/gabsocial/features/status/components/detailed_status.js b/app/gabsocial/features/status/components/detailed_status.js index 5582e07af..8fd01ba62 100644 --- a/app/gabsocial/features/status/components/detailed_status.js +++ b/app/gabsocial/features/status/components/detailed_status.js @@ -46,7 +46,7 @@ export default class DetailedStatus extends ImmutablePureComponent { this.props.onToggleHidden(this.props.status); } - _measureHeight (heightJustChanged) { + _measureHeight(heightJustChanged) { if (this.props.measureHeight && this.node) { scheduleIdleTask(() => this.node && this.setState({ height: Math.ceil(this.node.scrollHeight) + 1 })); @@ -61,7 +61,7 @@ export default class DetailedStatus extends ImmutablePureComponent { this._measureHeight(); } - componentDidUpdate (prevProps, prevState) { + componentDidUpdate(prevProps, prevState) { this._measureHeight(prevState.height !== this.state.height); } @@ -79,7 +79,7 @@ export default class DetailedStatus extends ImmutablePureComponent { window.open(href, 'gabsocial-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes'); } - render () { + render() { const status = (this.props.status && this.props.status.get('reblog')) ? this.props.status.get('reblog') : this.props.status; const outerStyle = { boxSizing: 'border-box' }; const { compact } = this.props; diff --git a/app/gabsocial/features/status/containers/detailed_status_container.js b/app/gabsocial/features/status/containers/detailed_status_container.js index 79dead890..158156748 100644 --- a/app/gabsocial/features/status/containers/detailed_status_container.js +++ b/app/gabsocial/features/status/containers/detailed_status_container.js @@ -54,7 +54,7 @@ const makeMapStateToProps = () => { const mapDispatchToProps = (dispatch, { intl }) => ({ - onReply (status, router) { + onReply(status, router) { dispatch((_, getState) => { let state = getState(); if (state.getIn(['compose', 'text']).trim().length !== 0) { @@ -69,11 +69,11 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ }); }, - onModalReblog (status) { + onModalReblog(status) { dispatch(reblog(status)); }, - onReblog (status, e) { + onReblog(status, e) { if (status.get('reblogged')) { dispatch(unreblog(status)); } else { @@ -85,7 +85,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ } }, - onFavourite (status) { + onFavourite(status) { if (status.get('favourited')) { dispatch(unfavourite(status)); } else { @@ -93,7 +93,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ } }, - onPin (status) { + onPin(status) { if (status.get('pinned')) { dispatch(unpin(status)); } else { @@ -101,14 +101,14 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ } }, - onEmbed (status) { + onEmbed(status) { dispatch(openModal('EMBED', { url: status.get('url'), onError: error => dispatch(showAlertForError(error)), })); }, - onDelete (status, history, withRedraft = false) { + onDelete(status, history, withRedraft = false) { if (!deleteModal) { dispatch(deleteStatus(status.get('id'), history, withRedraft)); } else { @@ -120,23 +120,23 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ } }, - onDirect (account, router) { + onDirect(account, router) { dispatch(directCompose(account, router)); }, - onMention (account, router) { + onMention(account, router) { dispatch(mentionCompose(account, router)); }, - onOpenMedia (media, index) { + onOpenMedia(media, index) { dispatch(openModal('MEDIA', { media, index })); }, - onOpenVideo (media, time) { + onOpenVideo(media, time) { dispatch(openModal('VIDEO', { media, time })); }, - onBlock (status) { + onBlock(status) { const account = status.get('account'); dispatch(openModal('CONFIRM', { message: @{account.get('acct')} }} />, @@ -150,15 +150,15 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ })); }, - onReport (status) { + onReport(status) { dispatch(initReport(status.get('account'), status)); }, - onMute (account) { + onMute(account) { dispatch(initMuteModal(account)); }, - onMuteConversation (status) { + onMuteConversation(status) { if (status.get('muted')) { dispatch(unmuteStatus(status.get('id'))); } else { @@ -166,7 +166,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ } }, - onToggleHidden (status) { + onToggleHidden(status) { if (status.get('hidden')) { dispatch(revealStatus(status.get('id'))); } else { diff --git a/app/gabsocial/features/status/index.js b/app/gabsocial/features/status/index.js index 0f6d68d81..2dd149b5e 100644 --- a/app/gabsocial/features/status/index.js +++ b/app/gabsocial/features/status/index.js @@ -138,15 +138,15 @@ class Status extends ImmutablePureComponent { loadedStatusId: undefined, }; - componentWillMount () { + componentWillMount() { this.props.dispatch(fetchStatus(this.props.params.statusId)); } - componentDidMount () { + componentDidMount() { attachFullscreenListener(this.onFullScreenChange); } - componentWillReceiveProps (nextProps) { + componentWillReceiveProps(nextProps) { if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) { this._scrolledIntoView = false; this.props.dispatch(fetchStatus(nextProps.params.statusId)); @@ -363,7 +363,7 @@ class Status extends ImmutablePureComponent { } } - _selectChild (index, align_top) { + _selectChild(index, align_top) { const container = this.node; const element = container.querySelectorAll('.focusable')[index]; @@ -377,7 +377,7 @@ class Status extends ImmutablePureComponent { } } - renderChildren (list) { + renderChildren(list) { return list.map(id => (
diff --git a/app/gabsocial/features/ui/components/boost_modal.js b/app/gabsocial/features/ui/components/boost_modal.js index 7296a1be4..8b5618f86 100644 --- a/app/gabsocial/features/ui/components/boost_modal.js +++ b/app/gabsocial/features/ui/components/boost_modal.js @@ -58,7 +58,7 @@ class BoostModal extends ImmutablePureComponent { this.button = c; } - render () { + render() { const { status, intl } = this.props; const buttonText = status.get('reblogged') ? messages.cancel_reblog : messages.reblog; diff --git a/app/gabsocial/features/ui/components/bundle.js b/app/gabsocial/features/ui/components/bundle.js index a60ace35b..a3c7ab77e 100644 --- a/app/gabsocial/features/ui/components/bundle.js +++ b/app/gabsocial/features/ui/components/bundle.js @@ -43,7 +43,7 @@ class Bundle extends React.PureComponent { } } - componentWillUnmount () { + componentWillUnmount() { if (this.timeout) { clearTimeout(this.timeout); } diff --git a/app/gabsocial/features/ui/components/bundle_column_error.js b/app/gabsocial/features/ui/components/bundle_column_error.js index a886cdcc3..d81bfb512 100644 --- a/app/gabsocial/features/ui/components/bundle_column_error.js +++ b/app/gabsocial/features/ui/components/bundle_column_error.js @@ -23,7 +23,7 @@ class BundleColumnError extends React.PureComponent { this.props.onRetry(); } - render () { + render() { const { intl: { formatMessage } } = this.props; return ( diff --git a/app/gabsocial/features/ui/components/bundle_modal_error.js b/app/gabsocial/features/ui/components/bundle_modal_error.js index f9365b95b..4c5c82dcb 100644 --- a/app/gabsocial/features/ui/components/bundle_modal_error.js +++ b/app/gabsocial/features/ui/components/bundle_modal_error.js @@ -22,7 +22,7 @@ class BundleModalError extends React.PureComponent { this.props.onRetry(); } - render () { + render() { const { onClose, intl: { formatMessage } } = this.props; // Keep the markup in sync with diff --git a/app/gabsocial/features/ui/components/column.js b/app/gabsocial/features/ui/components/column.js index 24562c057..888b2c04e 100644 --- a/app/gabsocial/features/ui/components/column.js +++ b/app/gabsocial/features/ui/components/column.js @@ -16,7 +16,7 @@ export default class Column extends React.PureComponent { backBtnSlim: PropTypes.bool, }; - render () { + render() { const { heading, icon, children, active, hideHeadingOnMobile, backBtnSlim } = this.props; const showHeading = heading && (!hideHeadingOnMobile || (hideHeadingOnMobile && !isMobile(window.innerWidth))); diff --git a/app/gabsocial/features/ui/components/column_header.js b/app/gabsocial/features/ui/components/column_header.js index abea7b9d3..03c73bc3c 100644 --- a/app/gabsocial/features/ui/components/column_header.js +++ b/app/gabsocial/features/ui/components/column_header.js @@ -17,7 +17,7 @@ export default class ColumnHeader extends React.PureComponent { this.props.onClick(); } - render () { + render() { const { icon, type, active, columnHeaderId } = this.props; let iconElement = ''; diff --git a/app/gabsocial/features/ui/components/columns_area.js b/app/gabsocial/features/ui/components/columns_area.js index 2e1b53595..cc35321b2 100644 --- a/app/gabsocial/features/ui/components/columns_area.js +++ b/app/gabsocial/features/ui/components/columns_area.js @@ -14,7 +14,7 @@ class ColumnsArea extends ImmutablePureComponent { layout: PropTypes.object, }; - render () { + render() { const { children } = this.props; const layout = this.props.layout || { LEFT:null, RIGHT:null }; diff --git a/app/gabsocial/features/ui/components/compose_modal.js b/app/gabsocial/features/ui/components/compose_modal.js index f4bb0983d..9cd41a9a0 100644 --- a/app/gabsocial/features/ui/components/compose_modal.js +++ b/app/gabsocial/features/ui/components/compose_modal.js @@ -47,7 +47,7 @@ class ComposeModal extends ImmutablePureComponent { } }; - render () { + render() { const { intl } = this.props; return ( diff --git a/app/gabsocial/features/ui/components/confirmation_modal.js b/app/gabsocial/features/ui/components/confirmation_modal.js index 913cd1af5..d4caac3cd 100644 --- a/app/gabsocial/features/ui/components/confirmation_modal.js +++ b/app/gabsocial/features/ui/components/confirmation_modal.js @@ -41,7 +41,7 @@ class ConfirmationModal extends React.PureComponent { this.button = c; } - render () { + render() { const { message, confirm, secondary } = this.props; return ( diff --git a/app/gabsocial/features/ui/components/embed_modal.js b/app/gabsocial/features/ui/components/embed_modal.js index e518d0f84..cfb83f347 100644 --- a/app/gabsocial/features/ui/components/embed_modal.js +++ b/app/gabsocial/features/ui/components/embed_modal.js @@ -19,7 +19,7 @@ class EmbedModal extends ImmutablePureComponent { oembed: null, }; - componentDidMount () { + componentDidMount() { const { url } = this.props; this.setState({ loading: true }); @@ -49,7 +49,7 @@ class EmbedModal extends ImmutablePureComponent { e.target.select(); } - render () { + render() { const { oembed } = this.state; return ( diff --git a/app/gabsocial/features/ui/components/focal_point_modal.js b/app/gabsocial/features/ui/components/focal_point_modal.js index 7488a3598..9ec15768a 100644 --- a/app/gabsocial/features/ui/components/focal_point_modal.js +++ b/app/gabsocial/features/ui/components/focal_point_modal.js @@ -34,17 +34,17 @@ class FocalPointModal extends ImmutablePureComponent { dragging: false, }; - componentWillMount () { + componentWillMount() { this.updatePositionFromMedia(this.props.media); } - componentWillReceiveProps (nextProps) { + componentWillReceiveProps(nextProps) { if (this.props.media.get('id') !== nextProps.media.get('id')) { this.updatePositionFromMedia(nextProps.media); } } - componentWillUnmount () { + componentWillUnmount() { document.removeEventListener('mousemove', this.handleMouseMove); document.removeEventListener('mouseup', this.handleMouseUp); } @@ -95,7 +95,7 @@ class FocalPointModal extends ImmutablePureComponent { this.node = c; } - render () { + render() { const { media } = this.props; const { x, y, dragging } = this.state; diff --git a/app/gabsocial/features/ui/components/follow_requests_nav_link.js b/app/gabsocial/features/ui/components/follow_requests_nav_link.js index 476de09af..1fb45c594 100644 --- a/app/gabsocial/features/ui/components/follow_requests_nav_link.js +++ b/app/gabsocial/features/ui/components/follow_requests_nav_link.js @@ -25,7 +25,7 @@ class FollowRequestsNavLink extends React.Component { count: PropTypes.number.isRequired, }; - componentDidMount () { + componentDidMount() { const { dispatch, locked } = this.props; if (locked) { @@ -33,7 +33,7 @@ class FollowRequestsNavLink extends React.Component { } } - render () { + render() { const { locked, count } = this.props; if (!locked || count === 0) { diff --git a/app/gabsocial/features/ui/components/funding_panel.js b/app/gabsocial/features/ui/components/funding_panel.js index e62ed3677..9720129ea 100644 --- a/app/gabsocial/features/ui/components/funding_panel.js +++ b/app/gabsocial/features/ui/components/funding_panel.js @@ -7,7 +7,7 @@ import { fetchFunding } from 'gabsocial/actions/patron'; class FundingPanel extends ImmutablePureComponent { - componentDidMount () { + componentDidMount() { this.props.dispatch(fetchFunding()); } diff --git a/app/gabsocial/features/ui/components/hotkeys_modal.js b/app/gabsocial/features/ui/components/hotkeys_modal.js index a3b54579e..a402ce396 100644 --- a/app/gabsocial/features/ui/components/hotkeys_modal.js +++ b/app/gabsocial/features/ui/components/hotkeys_modal.js @@ -16,7 +16,7 @@ class HotkeysModal extends ImmutablePureComponent { onClose: PropTypes.func.isRequired, }; - render () { + render() { const { intl, onClose } = this.props; return ( diff --git a/app/gabsocial/features/ui/components/image_loader.js b/app/gabsocial/features/ui/components/image_loader.js index 5e1cf75af..02a0441fa 100644 --- a/app/gabsocial/features/ui/components/image_loader.js +++ b/app/gabsocial/features/ui/components/image_loader.js @@ -38,21 +38,21 @@ export default class ImageLoader extends React.PureComponent { return this._canvasContext; } - componentDidMount () { + componentDidMount() { this.loadImage(this.props); } - componentWillReceiveProps (nextProps) { + componentWillReceiveProps(nextProps) { if (this.props.src !== nextProps.src) { this.loadImage(nextProps); } } - componentWillUnmount () { + componentWillUnmount() { this.removeEventListeners(); } - loadImage (props) { + loadImage(props) { this.removeEventListeners(); this.setState({ loading: true, error: false }); Promise.all([ @@ -87,7 +87,7 @@ export default class ImageLoader extends React.PureComponent { this.removers.push(removeEventListeners); }) - clearPreviewCanvas () { + clearPreviewCanvas() { const { width, height } = this.canvas; this.canvasContext.clearRect(0, 0, width, height); } @@ -112,12 +112,12 @@ export default class ImageLoader extends React.PureComponent { this.removers.push(removeEventListeners); }); - removeEventListeners () { + removeEventListeners() { this.removers.forEach(listeners => listeners()); this.removers = []; } - hasSize () { + hasSize() { const { width, height } = this.props; return typeof width === 'number' && typeof height === 'number'; } @@ -127,7 +127,7 @@ export default class ImageLoader extends React.PureComponent { if (c) this.setState({ width: c.offsetWidth }); } - render () { + render() { const { alt, src, width, height, onClick } = this.props; const { loading } = this.state; diff --git a/app/gabsocial/features/ui/components/list_panel.js b/app/gabsocial/features/ui/components/list_panel.js index d1a79009e..d0af67c0c 100644 --- a/app/gabsocial/features/ui/components/list_panel.js +++ b/app/gabsocial/features/ui/components/list_panel.js @@ -29,12 +29,12 @@ class ListPanel extends ImmutablePureComponent { lists: ImmutablePropTypes.list, }; - componentDidMount () { + componentDidMount() { const { dispatch } = this.props; dispatch(fetchLists()); } - render () { + render() { const { lists } = this.props; if (!lists || lists.isEmpty()) { diff --git a/app/gabsocial/features/ui/components/media_modal.js b/app/gabsocial/features/ui/components/media_modal.js index cbaa5b907..a95033d90 100644 --- a/app/gabsocial/features/ui/components/media_modal.js +++ b/app/gabsocial/features/ui/components/media_modal.js @@ -71,7 +71,7 @@ class MediaModal extends ImmutablePureComponent { } } - componentDidMount () { + componentDidMount() { window.addEventListener('keydown', this.handleKeyDown, false); if (this.context.router) { @@ -85,7 +85,7 @@ class MediaModal extends ImmutablePureComponent { } } - componentWillUnmount () { + componentWillUnmount() { window.removeEventListener('keydown', this.handleKeyDown); if (this.context.router) { @@ -97,7 +97,7 @@ class MediaModal extends ImmutablePureComponent { } } - getIndex () { + getIndex() { return this.state.index !== null ? this.state.index : this.props.index; } @@ -114,7 +114,7 @@ class MediaModal extends ImmutablePureComponent { } } - render () { + render() { const { media, status, intl, onClose } = this.props; const { navigationHidden } = this.state; diff --git a/app/gabsocial/features/ui/components/modal_root.js b/app/gabsocial/features/ui/components/modal_root.js index c365f75ff..b6cfa5737 100644 --- a/app/gabsocial/features/ui/components/modal_root.js +++ b/app/gabsocial/features/ui/components/modal_root.js @@ -47,11 +47,11 @@ export default class ModalRoot extends React.PureComponent { onClose: PropTypes.func.isRequired, }; - getSnapshotBeforeUpdate () { + getSnapshotBeforeUpdate() { return { visible: !!this.props.type }; } - componentDidUpdate (prevProps, prevState, { visible }) { + componentDidUpdate(prevProps, prevState, { visible }) { if (visible) { document.body.classList.add('with-modals--active'); } else { @@ -72,7 +72,7 @@ export default class ModalRoot extends React.PureComponent { onClose(type); } - render () { + render() { const { type, props } = this.props; const visible = !!type; diff --git a/app/gabsocial/features/ui/components/mute_modal.js b/app/gabsocial/features/ui/components/mute_modal.js index ac356b42a..d998ac627 100644 --- a/app/gabsocial/features/ui/components/mute_modal.js +++ b/app/gabsocial/features/ui/components/mute_modal.js @@ -68,7 +68,7 @@ class MuteModal extends React.PureComponent { this.props.onToggleNotifications(); } - render () { + render() { const { account, notifications } = this.props; return ( diff --git a/app/gabsocial/features/ui/components/profile_info_panel.js b/app/gabsocial/features/ui/components/profile_info_panel.js index c8a4e562c..ff2ff454d 100644 --- a/app/gabsocial/features/ui/components/profile_info_panel.js +++ b/app/gabsocial/features/ui/components/profile_info_panel.js @@ -38,7 +38,7 @@ class ProfileInfoPanel extends ImmutablePureComponent { username: PropTypes.string, }; - render () { + render() { const { account, intl, identity_proofs, username } = this.props; if (!account) { diff --git a/app/gabsocial/features/ui/components/report_modal.js b/app/gabsocial/features/ui/components/report_modal.js index ce2e3ee88..3469aebbf 100644 --- a/app/gabsocial/features/ui/components/report_modal.js +++ b/app/gabsocial/features/ui/components/report_modal.js @@ -69,17 +69,17 @@ class ReportModal extends ImmutablePureComponent { } } - componentDidMount () { + componentDidMount() { this.props.dispatch(expandAccountTimeline(this.props.account.get('id'), { withReplies: true })); } - componentWillReceiveProps (nextProps) { + componentWillReceiveProps(nextProps) { if (this.props.account !== nextProps.account && nextProps.account) { this.props.dispatch(expandAccountTimeline(nextProps.account.get('id'), { withReplies: true })); } } - render () { + render() { const { account, comment, intl, statusIds, isSubmitting, forward, onClose } = this.props; if (!account) { diff --git a/app/gabsocial/features/ui/components/tabs_bar.js b/app/gabsocial/features/ui/components/tabs_bar.js index 2850c65d9..7b46c18a7 100644 --- a/app/gabsocial/features/ui/components/tabs_bar.js +++ b/app/gabsocial/features/ui/components/tabs_bar.js @@ -35,7 +35,7 @@ class TabsBar extends React.PureComponent { lastScrollTop = 0; - componentDidMount () { + componentDidMount() { this.window = window; this.documentElement = document.scrollingElement || document.documentElement; @@ -44,7 +44,7 @@ class TabsBar extends React.PureComponent { this.handleScroll(); } - componentWillUnmount () { + componentWillUnmount() { this.detachScrollListener(); } @@ -52,11 +52,11 @@ class TabsBar extends React.PureComponent { this.node = ref; } - attachScrollListener () { + attachScrollListener() { this.window.addEventListener('scroll', this.handleScroll); } - detachScrollListener () { + detachScrollListener() { this.window.removeEventListener('scroll', this.handleScroll); } @@ -117,7 +117,7 @@ class TabsBar extends React.PureComponent { trailing: true, }); - render () { + render() { const { account, onOpenCompose, onOpenSidebar } = this.props; const { collapsed } = this.state; diff --git a/app/gabsocial/features/ui/components/trends_panel.js b/app/gabsocial/features/ui/components/trends_panel.js index 90d74426a..704d35f45 100644 --- a/app/gabsocial/features/ui/components/trends_panel.js +++ b/app/gabsocial/features/ui/components/trends_panel.js @@ -16,7 +16,7 @@ class TrendsPanel extends ImmutablePureComponent { intl: PropTypes.object.isRequired, }; - componentDidMount () { + componentDidMount() { this.props.fetchTrends(); } diff --git a/app/gabsocial/features/ui/components/unauthorized_modal.js b/app/gabsocial/features/ui/components/unauthorized_modal.js index ed59fea77..9273a6f63 100644 --- a/app/gabsocial/features/ui/components/unauthorized_modal.js +++ b/app/gabsocial/features/ui/components/unauthorized_modal.js @@ -28,7 +28,7 @@ class UnauthorizedModal extends ImmutablePureComponent { this.props.onClose('UNAUTHORIZED'); }; - render () { + render() { const { intl, siteTitle } = this.props; return ( diff --git a/app/gabsocial/features/ui/components/upload_area.js b/app/gabsocial/features/ui/components/upload_area.js index 6c423b2c1..4491135a3 100644 --- a/app/gabsocial/features/ui/components/upload_area.js +++ b/app/gabsocial/features/ui/components/upload_area.js @@ -24,15 +24,15 @@ export default class UploadArea extends React.PureComponent { } } - componentDidMount () { + componentDidMount() { window.addEventListener('keyup', this.handleKeyUp, false); } - componentWillUnmount () { + componentWillUnmount() { window.removeEventListener('keyup', this.handleKeyUp); } - render () { + render() { const { active } = this.props; return ( diff --git a/app/gabsocial/features/ui/components/video_modal.js b/app/gabsocial/features/ui/components/video_modal.js index 84c547c5f..9f4c2e9b8 100644 --- a/app/gabsocial/features/ui/components/video_modal.js +++ b/app/gabsocial/features/ui/components/video_modal.js @@ -20,7 +20,7 @@ export default class VideoModal extends ImmutablePureComponent { router: PropTypes.object, }; - componentDidMount () { + componentDidMount() { if (this.context.router) { const history = this.context.router.history; @@ -32,7 +32,7 @@ export default class VideoModal extends ImmutablePureComponent { } } - componentWillUnmount () { + componentWillUnmount() { if (this.context.router) { this.unlistenHistory(); @@ -49,7 +49,7 @@ export default class VideoModal extends ImmutablePureComponent { } } - render () { + render() { const { media, status, time, onClose } = this.props; const link = status && ; diff --git a/app/gabsocial/features/ui/components/who_to_follow_panel.js b/app/gabsocial/features/ui/components/who_to_follow_panel.js index fa2e9b8dc..5ffb8d126 100644 --- a/app/gabsocial/features/ui/components/who_to_follow_panel.js +++ b/app/gabsocial/features/ui/components/who_to_follow_panel.js @@ -21,7 +21,7 @@ class WhoToFollowPanel extends ImmutablePureComponent { intl: PropTypes.object.isRequired, }; - componentDidMount () { + componentDidMount() { this.props.fetchSuggestions(); } diff --git a/app/gabsocial/features/ui/components/zoomable_image.js b/app/gabsocial/features/ui/components/zoomable_image.js index 3f6562bc9..eec87aafd 100644 --- a/app/gabsocial/features/ui/components/zoomable_image.js +++ b/app/gabsocial/features/ui/components/zoomable_image.js @@ -40,7 +40,7 @@ export default class ZoomableImage extends React.PureComponent { lastTouchEndTime = 0; lastDistance = 0; - componentDidMount () { + componentDidMount() { let handler = this.handleTouchStart; this.container.addEventListener('touchstart', handler); this.removers.push(() => this.container.removeEventListener('touchstart', handler)); @@ -51,11 +51,11 @@ export default class ZoomableImage extends React.PureComponent { this.removers.push(() => this.container.removeEventListener('touchend', handler)); } - componentWillUnmount () { + componentWillUnmount() { this.removeEventListeners(); } - removeEventListeners () { + removeEventListeners() { this.removers.forEach(listeners => listeners()); this.removers = []; } @@ -122,7 +122,7 @@ export default class ZoomableImage extends React.PureComponent { this.image = c; } - render () { + render() { const { alt, src } = this.props; const { scale } = this.state; const overflow = scale === 1 ? 'hidden' : 'scroll'; diff --git a/app/gabsocial/features/ui/containers/bundle_container.js b/app/gabsocial/features/ui/containers/bundle_container.js index 7e3f0c3a6..3af058789 100644 --- a/app/gabsocial/features/ui/containers/bundle_container.js +++ b/app/gabsocial/features/ui/containers/bundle_container.js @@ -5,13 +5,13 @@ import Bundle from '../components/bundle'; import { fetchBundleRequest, fetchBundleSuccess, fetchBundleFail } from '../../../actions/bundles'; const mapDispatchToProps = dispatch => ({ - onFetch () { + onFetch() { dispatch(fetchBundleRequest()); }, - onFetchSuccess () { + onFetchSuccess() { dispatch(fetchBundleSuccess()); }, - onFetchFail (error) { + onFetchFail(error) { dispatch(fetchBundleFail(error)); }, }); diff --git a/app/gabsocial/features/ui/containers/modal_container.js b/app/gabsocial/features/ui/containers/modal_container.js index 1bee1ae0d..ba0e52785 100644 --- a/app/gabsocial/features/ui/containers/modal_container.js +++ b/app/gabsocial/features/ui/containers/modal_container.js @@ -9,7 +9,7 @@ const mapStateToProps = state => ({ }); const mapDispatchToProps = (dispatch) => ({ - onClose (optionalType) { + onClose(optionalType) { if (optionalType === 'COMPOSE') { dispatch(cancelReplyCompose()); } diff --git a/app/gabsocial/features/ui/index.js b/app/gabsocial/features/ui/index.js index c6f9238ba..9f72dbb69 100644 --- a/app/gabsocial/features/ui/index.js +++ b/app/gabsocial/features/ui/index.js @@ -159,11 +159,11 @@ class SwitchingColumnsArea extends React.PureComponent { mobile: isMobile(window.innerWidth), }; - componentWillMount () { + componentWillMount() { window.addEventListener('resize', this.handleResize, { passive: true }); } - componentWillUnmount () { + componentWillUnmount() { window.removeEventListener('resize', this.handleResize); } @@ -180,7 +180,7 @@ class SwitchingColumnsArea extends React.PureComponent { this.node = c.getWrappedInstance(); } - render () { + render() { const { children } = this.props; return ( @@ -371,7 +371,7 @@ class UI extends React.PureComponent { } - componentWillMount () { + componentWillMount() { const { me } = this.props; window.addEventListener('beforeunload', this.handleBeforeUnload, false); @@ -399,7 +399,7 @@ class UI extends React.PureComponent { } } - componentDidMount () { + componentDidMount() { const { me } = this.props; if (!me) return; this.connectStreaming(); @@ -409,7 +409,7 @@ class UI extends React.PureComponent { this.connectStreaming(); } - componentWillUnmount () { + componentWillUnmount() { window.removeEventListener('beforeunload', this.handleBeforeUnload); document.removeEventListener('dragenter', this.handleDragEnter); document.removeEventListener('dragover', this.handleDragOver); @@ -528,7 +528,7 @@ class UI extends React.PureComponent { this.props.dispatch(openModal('COMPOSE')); } - render () { + render() { const { streamingUrl } = this.props; const { draggingOver } = this.state; const { intl, children, isComposing, location, dropdownMenuIsOpen, me } = this.props; diff --git a/app/gabsocial/features/ui/util/async-components.js b/app/gabsocial/features/ui/util/async-components.js index 41751f849..af2fe2fec 100644 --- a/app/gabsocial/features/ui/util/async-components.js +++ b/app/gabsocial/features/ui/util/async-components.js @@ -1,28 +1,28 @@ -export function EmojiPicker () { +export function EmojiPicker() { return import(/* webpackChunkName: "emoji_picker" */'../../emoji/emoji_picker'); } -export function Compose () { +export function Compose() { return import(/* webpackChunkName: "features/compose" */'../../compose'); } -export function Notifications () { +export function Notifications() { return import(/* webpackChunkName: "features/notifications" */'../../notifications'); } -export function HomeTimeline () { +export function HomeTimeline() { return import(/* webpackChunkName: "features/home_timeline" */'../../home_timeline'); } -export function PublicTimeline () { +export function PublicTimeline() { return import(/* webpackChunkName: "features/public_timeline" */'../../public_timeline'); } -export function CommunityTimeline () { +export function CommunityTimeline() { return import(/* webpackChunkName: "features/community_timeline" */'../../community_timeline'); } -export function HashtagTimeline () { +export function HashtagTimeline() { return import(/* webpackChunkName: "features/hashtag_timeline" */'../../hashtag_timeline'); } @@ -30,134 +30,134 @@ export function DirectTimeline() { return import(/* webpackChunkName: "features/direct_timeline" */'../../direct_timeline'); } -export function ListTimeline () { +export function ListTimeline() { return import(/* webpackChunkName: "features/list_timeline" */'../../list_timeline'); } -export function GroupTimeline () { +export function GroupTimeline() { return import(/* webpackChunkName: "features/groups/timeline" */'../../groups/timeline'); } -export function GroupMembers () { +export function GroupMembers() { return import(/* webpackChunkName: "features/groups/timeline" */'../../groups/members'); } -export function GroupRemovedAccounts () { +export function GroupRemovedAccounts() { return import(/* webpackChunkName: "features/groups/timeline" */'../../groups/removed_accounts'); } -export function GroupCreate () { +export function GroupCreate() { return import(/* webpackChunkName: "features/groups/timeline" */'../../groups/create'); } -export function GroupEdit () { +export function GroupEdit() { return import(/* webpackChunkName: "features/groups/timeline" */'../../groups/edit'); } -export function Groups () { +export function Groups() { return import(/* webpackChunkName: "features/groups/index" */'../../groups/index'); } -export function Lists () { +export function Lists() { return import(/* webpackChunkName: "features/lists" */'../../lists'); } -export function Status () { +export function Status() { return import(/* webpackChunkName: "features/status" */'../../status'); } -export function GettingStarted () { +export function GettingStarted() { return import(/* webpackChunkName: "features/getting_started" */'../../getting_started'); } -export function PinnedStatuses () { +export function PinnedStatuses() { return import(/* webpackChunkName: "features/pinned_statuses" */'../../pinned_statuses'); } -export function AccountTimeline () { +export function AccountTimeline() { return import(/* webpackChunkName: "features/account_timeline" */'../../account_timeline'); } -export function AccountGallery () { +export function AccountGallery() { return import(/* webpackChunkName: "features/account_gallery" */'../../account_gallery'); } -export function Followers () { +export function Followers() { return import(/* webpackChunkName: "features/followers" */'../../followers'); } -export function Following () { +export function Following() { return import(/* webpackChunkName: "features/following" */'../../following'); } -export function Reblogs () { +export function Reblogs() { return import(/* webpackChunkName: "features/reblogs" */'../../reblogs'); } -export function Favourites () { +export function Favourites() { return import(/* webpackChunkName: "features/favourites" */'../../favourites'); } -export function FollowRequests () { +export function FollowRequests() { return import(/* webpackChunkName: "features/follow_requests" */'../../follow_requests'); } -export function GenericNotFound () { +export function GenericNotFound() { return import(/* webpackChunkName: "features/generic_not_found" */'../../generic_not_found'); } -export function FavouritedStatuses () { +export function FavouritedStatuses() { return import(/* webpackChunkName: "features/favourited_statuses" */'../../favourited_statuses'); } -export function Blocks () { +export function Blocks() { return import(/* webpackChunkName: "features/blocks" */'../../blocks'); } -export function DomainBlocks () { +export function DomainBlocks() { return import(/* webpackChunkName: "features/domain_blocks" */'../../domain_blocks'); } -export function Mutes () { +export function Mutes() { return import(/* webpackChunkName: "features/mutes" */'../../mutes'); } -export function MuteModal () { +export function MuteModal() { return import(/* webpackChunkName: "modals/mute_modal" */'../components/mute_modal'); } -export function ReportModal () { +export function ReportModal() { return import(/* webpackChunkName: "modals/report_modal" */'../components/report_modal'); } -export function MediaGallery () { +export function MediaGallery() { return import(/* webpackChunkName: "status/media_gallery" */'../../../components/media_gallery'); } -export function Video () { +export function Video() { return import(/* webpackChunkName: "features/video" */'../../video'); } -export function EmbedModal () { +export function EmbedModal() { return import(/* webpackChunkName: "modals/embed_modal" */'../components/embed_modal'); } -export function ListEditor () { +export function ListEditor() { return import(/* webpackChunkName: "features/list_editor" */'../../list_editor'); } -export function ListAdder () { +export function ListAdder() { return import(/*webpackChunkName: "features/list_adder" */'../../list_adder'); } -export function Search () { +export function Search() { return import(/*webpackChunkName: "features/search" */'../../search'); } -export function Explore () { +export function Explore() { return import(/* webpackChunkName: "features/explore" */'../../explore'); } -export function LoginPage () { +export function LoginPage() { return import(/* webpackChunkName: "features/auth_login" */'../../auth_login/components/login_page'); } diff --git a/app/gabsocial/features/ui/util/intersection_observer_wrapper.js b/app/gabsocial/features/ui/util/intersection_observer_wrapper.js index 2b24c6583..3a85894a8 100644 --- a/app/gabsocial/features/ui/util/intersection_observer_wrapper.js +++ b/app/gabsocial/features/ui/util/intersection_observer_wrapper.js @@ -11,7 +11,7 @@ class IntersectionObserverWrapper { observerBacklog = []; observer = null; - connect (options) { + connect(options) { const onIntersection = (entries) => { entries.forEach(entry => { const id = entry.target.getAttribute('data-id'); @@ -28,7 +28,7 @@ class IntersectionObserverWrapper { this.observerBacklog = null; } - observe (id, node, callback) { + observe(id, node, callback) { if (!this.observer) { this.observerBacklog.push([ id, node, callback ]); } else { @@ -37,14 +37,14 @@ class IntersectionObserverWrapper { } } - unobserve (id, node) { + unobserve(id, node) { if (this.observer) { delete this.callbacks[id]; this.observer.unobserve(node); } } - disconnect () { + disconnect() { if (this.observer) { this.callbacks = {}; this.observer.disconnect(); diff --git a/app/gabsocial/features/ui/util/react_router_helpers.js b/app/gabsocial/features/ui/util/react_router_helpers.js index 1eefa1a56..caf76d09d 100644 --- a/app/gabsocial/features/ui/util/react_router_helpers.js +++ b/app/gabsocial/features/ui/util/react_router_helpers.js @@ -71,7 +71,7 @@ class WrappedRoute extends React.Component { return ; } - render () { + render() { const { component: Component, content, publicRoute, me, ...rest } = this.props; if (!publicRoute && me === false) { diff --git a/app/gabsocial/features/video/index.js b/app/gabsocial/features/video/index.js index 17deea6ac..c1c8fad34 100644 --- a/app/gabsocial/features/video/index.js +++ b/app/gabsocial/features/video/index.js @@ -266,7 +266,7 @@ class Video extends React.PureComponent { } } - componentDidMount () { + componentDidMount() { document.addEventListener('fullscreenchange', this.handleFullscreenChange, true); document.addEventListener('webkitfullscreenchange', this.handleFullscreenChange, true); document.addEventListener('mozfullscreenchange', this.handleFullscreenChange, true); @@ -277,20 +277,20 @@ class Video extends React.PureComponent { } } - componentWillUnmount () { + componentWillUnmount() { document.removeEventListener('fullscreenchange', this.handleFullscreenChange, true); document.removeEventListener('webkitfullscreenchange', this.handleFullscreenChange, true); document.removeEventListener('mozfullscreenchange', this.handleFullscreenChange, true); document.removeEventListener('MSFullscreenChange', this.handleFullscreenChange, true); } - componentWillReceiveProps (nextProps) { + componentWillReceiveProps(nextProps) { if (!is(nextProps.visible, this.props.visible) && nextProps.visible !== undefined) { this.setState({ revealed: nextProps.visible }); } } - componentDidUpdate (prevProps, prevState) { + componentDidUpdate(prevProps, prevState) { if (prevState.revealed && !this.state.revealed && this.video) { this.video.pause(); } @@ -299,7 +299,7 @@ class Video extends React.PureComponent { } } - _decode () { + _decode() { const hash = this.props.blurhash; const pixels = decode(hash, 32, 32); @@ -374,7 +374,7 @@ class Video extends React.PureComponent { this.props.onCloseVideo(); } - render () { + render() { const { preview, src, inline, startTime, onOpenVideo, onCloseVideo, intl, alt, detailed, sensitive, link, aspectRatio } = this.props; const { containerWidth, currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, muted, revealed } = this.state; const progress = (currentTime / duration) * 100; diff --git a/app/gabsocial/locales/locale-data/co.js b/app/gabsocial/locales/locale-data/co.js index 2b071ecbd..dc94f1044 100644 --- a/app/gabsocial/locales/locale-data/co.js +++ b/app/gabsocial/locales/locale-data/co.js @@ -4,7 +4,7 @@ export default [{ locale: "co", - pluralRuleFunction: function (e, a) { + pluralRuleFunction: function(e, a) { return a ? 1 == e ? "one" : "other" : e >= 0 && e < 2 ? "one" : "other"; }, fields: { diff --git a/app/gabsocial/locales/locale-data/oc.js b/app/gabsocial/locales/locale-data/oc.js index d4adc42eb..7a0f34094 100644 --- a/app/gabsocial/locales/locale-data/oc.js +++ b/app/gabsocial/locales/locale-data/oc.js @@ -4,7 +4,7 @@ export default [{ locale: "oc", - pluralRuleFunction: function (e, a) { + pluralRuleFunction: function(e, a) { return a ? 1 == e ? "one" : "other" : e >= 0 && e < 2 ? "one" : "other"; }, fields: { diff --git a/app/gabsocial/pages/group_page.js b/app/gabsocial/pages/group_page.js index 5d3c143ee..41d3112b4 100644 --- a/app/gabsocial/pages/group_page.js +++ b/app/gabsocial/pages/group_page.js @@ -31,7 +31,7 @@ class GroupPage extends ImmutablePureComponent { dispatch(fetchGroup(id)); } - render () { + render() { const { children, group, relationships } = this.props; return ( diff --git a/app/gabsocial/pages/groups_page.js b/app/gabsocial/pages/groups_page.js index 7a6b5e412..e38aaf52e 100644 --- a/app/gabsocial/pages/groups_page.js +++ b/app/gabsocial/pages/groups_page.js @@ -22,7 +22,7 @@ class GroupsPage extends ImmutablePureComponent { account: ImmutablePropTypes.map, }; - render () { + render() { const { children } = this.props; return ( diff --git a/app/gabsocial/pages/home_page.js b/app/gabsocial/pages/home_page.js index d663d4a2a..f02e46e6b 100644 --- a/app/gabsocial/pages/home_page.js +++ b/app/gabsocial/pages/home_page.js @@ -22,7 +22,7 @@ const mapStateToProps = state => { export default @connect(mapStateToProps) class HomePage extends ImmutablePureComponent { - render () { + render() { const { children, account, hasPatron } = this.props; return ( diff --git a/app/gabsocial/pages/profile_page.js b/app/gabsocial/pages/profile_page.js index 6387d1ef0..42c49536b 100644 --- a/app/gabsocial/pages/profile_page.js +++ b/app/gabsocial/pages/profile_page.js @@ -42,7 +42,7 @@ class ProfilePage extends ImmutablePureComponent { accountUsername: PropTypes.string.isRequired, }; - render () { + render() { const { children, accountId, account, accountUsername } = this.props; const bg = account ? account.getIn(['customizations', 'background']) : undefined; diff --git a/app/gabsocial/stream.js b/app/gabsocial/stream.js index 5fc9a585e..4622df344 100644 --- a/app/gabsocial/stream.js +++ b/app/gabsocial/stream.js @@ -26,7 +26,7 @@ export function connectStream(path, pollingRefresh = null, callbacks = () => ({ }; const subscription = getStream(streamingAPIBaseURL, accessToken, path, { - connected () { + connected() { if (pollingRefresh) { clearPolling(); } @@ -34,7 +34,7 @@ export function connectStream(path, pollingRefresh = null, callbacks = () => ({ onConnect(); }, - disconnected () { + disconnected() { if (pollingRefresh) { polling = setTimeout(() => setupPolling(), randomIntUpTo(40000)); } @@ -42,11 +42,11 @@ export function connectStream(path, pollingRefresh = null, callbacks = () => ({ onDisconnect(); }, - received (data) { + received(data) { onReceive(data); }, - reconnected () { + reconnected() { if (pollingRefresh) { clearPolling(); pollingRefresh(dispatch); diff --git a/app/packs/public.js b/app/packs/public.js index 2c30ba0ab..6e422a76c 100644 --- a/app/packs/public.js +++ b/app/packs/public.js @@ -14,7 +14,7 @@ window.addEventListener('message', e => { return; } - ready(( ) => { + ready(() => { window.parent.postMessage({ type: 'setHeight', id: data.id, @@ -23,7 +23,7 @@ window.addEventListener('message', e => { }); }); -function main ( ) { +function main() { const IntlMessageFormat = require('intl-messageformat').default; import('intl-pluralrules'); // eslint-disable-line const { timeAgoString } = require('../gabsocial/components/relative_timestamp'); @@ -109,7 +109,7 @@ function main ( ) { const parallaxComponents = document.querySelectorAll('.parallax'); - if (parallaxComponents.length > 0 ) { + if (parallaxComponents.length > 0) { new Rellax('.parallax', { speed: -1 }); }