From 00cc1536f2851a23806c0200673781479e8ba648 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Wed, 18 Jan 2023 08:44:33 -0700 Subject: [Glitch] Add listing of followed hashtags Port 30e895299ceff095da3e4c8ee50b3d003225f021 to glitch-soc Co-authored-by: Claire Signed-off-by: Claire --- app/javascript/flavours/glitch/features/ui/util/async-components.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/javascript/flavours/glitch/features/ui/util') diff --git a/app/javascript/flavours/glitch/features/ui/util/async-components.js b/app/javascript/flavours/glitch/features/ui/util/async-components.js index 025b22e61..03e501628 100644 --- a/app/javascript/flavours/glitch/features/ui/util/async-components.js +++ b/app/javascript/flavours/glitch/features/ui/util/async-components.js @@ -98,6 +98,10 @@ export function FavouritedStatuses () { return import(/* webpackChunkName: "flavours/glitch/async/favourited_statuses" */'flavours/glitch/features/favourited_statuses'); } +export function FollowedTags () { + return import(/* webpackChunkName: "flavours/glitch/async/followed_tags" */'flavours/glitch/features/followed_tags'); +} + export function BookmarkedStatuses () { return import(/* webpackChunkName: "flavours/glitch/async/bookmarked_statuses" */'flavours/glitch/features/bookmarked_statuses'); } -- cgit From 155424e52f2d382ccaf4560b2d62aba347a8992b Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Feb 2023 20:52:07 +0100 Subject: [Glitch] Run eslint --fix I don't like it changing files this way, but it's basically what c49213f0ea311daba590db1d7a14a641cbd9fe93 and a few others did. --- app/javascript/core/embed.js | 2 +- app/javascript/core/settings.js | 4 +- .../flavours/glitch/actions/account_notes.js | 14 +- app/javascript/flavours/glitch/actions/accounts.js | 166 ++++++++++----------- app/javascript/flavours/glitch/actions/alerts.js | 6 +- app/javascript/flavours/glitch/actions/blocks.js | 16 +- .../flavours/glitch/actions/bookmarks.js | 16 +- app/javascript/flavours/glitch/actions/boosts.js | 2 +- app/javascript/flavours/glitch/actions/columns.js | 6 +- app/javascript/flavours/glitch/actions/compose.js | 92 ++++++------ .../flavours/glitch/actions/custom_emojis.js | 8 +- .../flavours/glitch/actions/domain_blocks.js | 32 ++-- app/javascript/flavours/glitch/actions/emojis.js | 2 +- .../flavours/glitch/actions/favourites.js | 16 +- .../flavours/glitch/actions/height_cache.js | 4 +- .../flavours/glitch/actions/interactions.js | 80 +++++----- .../flavours/glitch/actions/local_settings.js | 10 +- app/javascript/flavours/glitch/actions/markers.js | 10 +- app/javascript/flavours/glitch/actions/modal.js | 4 +- app/javascript/flavours/glitch/actions/mutes.js | 16 +- .../flavours/glitch/actions/notifications.js | 40 ++--- .../flavours/glitch/actions/onboarding.js | 2 +- .../flavours/glitch/actions/pin_statuses.js | 8 +- app/javascript/flavours/glitch/actions/search.js | 12 +- app/javascript/flavours/glitch/actions/settings.js | 4 +- app/javascript/flavours/glitch/actions/statuses.js | 48 +++--- app/javascript/flavours/glitch/actions/store.js | 4 +- .../flavours/glitch/actions/suggestions.js | 8 +- .../flavours/glitch/actions/timelines.js | 20 +-- app/javascript/flavours/glitch/compare_id.js | 2 +- .../flavours/glitch/components/account.js | 12 +- .../flavours/glitch/components/admin/Retention.js | 2 +- .../flavours/glitch/components/animated_number.js | 4 +- .../glitch/components/autosuggest_input.js | 14 +- .../glitch/components/autosuggest_textarea.js | 16 +- .../flavours/glitch/components/avatar.js | 4 +- .../flavours/glitch/components/button.js | 4 +- .../flavours/glitch/components/column.js | 4 +- .../glitch/components/column_back_button.js | 2 +- .../glitch/components/column_back_button_slim.js | 2 +- .../flavours/glitch/components/column_header.js | 16 +- .../glitch/components/dismissable_banner.js | 2 +- .../flavours/glitch/components/display_name.js | 6 +- .../flavours/glitch/components/domain.js | 2 +- .../flavours/glitch/components/dropdown_menu.js | 34 ++--- .../glitch/components/edited_timestamp/index.js | 4 +- .../flavours/glitch/components/error_boundary.js | 2 +- app/javascript/flavours/glitch/components/gifv.js | 4 +- .../flavours/glitch/components/icon_button.js | 10 +- .../components/intersection_observer_article.js | 17 ++- .../flavours/glitch/components/load_gap.js | 2 +- .../flavours/glitch/components/load_more.js | 4 +- .../flavours/glitch/components/load_pending.js | 2 +- .../glitch/components/media_attachments.js | 6 +- .../flavours/glitch/components/media_gallery.js | 18 +-- .../flavours/glitch/components/modal_root.js | 9 +- .../flavours/glitch/components/permalink.js | 4 +- .../components/picture_in_picture_placeholder.js | 4 +- app/javascript/flavours/glitch/components/poll.js | 4 +- .../flavours/glitch/components/scrollable_list.js | 22 +-- .../flavours/glitch/components/setting_text.js | 2 +- .../flavours/glitch/components/spoilers.js | 30 ++-- .../flavours/glitch/components/status.js | 64 ++++---- .../glitch/components/status_action_bar.js | 44 +++--- .../flavours/glitch/components/status_content.js | 26 ++-- .../flavours/glitch/components/status_header.js | 4 +- .../flavours/glitch/components/status_icons.js | 22 +-- .../flavours/glitch/components/status_list.js | 12 +- .../flavours/glitch/components/status_prepend.js | 6 +- .../flavours/glitch/containers/media_container.js | 8 +- .../flavours/glitch/features/about/index.js | 4 +- .../features/account/components/account_note.js | 2 +- .../features/account/components/action_bar.js | 4 +- .../glitch/features/account/components/header.js | 15 +- .../account_gallery/components/media_item.js | 8 +- .../glitch/features/account_gallery/index.js | 16 +- .../features/account_timeline/components/header.js | 32 ++-- .../components/limited_account_hint.js | 2 +- .../account_timeline/components/moved_note.js | 4 +- .../containers/header_container.js | 2 +- .../glitch/features/account_timeline/index.js | 6 +- .../flavours/glitch/features/audio/index.js | 46 +++--- .../glitch/features/bookmarked_statuses/index.js | 10 +- .../features/closed_registrations_modal/index.js | 2 +- .../containers/column_settings_container.js | 2 +- .../glitch/features/community_timeline/index.js | 10 +- .../features/compose/components/action_bar.js | 2 +- .../features/compose/components/compose_form.js | 36 ++--- .../glitch/features/compose/components/dropdown.js | 22 +-- .../features/compose/components/dropdown_menu.js | 14 +- .../compose/components/emoji_picker_dropdown.js | 38 ++--- .../glitch/features/compose/components/header.js | 12 +- .../compose/components/language_dropdown.js | 30 ++-- .../glitch/features/compose/components/options.js | 6 +- .../features/compose/components/poll_form.js | 6 +- .../features/compose/components/publisher.js | 3 +- .../features/compose/components/reply_indicator.js | 2 +- .../glitch/features/compose/components/search.js | 14 +- .../features/compose/components/search_results.js | 5 +- .../features/compose/components/textarea_icons.js | 3 +- .../glitch/features/compose/components/upload.js | 6 +- .../features/compose/components/upload_form.js | 1 + .../compose/containers/compose_form_container.js | 22 +-- .../compose/containers/options_container.js | 2 +- .../compose/containers/warning_container.js | 4 +- .../flavours/glitch/features/compose/index.js | 1 + .../glitch/features/compose/util/counter.js | 2 +- .../direct_timeline/components/conversation.js | 24 +-- .../components/conversations_list.js | 10 +- .../glitch/features/direct_timeline/index.js | 12 +- .../features/directory/components/account_card.js | 10 +- .../flavours/glitch/features/directory/index.js | 14 +- .../flavours/glitch/features/explore/index.js | 4 +- .../flavours/glitch/features/explore/statuses.js | 2 +- .../glitch/features/explore/suggestions.js | 2 +- .../glitch/features/favourited_statuses/index.js | 10 +- .../flavours/glitch/features/favourites/index.js | 6 +- .../glitch/features/filters/select_filter.js | 14 +- .../follow_recommendations/components/account.js | 2 +- .../features/follow_recommendations/index.js | 2 +- .../flavours/glitch/features/followers/index.js | 4 +- .../flavours/glitch/features/following/index.js | 4 +- .../getting_started/components/announcements.js | 26 ++-- .../glitch/features/getting_started/index.js | 6 +- .../glitch/features/getting_started_misc/index.js | 4 +- .../hashtag_timeline/components/column_settings.js | 4 +- .../glitch/features/hashtag_timeline/index.js | 16 +- .../glitch/features/home_timeline/index.js | 12 +- .../glitch/features/interaction_modal/index.js | 8 +- .../list_editor/components/edit_list_form.js | 6 +- .../features/list_editor/components/search.js | 6 +- .../glitch/features/list_timeline/index.js | 18 +-- .../features/lists/components/new_list_form.js | 6 +- .../features/local_settings/navigation/index.js | 2 +- .../local_settings/navigation/item/index.js | 2 +- .../glitch/features/local_settings/page/index.js | 12 +- .../features/local_settings/page/item/index.js | 6 +- .../notifications/components/admin_report.js | 10 +- .../notifications/components/admin_signup.js | 10 +- .../notifications/components/column_settings.js | 2 +- .../features/notifications/components/follow.js | 10 +- .../notifications/components/follow_request.js | 10 +- .../components/notifications_permission_banner.js | 4 +- .../features/notifications/components/overlay.js | 2 +- .../notifications/components/pill_bar_button.js | 6 +- .../notifications/components/setting_toggle.js | 4 +- .../glitch/features/notifications/index.js | 18 +-- .../picture_in_picture/components/footer.js | 4 +- .../glitch/features/picture_in_picture/index.js | 2 +- .../containers/search_container.js | 2 +- .../glitch/features/pinned_statuses/index.js | 4 +- .../containers/column_settings_container.js | 2 +- .../glitch/features/public_timeline/index.js | 10 +- .../flavours/glitch/features/reblogs/index.js | 6 +- .../glitch/features/report/components/option.js | 4 +- .../features/status/components/action_bar.js | 34 ++--- .../glitch/features/status/components/card.js | 8 +- .../features/status/components/detailed_status.js | 18 +-- .../flavours/glitch/features/status/index.js | 80 +++++----- .../features/subscribed_languages_modal/index.js | 2 +- .../glitch/features/ui/components/actions_modal.js | 2 +- .../glitch/features/ui/components/block_modal.js | 8 +- .../glitch/features/ui/components/boost_modal.js | 12 +- .../glitch/features/ui/components/bundle.js | 10 +- .../features/ui/components/bundle_column_error.js | 8 +- .../features/ui/components/bundle_modal_error.js | 4 +- .../glitch/features/ui/components/column.js | 6 +- .../glitch/features/ui/components/column_header.js | 2 +- .../glitch/features/ui/components/column_link.js | 2 +- .../glitch/features/ui/components/columns_area.js | 12 +- .../glitch/features/ui/components/compose_panel.js | 2 +- .../features/ui/components/confirmation_modal.js | 10 +- .../ui/components/deprecated_settings_modal.js | 4 +- .../ui/components/disabled_account_banner.js | 4 +- .../glitch/features/ui/components/doodle_modal.js | 6 +- .../glitch/features/ui/components/embed_modal.js | 6 +- .../features/ui/components/favourite_modal.js | 8 +- .../features/ui/components/focal_point_modal.js | 32 ++-- .../glitch/features/ui/components/image_loader.js | 8 +- .../glitch/features/ui/components/link_footer.js | 4 +- .../glitch/features/ui/components/media_modal.js | 12 +- .../glitch/features/ui/components/modal_root.js | 14 +- .../glitch/features/ui/components/mute_modal.js | 10 +- .../features/ui/components/onboarding_modal.js | 18 +-- .../glitch/features/ui/components/report_modal.js | 2 +- .../glitch/features/ui/components/upload_area.js | 2 +- .../features/ui/components/zoomable_image.js | 28 ++-- .../flavours/glitch/features/ui/index.js | 70 ++++----- .../features/ui/util/react_router_helpers.js | 10 +- .../glitch/features/ui/util/reduced_motion.js | 2 +- .../flavours/glitch/features/video/index.js | 54 +++---- .../flavours/glitch/middleware/errors.js | 2 +- .../flavours/glitch/middleware/loading_bar.js | 2 +- .../flavours/glitch/middleware/sounds.js | 2 +- .../flavours/glitch/reducers/accounts.js | 2 +- .../flavours/glitch/reducers/accounts_counters.js | 2 +- .../flavours/glitch/reducers/accounts_map.js | 2 +- app/javascript/flavours/glitch/reducers/alerts.js | 2 +- .../flavours/glitch/reducers/announcements.js | 2 +- app/javascript/flavours/glitch/reducers/compose.js | 26 ++-- .../flavours/glitch/reducers/contexts.js | 4 +- .../flavours/glitch/reducers/conversations.js | 2 +- .../flavours/glitch/reducers/custom_emojis.js | 2 +- .../flavours/glitch/reducers/domain_lists.js | 2 +- app/javascript/flavours/glitch/reducers/filters.js | 2 +- .../flavours/glitch/reducers/height_cache.js | 2 +- .../flavours/glitch/reducers/list_adder.js | 2 +- .../flavours/glitch/reducers/list_editor.js | 10 +- app/javascript/flavours/glitch/reducers/lists.js | 2 +- .../flavours/glitch/reducers/local_settings.js | 2 +- app/javascript/flavours/glitch/reducers/markers.js | 2 +- .../flavours/glitch/reducers/media_attachments.js | 2 +- app/javascript/flavours/glitch/reducers/meta.js | 6 +- app/javascript/flavours/glitch/reducers/modal.js | 2 +- .../flavours/glitch/reducers/notifications.js | 2 +- .../flavours/glitch/reducers/picture_in_picture.js | 2 +- .../glitch/reducers/pinned_accounts_editor.js | 2 +- .../flavours/glitch/reducers/push_notifications.js | 2 +- .../flavours/glitch/reducers/relationships.js | 2 +- app/javascript/flavours/glitch/reducers/search.js | 2 +- .../flavours/glitch/reducers/settings.js | 2 +- .../flavours/glitch/reducers/status_lists.js | 2 +- .../flavours/glitch/reducers/statuses.js | 2 +- .../flavours/glitch/reducers/suggestions.js | 2 +- app/javascript/flavours/glitch/reducers/tags.js | 2 +- .../flavours/glitch/reducers/timelines.js | 2 +- app/javascript/flavours/glitch/reducers/trends.js | 2 +- .../flavours/glitch/reducers/user_lists.js | 2 +- .../flavours/glitch/store/configureStore.js | 2 +- app/javascript/flavours/glitch/utils/hashtag.js | 8 +- .../flavours/glitch/utils/privacy_preference.js | 2 +- .../flavours/glitch/utils/react_helpers.js | 2 +- app/javascript/flavours/glitch/uuid.js | 2 +- 233 files changed, 1262 insertions(+), 1248 deletions(-) (limited to 'app/javascript/flavours/glitch/features/ui/util') diff --git a/app/javascript/core/embed.js b/app/javascript/core/embed.js index 9083eb7a3..d1e8f6b10 100644 --- a/app/javascript/core/embed.js +++ b/app/javascript/core/embed.js @@ -15,7 +15,7 @@ window.addEventListener('message', e => { id: data.id, height: document.getElementsByTagName('html')[0].scrollHeight, }, '*'); - }; + } if (['interactive', 'complete'].includes(document.readyState)) { setEmbedHeight(); diff --git a/app/javascript/core/settings.js b/app/javascript/core/settings.js index d5bb9532c..d578463a3 100644 --- a/app/javascript/core/settings.js +++ b/app/javascript/core/settings.js @@ -2,7 +2,9 @@ import 'packs/public-path'; import escapeTextContentForBrowser from 'escape-html'; + const { delegate } = require('@rails/ujs'); + import emojify from '../mastodon/features/emoji/emoji'; delegate(document, '#account_display_name', 'input', ({ target }) => { @@ -65,7 +67,7 @@ delegate(document, '.input-copy button', 'click', ({ target }) => { input.blur(); target.parentNode.classList.add('copied'); - setTimeout(() => { + setTimeout(() => { target.parentNode.classList.remove('copied'); }, 700); } diff --git a/app/javascript/flavours/glitch/actions/account_notes.js b/app/javascript/flavours/glitch/actions/account_notes.js index 059ed9e80..62a6b4cbb 100644 --- a/app/javascript/flavours/glitch/actions/account_notes.js +++ b/app/javascript/flavours/glitch/actions/account_notes.js @@ -21,27 +21,27 @@ export function submitAccountNote() { dispatch(submitAccountNoteSuccess(response.data)); }).catch(error => dispatch(submitAccountNoteFail(error))); }; -}; +} export function submitAccountNoteRequest() { return { type: ACCOUNT_NOTE_SUBMIT_REQUEST, }; -}; +} export function submitAccountNoteSuccess(relationship) { return { type: ACCOUNT_NOTE_SUBMIT_SUCCESS, relationship, }; -}; +} export function submitAccountNoteFail(error) { return { type: ACCOUNT_NOTE_SUBMIT_FAIL, error, }; -}; +} export function initEditAccountNote(account) { return (dispatch, getState) => { @@ -53,17 +53,17 @@ export function initEditAccountNote(account) { comment, }); }; -}; +} export function cancelAccountNote() { return { type: ACCOUNT_NOTE_CANCEL, }; -}; +} export function changeAccountNoteComment(comment) { return { type: ACCOUNT_NOTE_CHANGE_COMMENT, comment, }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/accounts.js b/app/javascript/flavours/glitch/actions/accounts.js index dc670e50a..6b5b2ade5 100644 --- a/app/javascript/flavours/glitch/actions/accounts.js +++ b/app/javascript/flavours/glitch/actions/accounts.js @@ -108,7 +108,7 @@ export function fetchAccount(id) { dispatch(fetchAccountFail(id, error)); }); }; -}; +} export const lookupAccount = acct => (dispatch, getState) => { dispatch(lookupAccountRequest(acct)); @@ -143,13 +143,13 @@ export function fetchAccountRequest(id) { type: ACCOUNT_FETCH_REQUEST, id, }; -}; +} export function fetchAccountSuccess() { return { type: ACCOUNT_FETCH_SUCCESS, }; -}; +} export function fetchAccountFail(id, error) { return { @@ -158,7 +158,7 @@ export function fetchAccountFail(id, error) { error, skipAlert: true, }; -}; +} export function followAccount(id, options = { reblogs: true }) { return (dispatch, getState) => { @@ -173,7 +173,7 @@ export function followAccount(id, options = { reblogs: true }) { dispatch(followAccountFail(error, locked)); }); }; -}; +} export function unfollowAccount(id) { return (dispatch, getState) => { @@ -185,7 +185,7 @@ export function unfollowAccount(id) { dispatch(unfollowAccountFail(error)); }); }; -}; +} export function followAccountRequest(id, locked) { return { @@ -194,7 +194,7 @@ export function followAccountRequest(id, locked) { locked, skipLoading: true, }; -}; +} export function followAccountSuccess(relationship, alreadyFollowing) { return { @@ -203,7 +203,7 @@ export function followAccountSuccess(relationship, alreadyFollowing) { alreadyFollowing, skipLoading: true, }; -}; +} export function followAccountFail(error, locked) { return { @@ -212,7 +212,7 @@ export function followAccountFail(error, locked) { locked, skipLoading: true, }; -}; +} export function unfollowAccountRequest(id) { return { @@ -220,7 +220,7 @@ export function unfollowAccountRequest(id) { id, skipLoading: true, }; -}; +} export function unfollowAccountSuccess(relationship, statuses) { return { @@ -229,7 +229,7 @@ export function unfollowAccountSuccess(relationship, statuses) { statuses, skipLoading: true, }; -}; +} export function unfollowAccountFail(error) { return { @@ -237,7 +237,7 @@ export function unfollowAccountFail(error) { error, skipLoading: true, }; -}; +} export function blockAccount(id) { return (dispatch, getState) => { @@ -250,7 +250,7 @@ export function blockAccount(id) { dispatch(blockAccountFail(id, error)); }); }; -}; +} export function unblockAccount(id) { return (dispatch, getState) => { @@ -262,14 +262,14 @@ export function unblockAccount(id) { dispatch(unblockAccountFail(id, error)); }); }; -}; +} export function blockAccountRequest(id) { return { type: ACCOUNT_BLOCK_REQUEST, id, }; -}; +} export function blockAccountSuccess(relationship, statuses) { return { @@ -277,35 +277,35 @@ export function blockAccountSuccess(relationship, statuses) { relationship, statuses, }; -}; +} export function blockAccountFail(error) { return { type: ACCOUNT_BLOCK_FAIL, error, }; -}; +} export function unblockAccountRequest(id) { return { type: ACCOUNT_UNBLOCK_REQUEST, id, }; -}; +} export function unblockAccountSuccess(relationship) { return { type: ACCOUNT_UNBLOCK_SUCCESS, relationship, }; -}; +} export function unblockAccountFail(error) { return { type: ACCOUNT_UNBLOCK_FAIL, error, }; -}; +} export function muteAccount(id, notifications, duration=0) { @@ -319,7 +319,7 @@ export function muteAccount(id, notifications, duration=0) { dispatch(muteAccountFail(id, error)); }); }; -}; +} export function unmuteAccount(id) { return (dispatch, getState) => { @@ -331,14 +331,14 @@ export function unmuteAccount(id) { dispatch(unmuteAccountFail(id, error)); }); }; -}; +} export function muteAccountRequest(id) { return { type: ACCOUNT_MUTE_REQUEST, id, }; -}; +} export function muteAccountSuccess(relationship, statuses) { return { @@ -346,35 +346,35 @@ export function muteAccountSuccess(relationship, statuses) { relationship, statuses, }; -}; +} export function muteAccountFail(error) { return { type: ACCOUNT_MUTE_FAIL, error, }; -}; +} export function unmuteAccountRequest(id) { return { type: ACCOUNT_UNMUTE_REQUEST, id, }; -}; +} export function unmuteAccountSuccess(relationship) { return { type: ACCOUNT_UNMUTE_SUCCESS, relationship, }; -}; +} export function unmuteAccountFail(error) { return { type: ACCOUNT_UNMUTE_FAIL, error, }; -}; +} export function fetchFollowers(id) { @@ -391,14 +391,14 @@ export function fetchFollowers(id) { dispatch(fetchFollowersFail(id, error)); }); }; -}; +} export function fetchFollowersRequest(id) { return { type: FOLLOWERS_FETCH_REQUEST, id, }; -}; +} export function fetchFollowersSuccess(id, accounts, next) { return { @@ -407,7 +407,7 @@ export function fetchFollowersSuccess(id, accounts, next) { accounts, next, }; -}; +} export function fetchFollowersFail(id, error) { return { @@ -416,7 +416,7 @@ export function fetchFollowersFail(id, error) { error, skipNotFound: true, }; -}; +} export function expandFollowers(id) { return (dispatch, getState) => { @@ -438,14 +438,14 @@ export function expandFollowers(id) { dispatch(expandFollowersFail(id, error)); }); }; -}; +} export function expandFollowersRequest(id) { return { type: FOLLOWERS_EXPAND_REQUEST, id, }; -}; +} export function expandFollowersSuccess(id, accounts, next) { return { @@ -454,7 +454,7 @@ export function expandFollowersSuccess(id, accounts, next) { accounts, next, }; -}; +} export function expandFollowersFail(id, error) { return { @@ -462,7 +462,7 @@ export function expandFollowersFail(id, error) { id, error, }; -}; +} export function fetchFollowing(id) { return (dispatch, getState) => { @@ -478,14 +478,14 @@ export function fetchFollowing(id) { dispatch(fetchFollowingFail(id, error)); }); }; -}; +} export function fetchFollowingRequest(id) { return { type: FOLLOWING_FETCH_REQUEST, id, }; -}; +} export function fetchFollowingSuccess(id, accounts, next) { return { @@ -494,7 +494,7 @@ export function fetchFollowingSuccess(id, accounts, next) { accounts, next, }; -}; +} export function fetchFollowingFail(id, error) { return { @@ -503,7 +503,7 @@ export function fetchFollowingFail(id, error) { error, skipNotFound: true, }; -}; +} export function expandFollowing(id) { return (dispatch, getState) => { @@ -525,14 +525,14 @@ export function expandFollowing(id) { dispatch(expandFollowingFail(id, error)); }); }; -}; +} export function expandFollowingRequest(id) { return { type: FOLLOWING_EXPAND_REQUEST, id, }; -}; +} export function expandFollowingSuccess(id, accounts, next) { return { @@ -541,7 +541,7 @@ export function expandFollowingSuccess(id, accounts, next) { accounts, next, }; -}; +} export function expandFollowingFail(id, error) { return { @@ -549,7 +549,7 @@ export function expandFollowingFail(id, error) { id, error, }; -}; +} export function fetchRelationships(accountIds) { return (dispatch, getState) => { @@ -570,7 +570,7 @@ export function fetchRelationships(accountIds) { dispatch(fetchRelationshipsFail(error)); }); }; -}; +} export function fetchRelationshipsRequest(ids) { return { @@ -578,7 +578,7 @@ export function fetchRelationshipsRequest(ids) { ids, skipLoading: true, }; -}; +} export function fetchRelationshipsSuccess(relationships) { return { @@ -586,7 +586,7 @@ export function fetchRelationshipsSuccess(relationships) { relationships, skipLoading: true, }; -}; +} export function fetchRelationshipsFail(error) { return { @@ -595,7 +595,7 @@ export function fetchRelationshipsFail(error) { skipLoading: true, skipNotFound: true, }; -}; +} export function fetchFollowRequests() { return (dispatch, getState) => { @@ -607,13 +607,13 @@ export function fetchFollowRequests() { dispatch(fetchFollowRequestsSuccess(response.data, next ? next.uri : null)); }).catch(error => dispatch(fetchFollowRequestsFail(error))); }; -}; +} export function fetchFollowRequestsRequest() { return { type: FOLLOW_REQUESTS_FETCH_REQUEST, }; -}; +} export function fetchFollowRequestsSuccess(accounts, next) { return { @@ -621,14 +621,14 @@ export function fetchFollowRequestsSuccess(accounts, next) { accounts, next, }; -}; +} export function fetchFollowRequestsFail(error) { return { type: FOLLOW_REQUESTS_FETCH_FAIL, error, }; -}; +} export function expandFollowRequests() { return (dispatch, getState) => { @@ -646,13 +646,13 @@ export function expandFollowRequests() { dispatch(expandFollowRequestsSuccess(response.data, next ? next.uri : null)); }).catch(error => dispatch(expandFollowRequestsFail(error))); }; -}; +} export function expandFollowRequestsRequest() { return { type: FOLLOW_REQUESTS_EXPAND_REQUEST, }; -}; +} export function expandFollowRequestsSuccess(accounts, next) { return { @@ -660,14 +660,14 @@ export function expandFollowRequestsSuccess(accounts, next) { accounts, next, }; -}; +} export function expandFollowRequestsFail(error) { return { type: FOLLOW_REQUESTS_EXPAND_FAIL, error, }; -}; +} export function authorizeFollowRequest(id) { return (dispatch, getState) => { @@ -678,21 +678,21 @@ export function authorizeFollowRequest(id) { .then(() => dispatch(authorizeFollowRequestSuccess(id))) .catch(error => dispatch(authorizeFollowRequestFail(id, error))); }; -}; +} export function authorizeFollowRequestRequest(id) { return { type: FOLLOW_REQUEST_AUTHORIZE_REQUEST, id, }; -}; +} export function authorizeFollowRequestSuccess(id) { return { type: FOLLOW_REQUEST_AUTHORIZE_SUCCESS, id, }; -}; +} export function authorizeFollowRequestFail(id, error) { return { @@ -700,7 +700,7 @@ export function authorizeFollowRequestFail(id, error) { id, error, }; -}; +} export function rejectFollowRequest(id) { @@ -712,21 +712,21 @@ export function rejectFollowRequest(id) { .then(() => dispatch(rejectFollowRequestSuccess(id))) .catch(error => dispatch(rejectFollowRequestFail(id, error))); }; -}; +} export function rejectFollowRequestRequest(id) { return { type: FOLLOW_REQUEST_REJECT_REQUEST, id, }; -}; +} export function rejectFollowRequestSuccess(id) { return { type: FOLLOW_REQUEST_REJECT_SUCCESS, id, }; -}; +} export function rejectFollowRequestFail(id, error) { return { @@ -734,7 +734,7 @@ export function rejectFollowRequestFail(id, error) { id, error, }; -}; +} export function pinAccount(id) { return (dispatch, getState) => { @@ -746,7 +746,7 @@ export function pinAccount(id) { dispatch(pinAccountFail(error)); }); }; -}; +} export function unpinAccount(id) { return (dispatch, getState) => { @@ -758,49 +758,49 @@ export function unpinAccount(id) { dispatch(unpinAccountFail(error)); }); }; -}; +} export function pinAccountRequest(id) { return { type: ACCOUNT_PIN_REQUEST, id, }; -}; +} export function pinAccountSuccess(relationship) { return { type: ACCOUNT_PIN_SUCCESS, relationship, }; -}; +} export function pinAccountFail(error) { return { type: ACCOUNT_PIN_FAIL, error, }; -}; +} export function unpinAccountRequest(id) { return { type: ACCOUNT_UNPIN_REQUEST, id, }; -}; +} export function unpinAccountSuccess(relationship) { return { type: ACCOUNT_UNPIN_SUCCESS, relationship, }; -}; +} export function unpinAccountFail(error) { return { type: ACCOUNT_UNPIN_FAIL, error, }; -}; +} export const revealAccount = id => ({ type: ACCOUNT_REVEAL, @@ -811,18 +811,18 @@ export function fetchPinnedAccounts() { return (dispatch, getState) => { dispatch(fetchPinnedAccountsRequest()); - api(getState).get(`/api/v1/endorsements`, { params: { limit: 0 } }).then(response => { + api(getState).get('/api/v1/endorsements', { params: { limit: 0 } }).then(response => { dispatch(importFetchedAccounts(response.data)); dispatch(fetchPinnedAccountsSuccess(response.data)); }).catch(err => dispatch(fetchPinnedAccountsFail(err))); }; -}; +} export function fetchPinnedAccountsRequest() { return { type: PINNED_ACCOUNTS_FETCH_REQUEST, }; -}; +} export function fetchPinnedAccountsSuccess(accounts, next) { return { @@ -830,14 +830,14 @@ export function fetchPinnedAccountsSuccess(accounts, next) { accounts, next, }; -}; +} export function fetchPinnedAccountsFail(error) { return { type: PINNED_ACCOUNTS_FETCH_FAIL, error, }; -}; +} export function fetchPinnedAccountsSuggestions(q) { return (dispatch, getState) => { @@ -853,7 +853,7 @@ export function fetchPinnedAccountsSuggestions(q) { dispatch(fetchPinnedAccountsSuggestionsReady(q, response.data)); }); }; -}; +} export function fetchPinnedAccountsSuggestionsReady(query, accounts) { return { @@ -861,24 +861,24 @@ export function fetchPinnedAccountsSuggestionsReady(query, accounts) { query, accounts, }; -}; +} export function clearPinnedAccountsSuggestions() { return { type: PINNED_ACCOUNTS_EDITOR_SUGGESTIONS_CLEAR, }; -}; +} export function changePinnedAccountsSuggestions(value) { return { type: PINNED_ACCOUNTS_EDITOR_SUGGESTIONS_CHANGE, value, - } -}; + }; +} export function resetPinnedAccountsEditor() { return { type: PINNED_ACCOUNTS_EDITOR_RESET, }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/alerts.js b/app/javascript/flavours/glitch/actions/alerts.js index 1670f9c10..0220b0af5 100644 --- a/app/javascript/flavours/glitch/actions/alerts.js +++ b/app/javascript/flavours/glitch/actions/alerts.js @@ -17,13 +17,13 @@ export function dismissAlert(alert) { type: ALERT_DISMISS, alert, }; -}; +} export function clearAlert() { return { type: ALERT_CLEAR, }; -}; +} export function showAlert(title = messages.unexpectedTitle, message = messages.unexpectedMessage, message_values = undefined) { return { @@ -32,7 +32,7 @@ export function showAlert(title = messages.unexpectedTitle, message = messages.u message, message_values, }; -}; +} export function showAlertForError(error, skipNotFound = false) { if (error.response) { diff --git a/app/javascript/flavours/glitch/actions/blocks.js b/app/javascript/flavours/glitch/actions/blocks.js index fd9881302..192aa3ce4 100644 --- a/app/javascript/flavours/glitch/actions/blocks.js +++ b/app/javascript/flavours/glitch/actions/blocks.js @@ -24,13 +24,13 @@ export function fetchBlocks() { dispatch(fetchRelationships(response.data.map(item => item.id))); }).catch(error => dispatch(fetchBlocksFail(error))); }; -}; +} export function fetchBlocksRequest() { return { type: BLOCKS_FETCH_REQUEST, }; -}; +} export function fetchBlocksSuccess(accounts, next) { return { @@ -38,14 +38,14 @@ export function fetchBlocksSuccess(accounts, next) { accounts, next, }; -}; +} export function fetchBlocksFail(error) { return { type: BLOCKS_FETCH_FAIL, error, }; -}; +} export function expandBlocks() { return (dispatch, getState) => { @@ -64,13 +64,13 @@ export function expandBlocks() { dispatch(fetchRelationships(response.data.map(item => item.id))); }).catch(error => dispatch(expandBlocksFail(error))); }; -}; +} export function expandBlocksRequest() { return { type: BLOCKS_EXPAND_REQUEST, }; -}; +} export function expandBlocksSuccess(accounts, next) { return { @@ -78,14 +78,14 @@ export function expandBlocksSuccess(accounts, next) { accounts, next, }; -}; +} export function expandBlocksFail(error) { return { type: BLOCKS_EXPAND_FAIL, error, }; -}; +} export function initBlockModal(account) { return dispatch => { diff --git a/app/javascript/flavours/glitch/actions/bookmarks.js b/app/javascript/flavours/glitch/actions/bookmarks.js index 544ed2ff2..3c8eec546 100644 --- a/app/javascript/flavours/glitch/actions/bookmarks.js +++ b/app/javascript/flavours/glitch/actions/bookmarks.js @@ -25,13 +25,13 @@ export function fetchBookmarkedStatuses() { dispatch(fetchBookmarkedStatusesFail(error)); }); }; -}; +} export function fetchBookmarkedStatusesRequest() { return { type: BOOKMARKED_STATUSES_FETCH_REQUEST, }; -}; +} export function fetchBookmarkedStatusesSuccess(statuses, next) { return { @@ -39,14 +39,14 @@ export function fetchBookmarkedStatusesSuccess(statuses, next) { statuses, next, }; -}; +} export function fetchBookmarkedStatusesFail(error) { return { type: BOOKMARKED_STATUSES_FETCH_FAIL, error, }; -}; +} export function expandBookmarkedStatuses() { return (dispatch, getState) => { @@ -66,13 +66,13 @@ export function expandBookmarkedStatuses() { dispatch(expandBookmarkedStatusesFail(error)); }); }; -}; +} export function expandBookmarkedStatusesRequest() { return { type: BOOKMARKED_STATUSES_EXPAND_REQUEST, }; -}; +} export function expandBookmarkedStatusesSuccess(statuses, next) { return { @@ -80,11 +80,11 @@ export function expandBookmarkedStatusesSuccess(statuses, next) { statuses, next, }; -}; +} export function expandBookmarkedStatusesFail(error) { return { type: BOOKMARKED_STATUSES_EXPAND_FAIL, error, }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/boosts.js b/app/javascript/flavours/glitch/actions/boosts.js index 6e14065d6..c0f0f3acc 100644 --- a/app/javascript/flavours/glitch/actions/boosts.js +++ b/app/javascript/flavours/glitch/actions/boosts.js @@ -11,7 +11,7 @@ export function initBoostModal(props) { dispatch({ type: BOOSTS_INIT_MODAL, - privacy + privacy, }); dispatch(openModal('BOOST', props)); diff --git a/app/javascript/flavours/glitch/actions/columns.js b/app/javascript/flavours/glitch/actions/columns.js index 9b87415fb..302c3f0f9 100644 --- a/app/javascript/flavours/glitch/actions/columns.js +++ b/app/javascript/flavours/glitch/actions/columns.js @@ -15,7 +15,7 @@ export function addColumn(id, params) { dispatch(saveSettings()); }; -}; +} export function removeColumn(uuid) { return dispatch => { @@ -26,7 +26,7 @@ export function removeColumn(uuid) { dispatch(saveSettings()); }; -}; +} export function moveColumn(uuid, direction) { return dispatch => { @@ -38,7 +38,7 @@ export function moveColumn(uuid, direction) { dispatch(saveSettings()); }; -}; +} export function changeColumnParams(uuid, path, value) { return dispatch => { diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js index 267cff563..01f0f3666 100644 --- a/app/javascript/flavours/glitch/actions/compose.js +++ b/app/javascript/flavours/glitch/actions/compose.js @@ -101,20 +101,20 @@ export function setComposeToStatus(status, text, spoiler_text, content_type) { spoiler_text, content_type, }; -}; +} export function changeCompose(text) { return { type: COMPOSE_CHANGE, text: text, }; -}; +} export function cycleElefriendCompose() { return { type: COMPOSE_CYCLE_ELEFRIEND, }; -}; +} export function replyCompose(status, routerHistory) { return (dispatch, getState) => { @@ -127,19 +127,19 @@ export function replyCompose(status, routerHistory) { ensureComposeIsVisible(getState, routerHistory); }; -}; +} export function cancelReplyCompose() { return { type: COMPOSE_REPLY_CANCEL, }; -}; +} export function resetCompose() { return { type: COMPOSE_RESET, }; -}; +} export function mentionCompose(account, routerHistory) { return (dispatch, getState) => { @@ -150,7 +150,7 @@ export function mentionCompose(account, routerHistory) { ensureComposeIsVisible(getState, routerHistory); }; -}; +} export function directCompose(account, routerHistory) { return (dispatch, getState) => { @@ -161,7 +161,7 @@ export function directCompose(account, routerHistory) { ensureComposeIsVisible(getState, routerHistory); }; -}; +} export function submitCompose(routerHistory) { return function (dispatch, getState) { @@ -257,34 +257,34 @@ export function submitCompose(routerHistory) { dispatch(submitComposeFail(error)); }); }; -}; +} export function submitComposeRequest() { return { type: COMPOSE_SUBMIT_REQUEST, }; -}; +} export function submitComposeSuccess(status) { return { type: COMPOSE_SUBMIT_SUCCESS, status: status, }; -}; +} export function submitComposeFail(error) { return { type: COMPOSE_SUBMIT_FAIL, error: error, }; -}; +} export function doodleSet(options) { return { type: COMPOSE_DOODLE_SET, options: options, }; -}; +} export function uploadCompose(files) { return function (dispatch, getState) { @@ -347,9 +347,9 @@ export function uploadCompose(files) { } }); }).catch(error => dispatch(uploadComposeFail(error))); - }; + } }; -}; +} export const uploadComposeProcessing = () => ({ type: COMPOSE_UPLOAD_PROCESSING, @@ -407,14 +407,14 @@ export function initMediaEditModal(id) { dispatch(openModal('FOCAL_POINT', { id })); }; -}; +} export function onChangeMediaDescription(description) { return { type: COMPOSE_CHANGE_MEDIA_DESCRIPTION, description, }; -}; +} export function onChangeMediaFocus(focusX, focusY) { return { @@ -422,7 +422,7 @@ export function onChangeMediaFocus(focusX, focusY) { focusX, focusY, }; -}; +} export function changeUploadCompose(id, params) { return (dispatch, getState) => { @@ -454,14 +454,14 @@ export function changeUploadCompose(id, params) { }); } }; -}; +} export function changeUploadComposeRequest() { return { type: COMPOSE_UPLOAD_CHANGE_REQUEST, skipLoading: true, }; -}; +} export function changeUploadComposeSuccess(media, attached) { return { @@ -470,7 +470,7 @@ export function changeUploadComposeSuccess(media, attached) { attached: attached, skipLoading: true, }; -}; +} export function changeUploadComposeFail(error) { return { @@ -478,14 +478,14 @@ export function changeUploadComposeFail(error) { error: error, skipLoading: true, }; -}; +} export function uploadComposeRequest() { return { type: COMPOSE_UPLOAD_REQUEST, skipLoading: true, }; -}; +} export function uploadComposeProgress(loaded, total) { return { @@ -493,7 +493,7 @@ export function uploadComposeProgress(loaded, total) { loaded: loaded, total: total, }; -}; +} export function uploadComposeSuccess(media, file) { return { @@ -502,7 +502,7 @@ export function uploadComposeSuccess(media, file) { file: file, skipLoading: true, }; -}; +} export function uploadComposeFail(error) { return { @@ -510,14 +510,14 @@ export function uploadComposeFail(error) { error: error, skipLoading: true, }; -}; +} export function undoUploadCompose(media_id) { return { type: COMPOSE_UPLOAD_UNDO, media_id: media_id, }; -}; +} export function clearComposeSuggestions() { if (fetchComposeSuggestionsAccountsController) { @@ -526,7 +526,7 @@ export function clearComposeSuggestions() { return { type: COMPOSE_SUGGESTIONS_CLEAR, }; -}; +} const fetchComposeSuggestionsAccounts = throttle((dispatch, getState, token) => { if (fetchComposeSuggestionsAccountsController) { @@ -603,7 +603,7 @@ export function fetchComposeSuggestions(token) { break; } }; -}; +} export function readyComposeSuggestionsEmojis(token, emojis) { return { @@ -611,7 +611,7 @@ export function readyComposeSuggestionsEmojis(token, emojis) { token, emojis, }; -}; +} export function readyComposeSuggestionsAccounts(token, accounts) { return { @@ -619,7 +619,7 @@ export function readyComposeSuggestionsAccounts(token, accounts) { token, accounts, }; -}; +} export const readyComposeSuggestionsTags = (token, tags) => ({ type: COMPOSE_SUGGESTIONS_READY, @@ -659,7 +659,7 @@ export function selectComposeSuggestion(position, token, suggestion, path) { }); } }; -}; +} export function updateSuggestionTags(token) { return { @@ -707,13 +707,13 @@ export function mountCompose() { return { type: COMPOSE_MOUNT, }; -}; +} export function unmountCompose() { return { type: COMPOSE_UNMOUNT, }; -}; +} export function changeComposeAdvancedOption(option, value) { return { @@ -727,7 +727,7 @@ export function changeComposeSensitivity() { return { type: COMPOSE_SENSITIVITY_CHANGE, }; -}; +} export const changeComposeLanguage = language => ({ type: COMPOSE_LANGUAGE_CHANGE, @@ -738,28 +738,28 @@ export function changeComposeSpoilerness() { return { type: COMPOSE_SPOILERNESS_CHANGE, }; -}; +} export function changeComposeSpoilerText(text) { return { type: COMPOSE_SPOILER_TEXT_CHANGE, text, }; -}; +} export function changeComposeVisibility(value) { return { type: COMPOSE_VISIBILITY_CHANGE, value, }; -}; +} export function changeComposeContentType(value) { return { type: COMPOSE_CONTENT_TYPE_CHANGE, value, }; -}; +} export function insertEmojiCompose(position, emoji) { return { @@ -767,26 +767,26 @@ export function insertEmojiCompose(position, emoji) { position, emoji, }; -}; +} export function addPoll() { return { type: COMPOSE_POLL_ADD, }; -}; +} export function removePoll() { return { type: COMPOSE_POLL_REMOVE, }; -}; +} export function addPollOption(title) { return { type: COMPOSE_POLL_OPTION_ADD, title, }; -}; +} export function changePollOption(index, title) { return { @@ -794,14 +794,14 @@ export function changePollOption(index, title) { index, title, }; -}; +} export function removePollOption(index) { return { type: COMPOSE_POLL_OPTION_REMOVE, index, }; -}; +} export function changePollSettings(expiresIn, isMultiple) { return { @@ -809,4 +809,4 @@ export function changePollSettings(expiresIn, isMultiple) { expiresIn, isMultiple, }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/custom_emojis.js b/app/javascript/flavours/glitch/actions/custom_emojis.js index 7b7d0091b..9ec8156b1 100644 --- a/app/javascript/flavours/glitch/actions/custom_emojis.js +++ b/app/javascript/flavours/glitch/actions/custom_emojis.js @@ -14,14 +14,14 @@ export function fetchCustomEmojis() { dispatch(fetchCustomEmojisFail(error)); }); }; -}; +} export function fetchCustomEmojisRequest() { return { type: CUSTOM_EMOJIS_FETCH_REQUEST, skipLoading: true, }; -}; +} export function fetchCustomEmojisSuccess(custom_emojis) { return { @@ -29,7 +29,7 @@ export function fetchCustomEmojisSuccess(custom_emojis) { custom_emojis, skipLoading: true, }; -}; +} export function fetchCustomEmojisFail(error) { return { @@ -37,4 +37,4 @@ export function fetchCustomEmojisFail(error) { error, skipLoading: true, }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/domain_blocks.js b/app/javascript/flavours/glitch/actions/domain_blocks.js index 34a33a654..d06de20a2 100644 --- a/app/javascript/flavours/glitch/actions/domain_blocks.js +++ b/app/javascript/flavours/glitch/actions/domain_blocks.js @@ -29,14 +29,14 @@ export function blockDomain(domain) { dispatch(blockDomainFail(domain, err)); }); }; -}; +} export function blockDomainRequest(domain) { return { type: DOMAIN_BLOCK_REQUEST, domain, }; -}; +} export function blockDomainSuccess(domain, accounts) { return { @@ -44,7 +44,7 @@ export function blockDomainSuccess(domain, accounts) { domain, accounts, }; -}; +} export function blockDomainFail(domain, error) { return { @@ -52,7 +52,7 @@ export function blockDomainFail(domain, error) { domain, error, }; -}; +} export function unblockDomain(domain) { return (dispatch, getState) => { @@ -66,14 +66,14 @@ export function unblockDomain(domain) { dispatch(unblockDomainFail(domain, err)); }); }; -}; +} export function unblockDomainRequest(domain) { return { type: DOMAIN_UNBLOCK_REQUEST, domain, }; -}; +} export function unblockDomainSuccess(domain, accounts) { return { @@ -81,7 +81,7 @@ export function unblockDomainSuccess(domain, accounts) { domain, accounts, }; -}; +} export function unblockDomainFail(domain, error) { return { @@ -89,7 +89,7 @@ export function unblockDomainFail(domain, error) { domain, error, }; -}; +} export function fetchDomainBlocks() { return (dispatch, getState) => { @@ -102,13 +102,13 @@ export function fetchDomainBlocks() { dispatch(fetchDomainBlocksFail(err)); }); }; -}; +} export function fetchDomainBlocksRequest() { return { type: DOMAIN_BLOCKS_FETCH_REQUEST, }; -}; +} export function fetchDomainBlocksSuccess(domains, next) { return { @@ -116,14 +116,14 @@ export function fetchDomainBlocksSuccess(domains, next) { domains, next, }; -}; +} export function fetchDomainBlocksFail(error) { return { type: DOMAIN_BLOCKS_FETCH_FAIL, error, }; -}; +} export function expandDomainBlocks() { return (dispatch, getState) => { @@ -142,13 +142,13 @@ export function expandDomainBlocks() { dispatch(expandDomainBlocksFail(err)); }); }; -}; +} export function expandDomainBlocksRequest() { return { type: DOMAIN_BLOCKS_EXPAND_REQUEST, }; -}; +} export function expandDomainBlocksSuccess(domains, next) { return { @@ -156,11 +156,11 @@ export function expandDomainBlocksSuccess(domains, next) { domains, next, }; -}; +} export function expandDomainBlocksFail(error) { return { type: DOMAIN_BLOCKS_EXPAND_FAIL, error, }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/emojis.js b/app/javascript/flavours/glitch/actions/emojis.js index 7cd9d4b7b..3b5d53996 100644 --- a/app/javascript/flavours/glitch/actions/emojis.js +++ b/app/javascript/flavours/glitch/actions/emojis.js @@ -11,4 +11,4 @@ export function useEmoji(emoji) { dispatch(saveSettings()); }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/favourites.js b/app/javascript/flavours/glitch/actions/favourites.js index 9448b1efe..7388e0c58 100644 --- a/app/javascript/flavours/glitch/actions/favourites.js +++ b/app/javascript/flavours/glitch/actions/favourites.js @@ -25,14 +25,14 @@ export function fetchFavouritedStatuses() { dispatch(fetchFavouritedStatusesFail(error)); }); }; -}; +} export function fetchFavouritedStatusesRequest() { return { type: FAVOURITED_STATUSES_FETCH_REQUEST, skipLoading: true, }; -}; +} export function fetchFavouritedStatusesSuccess(statuses, next) { return { @@ -41,7 +41,7 @@ export function fetchFavouritedStatusesSuccess(statuses, next) { next, skipLoading: true, }; -}; +} export function fetchFavouritedStatusesFail(error) { return { @@ -49,7 +49,7 @@ export function fetchFavouritedStatusesFail(error) { error, skipLoading: true, }; -}; +} export function expandFavouritedStatuses() { return (dispatch, getState) => { @@ -69,13 +69,13 @@ export function expandFavouritedStatuses() { dispatch(expandFavouritedStatusesFail(error)); }); }; -}; +} export function expandFavouritedStatusesRequest() { return { type: FAVOURITED_STATUSES_EXPAND_REQUEST, }; -}; +} export function expandFavouritedStatusesSuccess(statuses, next) { return { @@ -83,11 +83,11 @@ export function expandFavouritedStatusesSuccess(statuses, next) { statuses, next, }; -}; +} export function expandFavouritedStatusesFail(error) { return { type: FAVOURITED_STATUSES_EXPAND_FAIL, error, }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/height_cache.js b/app/javascript/flavours/glitch/actions/height_cache.js index 4c752993f..a8645410c 100644 --- a/app/javascript/flavours/glitch/actions/height_cache.js +++ b/app/javascript/flavours/glitch/actions/height_cache.js @@ -8,10 +8,10 @@ export function setHeight (key, id, height) { id, height, }; -}; +} export function clearHeight () { return { type: HEIGHT_CACHE_CLEAR, }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/interactions.js b/app/javascript/flavours/glitch/actions/interactions.js index 225ee7eb2..c7b552a65 100644 --- a/app/javascript/flavours/glitch/actions/interactions.js +++ b/app/javascript/flavours/glitch/actions/interactions.js @@ -54,7 +54,7 @@ export function reblog(status, visibility) { dispatch(reblogFail(status, error)); }); }; -}; +} export function unreblog(status) { return (dispatch, getState) => { @@ -67,21 +67,21 @@ export function unreblog(status) { dispatch(unreblogFail(status, error)); }); }; -}; +} export function reblogRequest(status) { return { type: REBLOG_REQUEST, status: status, }; -}; +} export function reblogSuccess(status) { return { type: REBLOG_SUCCESS, status: status, }; -}; +} export function reblogFail(status, error) { return { @@ -89,21 +89,21 @@ export function reblogFail(status, error) { status: status, error: error, }; -}; +} export function unreblogRequest(status) { return { type: UNREBLOG_REQUEST, status: status, }; -}; +} export function unreblogSuccess(status) { return { type: UNREBLOG_SUCCESS, status: status, }; -}; +} export function unreblogFail(status, error) { return { @@ -111,7 +111,7 @@ export function unreblogFail(status, error) { status: status, error: error, }; -}; +} export function favourite(status) { return function (dispatch, getState) { @@ -124,7 +124,7 @@ export function favourite(status) { dispatch(favouriteFail(status, error)); }); }; -}; +} export function unfavourite(status) { return (dispatch, getState) => { @@ -137,21 +137,21 @@ export function unfavourite(status) { dispatch(unfavouriteFail(status, error)); }); }; -}; +} export function favouriteRequest(status) { return { type: FAVOURITE_REQUEST, status: status, }; -}; +} export function favouriteSuccess(status) { return { type: FAVOURITE_SUCCESS, status: status, }; -}; +} export function favouriteFail(status, error) { return { @@ -159,21 +159,21 @@ export function favouriteFail(status, error) { status: status, error: error, }; -}; +} export function unfavouriteRequest(status) { return { type: UNFAVOURITE_REQUEST, status: status, }; -}; +} export function unfavouriteSuccess(status) { return { type: UNFAVOURITE_SUCCESS, status: status, }; -}; +} export function unfavouriteFail(status, error) { return { @@ -181,7 +181,7 @@ export function unfavouriteFail(status, error) { status: status, error: error, }; -}; +} export function bookmark(status) { return function (dispatch, getState) { @@ -194,7 +194,7 @@ export function bookmark(status) { dispatch(bookmarkFail(status, error)); }); }; -}; +} export function unbookmark(status) { return (dispatch, getState) => { @@ -207,21 +207,21 @@ export function unbookmark(status) { dispatch(unbookmarkFail(status, error)); }); }; -}; +} export function bookmarkRequest(status) { return { type: BOOKMARK_REQUEST, status: status, }; -}; +} export function bookmarkSuccess(status) { return { type: BOOKMARK_SUCCESS, status: status, }; -}; +} export function bookmarkFail(status, error) { return { @@ -229,21 +229,21 @@ export function bookmarkFail(status, error) { status: status, error: error, }; -}; +} export function unbookmarkRequest(status) { return { type: UNBOOKMARK_REQUEST, status: status, }; -}; +} export function unbookmarkSuccess(status) { return { type: UNBOOKMARK_SUCCESS, status: status, }; -}; +} export function unbookmarkFail(status, error) { return { @@ -251,7 +251,7 @@ export function unbookmarkFail(status, error) { status: status, error: error, }; -}; +} export function fetchReblogs(id) { return (dispatch, getState) => { @@ -264,14 +264,14 @@ export function fetchReblogs(id) { dispatch(fetchReblogsFail(id, error)); }); }; -}; +} export function fetchReblogsRequest(id) { return { type: REBLOGS_FETCH_REQUEST, id, }; -}; +} export function fetchReblogsSuccess(id, accounts) { return { @@ -279,14 +279,14 @@ export function fetchReblogsSuccess(id, accounts) { id, accounts, }; -}; +} export function fetchReblogsFail(id, error) { return { type: REBLOGS_FETCH_FAIL, error, }; -}; +} export function fetchFavourites(id) { return (dispatch, getState) => { @@ -299,14 +299,14 @@ export function fetchFavourites(id) { dispatch(fetchFavouritesFail(id, error)); }); }; -}; +} export function fetchFavouritesRequest(id) { return { type: FAVOURITES_FETCH_REQUEST, id, }; -}; +} export function fetchFavouritesSuccess(id, accounts) { return { @@ -314,14 +314,14 @@ export function fetchFavouritesSuccess(id, accounts) { id, accounts, }; -}; +} export function fetchFavouritesFail(id, error) { return { type: FAVOURITES_FETCH_FAIL, error, }; -}; +} export function pin(status) { return (dispatch, getState) => { @@ -334,21 +334,21 @@ export function pin(status) { dispatch(pinFail(status, error)); }); }; -}; +} export function pinRequest(status) { return { type: PIN_REQUEST, status, }; -}; +} export function pinSuccess(status) { return { type: PIN_SUCCESS, status, }; -}; +} export function pinFail(status, error) { return { @@ -356,7 +356,7 @@ export function pinFail(status, error) { status, error, }; -}; +} export function unpin (status) { return (dispatch, getState) => { @@ -369,21 +369,21 @@ export function unpin (status) { dispatch(unpinFail(status, error)); }); }; -}; +} export function unpinRequest(status) { return { type: UNPIN_REQUEST, status, }; -}; +} export function unpinSuccess(status) { return { type: UNPIN_SUCCESS, status, }; -}; +} export function unpinFail(status, error) { return { @@ -391,4 +391,4 @@ export function unpinFail(status, error) { status, error, }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/local_settings.js b/app/javascript/flavours/glitch/actions/local_settings.js index a4a928611..adf7fd2ab 100644 --- a/app/javascript/flavours/glitch/actions/local_settings.js +++ b/app/javascript/flavours/glitch/actions/local_settings.js @@ -33,14 +33,14 @@ export function checkDeprecatedLocalSettings() { })); } }; -}; +} export function clearDeprecatedLocalSettings() { return (dispatch) => { dispatch(deleteLocalSetting(['content_warnings', 'auto_unfold'])); dispatch(deleteLocalSetting(['swipe_to_change_columns'])); }; -}; +} export function changeLocalSetting(key, value) { return dispatch => { @@ -52,7 +52,7 @@ export function changeLocalSetting(key, value) { dispatch(saveLocalSettings()); }; -}; +} export function deleteLocalSetting(key) { return dispatch => { @@ -63,7 +63,7 @@ export function deleteLocalSetting(key) { dispatch(saveLocalSettings()); }; -}; +} // __TODO :__ // Right now `saveLocalSettings()` doesn't keep track of which user @@ -74,4 +74,4 @@ export function saveLocalSettings() { const localSettings = getState().get('local_settings').toJS(); localStorage.setItem('mastodon-settings', JSON.stringify(localSettings)); }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/markers.js b/app/javascript/flavours/glitch/actions/markers.js index 3b6a76bc4..dfd701cbb 100644 --- a/app/javascript/flavours/glitch/actions/markers.js +++ b/app/javascript/flavours/glitch/actions/markers.js @@ -101,7 +101,7 @@ export function submitMarkersSuccess({ home, notifications }) { home: (home || {}).last_read_id, notifications: (notifications || {}).last_read_id, }; -}; +} export function submitMarkers(params = {}) { const result = (dispatch, getState) => debouncedSubmitMarkers(dispatch, getState); @@ -111,7 +111,7 @@ export function submitMarkers(params = {}) { } return result; -}; +} export const fetchMarkers = () => (dispatch, getState) => { const params = { timeline: ['notifications'] }; @@ -130,7 +130,7 @@ export function fetchMarkersRequest() { type: MARKERS_FETCH_REQUEST, skipLoading: true, }; -}; +} export function fetchMarkersSuccess(markers) { return { @@ -138,7 +138,7 @@ export function fetchMarkersSuccess(markers) { markers, skipLoading: true, }; -}; +} export function fetchMarkersFail(error) { return { @@ -147,4 +147,4 @@ export function fetchMarkersFail(error) { skipLoading: true, skipAlert: true, }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/modal.js b/app/javascript/flavours/glitch/actions/modal.js index 3e576fab8..ef2ae0e4c 100644 --- a/app/javascript/flavours/glitch/actions/modal.js +++ b/app/javascript/flavours/glitch/actions/modal.js @@ -7,7 +7,7 @@ export function openModal(type, props) { modalType: type, modalProps: props, }; -}; +} export function closeModal(type, options = { ignoreFocus: false }) { return { @@ -15,4 +15,4 @@ export function closeModal(type, options = { ignoreFocus: false }) { modalType: type, ignoreFocus: options.ignoreFocus, }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/mutes.js b/app/javascript/flavours/glitch/actions/mutes.js index 1ccf9592f..aa47d1464 100644 --- a/app/javascript/flavours/glitch/actions/mutes.js +++ b/app/javascript/flavours/glitch/actions/mutes.js @@ -26,13 +26,13 @@ export function fetchMutes() { dispatch(fetchRelationships(response.data.map(item => item.id))); }).catch(error => dispatch(fetchMutesFail(error))); }; -}; +} export function fetchMutesRequest() { return { type: MUTES_FETCH_REQUEST, }; -}; +} export function fetchMutesSuccess(accounts, next) { return { @@ -40,14 +40,14 @@ export function fetchMutesSuccess(accounts, next) { accounts, next, }; -}; +} export function fetchMutesFail(error) { return { type: MUTES_FETCH_FAIL, error, }; -}; +} export function expandMutes() { return (dispatch, getState) => { @@ -66,13 +66,13 @@ export function expandMutes() { dispatch(fetchRelationships(response.data.map(item => item.id))); }).catch(error => dispatch(expandMutesFail(error))); }; -}; +} export function expandMutesRequest() { return { type: MUTES_EXPAND_REQUEST, }; -}; +} export function expandMutesSuccess(accounts, next) { return { @@ -80,14 +80,14 @@ export function expandMutesSuccess(accounts, next) { accounts, next, }; -}; +} export function expandMutesFail(error) { return { type: MUTES_EXPAND_FAIL, error, }; -}; +} export function initMuteModal(account) { return dispatch => { diff --git a/app/javascript/flavours/glitch/actions/notifications.js b/app/javascript/flavours/glitch/actions/notifications.js index 158a5b7e4..989bc4144 100644 --- a/app/javascript/flavours/glitch/actions/notifications.js +++ b/app/javascript/flavours/glitch/actions/notifications.js @@ -129,7 +129,7 @@ export function updateNotifications(notification, intlMessages, intlLocale) { }); } }; -}; +} const excludeTypesFromSettings = state => state.getIn(['settings', 'notifications', 'shows']).filter(enabled => !enabled).keySeq().toJS(); @@ -209,14 +209,14 @@ export function expandNotifications({ maxId, forceLoad } = {}, done = noOp) { done(); }); }; -}; +} export function expandNotificationsRequest(isLoadingMore) { return { type: NOTIFICATIONS_EXPAND_REQUEST, skipLoading: !isLoadingMore, }; -}; +} export function expandNotificationsSuccess(notifications, next, isLoadingMore, isLoadingRecent, usePendingItems) { return { @@ -227,7 +227,7 @@ export function expandNotificationsSuccess(notifications, next, isLoadingMore, i usePendingItems, skipLoading: !isLoadingMore, }; -}; +} export function expandNotificationsFail(error, isLoadingMore) { return { @@ -236,7 +236,7 @@ export function expandNotificationsFail(error, isLoadingMore) { skipLoading: !isLoadingMore, skipAlert: !isLoadingMore || error.name === 'AbortError', }; -}; +} export function clearNotifications() { return (dispatch, getState) => { @@ -246,14 +246,14 @@ export function clearNotifications() { api(getState).post('/api/v1/notifications/clear'); }; -}; +} export function scrollTopNotifications(top) { return { type: NOTIFICATIONS_SCROLL_TOP, top, }; -}; +} export function deleteMarkedNotifications() { return (dispatch, getState) => { @@ -277,33 +277,33 @@ export function deleteMarkedNotifications() { dispatch(deleteMarkedNotificationsFail(error)); }); }; -}; +} export function enterNotificationClearingMode(yes) { return { type: NOTIFICATIONS_ENTER_CLEARING_MODE, yes: yes, }; -}; +} export function markAllNotifications(yes) { return { type: NOTIFICATIONS_MARK_ALL_FOR_DELETE, yes: yes, // true, false or null. null = invert }; -}; +} export function deleteMarkedNotificationsRequest() { return { type: NOTIFICATIONS_DELETE_MARKED_REQUEST, }; -}; +} export function deleteMarkedNotificationsFail() { return { type: NOTIFICATIONS_DELETE_MARKED_FAIL, }; -}; +} export function markNotificationForDelete(id, yes) { return { @@ -311,32 +311,32 @@ export function markNotificationForDelete(id, yes) { id: id, yes: yes, }; -}; +} export function deleteMarkedNotificationsSuccess() { return { type: NOTIFICATIONS_DELETE_MARKED_SUCCESS, }; -}; +} export function mountNotifications() { return { type: NOTIFICATIONS_MOUNT, }; -}; +} export function unmountNotifications() { return { type: NOTIFICATIONS_UNMOUNT, }; -}; +} export function notificationsSetVisibility(visibility) { return { type: NOTIFICATIONS_SET_VISIBILITY, visibility: visibility, }; -}; +} export function setFilter (filterType) { return dispatch => { @@ -348,13 +348,13 @@ export function setFilter (filterType) { dispatch(expandNotifications({ forceLoad: true })); dispatch(saveSettings()); }; -}; +} export function markNotificationsAsRead() { return { type: NOTIFICATIONS_MARK_AS_READ, }; -}; +} // Browser support export function setupBrowserNotifications() { @@ -379,7 +379,7 @@ export function requestBrowserPermission(callback = noOp) { callback(permission); }); }; -}; +} export function setBrowserSupport (value) { return { diff --git a/app/javascript/flavours/glitch/actions/onboarding.js b/app/javascript/flavours/glitch/actions/onboarding.js index a161c50ef..5038b7eb6 100644 --- a/app/javascript/flavours/glitch/actions/onboarding.js +++ b/app/javascript/flavours/glitch/actions/onboarding.js @@ -11,4 +11,4 @@ export function showOnboardingOnce() { dispatch(saveSettings()); } }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/pin_statuses.js b/app/javascript/flavours/glitch/actions/pin_statuses.js index 0926978ac..d8c0a1373 100644 --- a/app/javascript/flavours/glitch/actions/pin_statuses.js +++ b/app/javascript/flavours/glitch/actions/pin_statuses.js @@ -18,13 +18,13 @@ export function fetchPinnedStatuses() { dispatch(fetchPinnedStatusesFail(error)); }); }; -}; +} export function fetchPinnedStatusesRequest() { return { type: PINNED_STATUSES_FETCH_REQUEST, }; -}; +} export function fetchPinnedStatusesSuccess(statuses, next) { return { @@ -32,11 +32,11 @@ export function fetchPinnedStatusesSuccess(statuses, next) { statuses, next, }; -}; +} export function fetchPinnedStatusesFail(error) { return { type: PINNED_STATUSES_FETCH_FAIL, error, }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/search.js b/app/javascript/flavours/glitch/actions/search.js index f21c0058b..0012808e5 100644 --- a/app/javascript/flavours/glitch/actions/search.js +++ b/app/javascript/flavours/glitch/actions/search.js @@ -19,13 +19,13 @@ export function changeSearch(value) { type: SEARCH_CHANGE, value, }; -}; +} export function clearSearch() { return { type: SEARCH_CLEAR, }; -}; +} export function submitSearch() { return (dispatch, getState) => { @@ -60,13 +60,13 @@ export function submitSearch() { dispatch(fetchSearchFail(error)); }); }; -}; +} export function fetchSearchRequest() { return { type: SEARCH_FETCH_REQUEST, }; -}; +} export function fetchSearchSuccess(results, searchTerm) { return { @@ -74,14 +74,14 @@ export function fetchSearchSuccess(results, searchTerm) { results, searchTerm, }; -}; +} export function fetchSearchFail(error) { return { type: SEARCH_FETCH_FAIL, error, }; -}; +} export const expandSearch = type => (dispatch, getState) => { const value = getState().getIn(['search', 'value']); diff --git a/app/javascript/flavours/glitch/actions/settings.js b/app/javascript/flavours/glitch/actions/settings.js index 5634a11ef..60f0abf95 100644 --- a/app/javascript/flavours/glitch/actions/settings.js +++ b/app/javascript/flavours/glitch/actions/settings.js @@ -15,7 +15,7 @@ export function changeSetting(path, value) { dispatch(saveSettings()); }; -}; +} const debouncedSave = debounce((dispatch, getState) => { if (getState().getIn(['settings', 'saved'])) { @@ -31,4 +31,4 @@ const debouncedSave = debounce((dispatch, getState) => { export function saveSettings() { return (dispatch, getState) => debouncedSave(dispatch, getState); -}; +} diff --git a/app/javascript/flavours/glitch/actions/statuses.js b/app/javascript/flavours/glitch/actions/statuses.js index efb4cc33b..487cd6988 100644 --- a/app/javascript/flavours/glitch/actions/statuses.js +++ b/app/javascript/flavours/glitch/actions/statuses.js @@ -45,7 +45,7 @@ export function fetchStatusRequest(id, skipLoading) { id, skipLoading, }; -}; +} export function fetchStatus(id, forceFetch = false) { return (dispatch, getState) => { @@ -66,14 +66,14 @@ export function fetchStatus(id, forceFetch = false) { dispatch(fetchStatusFail(id, error, skipLoading)); }); }; -}; +} export function fetchStatusSuccess(skipLoading) { return { type: STATUS_FETCH_SUCCESS, skipLoading, }; -}; +} export function fetchStatusFail(id, error, skipLoading) { return { @@ -83,7 +83,7 @@ export function fetchStatusFail(id, error, skipLoading) { skipLoading, skipAlert: true, }; -}; +} export function redraft(status, raw_text, content_type) { return { @@ -92,7 +92,7 @@ export function redraft(status, raw_text, content_type) { raw_text, content_type, }; -}; +} export const editStatus = (id, routerHistory) => (dispatch, getState) => { let status = getState().getIn(['statuses', id]); @@ -148,21 +148,21 @@ export function deleteStatus(id, routerHistory, withRedraft = false) { dispatch(deleteStatusFail(id, error)); }); }; -}; +} export function deleteStatusRequest(id) { return { type: STATUS_DELETE_REQUEST, id: id, }; -}; +} export function deleteStatusSuccess(id) { return { type: STATUS_DELETE_SUCCESS, id: id, }; -}; +} export function deleteStatusFail(id, error) { return { @@ -170,7 +170,7 @@ export function deleteStatusFail(id, error) { id: id, error: error, }; -}; +} export const updateStatus = status => dispatch => dispatch(importFetchedStatus(status)); @@ -191,14 +191,14 @@ export function fetchContext(id) { dispatch(fetchContextFail(id, error)); }); }; -}; +} export function fetchContextRequest(id) { return { type: CONTEXT_FETCH_REQUEST, id, }; -}; +} export function fetchContextSuccess(id, ancestors, descendants) { return { @@ -208,7 +208,7 @@ export function fetchContextSuccess(id, ancestors, descendants) { descendants, statuses: ancestors.concat(descendants), }; -}; +} export function fetchContextFail(id, error) { return { @@ -217,7 +217,7 @@ export function fetchContextFail(id, error) { error, skipAlert: true, }; -}; +} export function muteStatus(id) { return (dispatch, getState) => { @@ -229,21 +229,21 @@ export function muteStatus(id) { dispatch(muteStatusFail(id, error)); }); }; -}; +} export function muteStatusRequest(id) { return { type: STATUS_MUTE_REQUEST, id, }; -}; +} export function muteStatusSuccess(id) { return { type: STATUS_MUTE_SUCCESS, id, }; -}; +} export function muteStatusFail(id, error) { return { @@ -251,7 +251,7 @@ export function muteStatusFail(id, error) { id, error, }; -}; +} export function unmuteStatus(id) { return (dispatch, getState) => { @@ -263,21 +263,21 @@ export function unmuteStatus(id) { dispatch(unmuteStatusFail(id, error)); }); }; -}; +} export function unmuteStatusRequest(id) { return { type: STATUS_UNMUTE_REQUEST, id, }; -}; +} export function unmuteStatusSuccess(id) { return { type: STATUS_UNMUTE_SUCCESS, id, }; -}; +} export function unmuteStatusFail(id, error) { return { @@ -285,7 +285,7 @@ export function unmuteStatusFail(id, error) { id, error, }; -}; +} export function hideStatus(ids) { if (!Array.isArray(ids)) { @@ -296,7 +296,7 @@ export function hideStatus(ids) { type: STATUS_HIDE, ids, }; -}; +} export function revealStatus(ids) { if (!Array.isArray(ids)) { @@ -307,7 +307,7 @@ export function revealStatus(ids) { type: STATUS_REVEAL, ids, }; -}; +} export function toggleStatusCollapse(id, isCollapsed) { return { @@ -315,7 +315,7 @@ export function toggleStatusCollapse(id, isCollapsed) { id, isCollapsed, }; -}; +} export const translateStatus = id => (dispatch, getState) => { dispatch(translateStatusRequest(id)); diff --git a/app/javascript/flavours/glitch/actions/store.js b/app/javascript/flavours/glitch/actions/store.js index 9dbc0b214..137b68e22 100644 --- a/app/javascript/flavours/glitch/actions/store.js +++ b/app/javascript/flavours/glitch/actions/store.js @@ -18,7 +18,7 @@ const applyMigrations = (state) => { if (state.getIn(['settings', 'notifications', 'showUnread']) !== false) { state.setIn(['settings', 'notifications', 'showUnread'], state.getIn(['local_settings', 'notifications', 'show_unread'])); } - state.removeIn(['local_settings', 'notifications', 'show_unread']) + state.removeIn(['local_settings', 'notifications', 'show_unread']); } }); }; @@ -36,4 +36,4 @@ export function hydrateStore(rawState) { dispatch(importFetchedAccounts(Object.values(rawState.accounts))); dispatch(saveSettings()); }; -}; +} diff --git a/app/javascript/flavours/glitch/actions/suggestions.js b/app/javascript/flavours/glitch/actions/suggestions.js index 1f1116e75..9e8cd1ea4 100644 --- a/app/javascript/flavours/glitch/actions/suggestions.js +++ b/app/javascript/flavours/glitch/actions/suggestions.js @@ -21,14 +21,14 @@ export function fetchSuggestions(withRelationships = false) { } }).catch(error => dispatch(fetchSuggestionsFail(error))); }; -}; +} export function fetchSuggestionsRequest() { return { type: SUGGESTIONS_FETCH_REQUEST, skipLoading: true, }; -}; +} export function fetchSuggestionsSuccess(suggestions) { return { @@ -36,7 +36,7 @@ export function fetchSuggestionsSuccess(suggestions) { suggestions, skipLoading: true, }; -}; +} export function fetchSuggestionsFail(error) { return { @@ -45,7 +45,7 @@ export function fetchSuggestionsFail(error) { skipLoading: true, skipAlert: true, }; -}; +} export const dismissSuggestion = accountId => (dispatch, getState) => { dispatch({ diff --git a/app/javascript/flavours/glitch/actions/timelines.js b/app/javascript/flavours/glitch/actions/timelines.js index a1c4dd43a..eb817daf9 100644 --- a/app/javascript/flavours/glitch/actions/timelines.js +++ b/app/javascript/flavours/glitch/actions/timelines.js @@ -55,14 +55,14 @@ export function updateTimeline(timeline, status, accept) { timeline, status, usePendingItems: preferPendingItems, - filtered + filtered, }); if (timeline === 'home') { dispatch(submitMarkers()); } }; -}; +} export function deleteFromTimelines(id) { return (dispatch, getState) => { @@ -78,13 +78,13 @@ export function deleteFromTimelines(id) { reblogOf, }); }; -}; +} export function clearTimeline(timeline) { return (dispatch) => { dispatch({ type: TIMELINE_CLEAR, timeline }); }; -}; +} const noOp = () => {}; @@ -134,7 +134,7 @@ export function expandTimeline(timelineId, path, params = {}, done = noOp) { done(); }); }; -}; +} export function fillTimelineGaps(timelineId, path, params = {}, done = noOp) { return (dispatch, getState) => { @@ -181,7 +181,7 @@ export function expandTimelineRequest(timeline, isLoadingMore) { timeline, skipLoading: !isLoadingMore, }; -}; +} export function expandTimelineSuccess(timeline, statuses, next, partial, isLoadingRecent, isLoadingMore, usePendingItems) { return { @@ -194,7 +194,7 @@ export function expandTimelineSuccess(timeline, statuses, next, partial, isLoadi usePendingItems, skipLoading: !isLoadingMore, }; -}; +} export function expandTimelineFail(timeline, error, isLoadingMore) { return { @@ -204,7 +204,7 @@ export function expandTimelineFail(timeline, error, isLoadingMore) { skipLoading: !isLoadingMore, skipNotFound: timeline.startsWith('account:'), }; -}; +} export function scrollTopTimeline(timeline, top) { return { @@ -212,7 +212,7 @@ export function scrollTopTimeline(timeline, top) { timeline, top, }; -}; +} export function connectTimeline(timeline) { return { @@ -220,7 +220,7 @@ export function connectTimeline(timeline) { timeline, usePendingItems: preferPendingItems, }; -}; +} export const disconnectTimeline = timeline => ({ type: TIMELINE_DISCONNECT, diff --git a/app/javascript/flavours/glitch/compare_id.js b/app/javascript/flavours/glitch/compare_id.js index 66cf51c4b..d2bd74f44 100644 --- a/app/javascript/flavours/glitch/compare_id.js +++ b/app/javascript/flavours/glitch/compare_id.js @@ -8,4 +8,4 @@ export default function compareId (id1, id2) { } else { return id1.length > id2.length ? 1 : -1; } -}; +} diff --git a/app/javascript/flavours/glitch/components/account.js b/app/javascript/flavours/glitch/components/account.js index 8e810ce5f..7ce4b65aa 100644 --- a/app/javascript/flavours/glitch/components/account.js +++ b/app/javascript/flavours/glitch/components/account.js @@ -48,27 +48,27 @@ class Account extends ImmutablePureComponent { handleFollow = () => { this.props.onFollow(this.props.account); - } + }; handleBlock = () => { this.props.onBlock(this.props.account); - } + }; handleMute = () => { this.props.onMute(this.props.account); - } + }; handleMuteNotifications = () => { this.props.onMuteNotifications(this.props.account, true); - } + }; handleUnmuteNotifications = () => { this.props.onMuteNotifications(this.props.account, false); - } + }; handleAction = () => { this.props.onActionClick(this.props.account); - } + }; render () { const { diff --git a/app/javascript/flavours/glitch/components/admin/Retention.js b/app/javascript/flavours/glitch/components/admin/Retention.js index 9cc39040b..e1ba3f6c9 100644 --- a/app/javascript/flavours/glitch/components/admin/Retention.js +++ b/app/javascript/flavours/glitch/components/admin/Retention.js @@ -137,7 +137,7 @@ export default class Retention extends React.PureComponent { break; default: title = ; - }; + } return (
diff --git a/app/javascript/flavours/glitch/components/animated_number.js b/app/javascript/flavours/glitch/components/animated_number.js index 9431c96f7..dd21d97f0 100644 --- a/app/javascript/flavours/glitch/components/animated_number.js +++ b/app/javascript/flavours/glitch/components/animated_number.js @@ -38,13 +38,13 @@ export default class AnimatedNumber extends React.PureComponent { const { direction } = this.state; return { y: -1 * direction }; - } + }; willLeave = () => { const { direction } = this.state; return { y: spring(1 * direction, { damping: 35, stiffness: 400 }) }; - } + }; render () { const { value, obfuscate } = this.props; diff --git a/app/javascript/flavours/glitch/components/autosuggest_input.js b/app/javascript/flavours/glitch/components/autosuggest_input.js index c7b024652..4d751e281 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_input.js +++ b/app/javascript/flavours/glitch/components/autosuggest_input.js @@ -78,7 +78,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { } this.props.onChange(e); - } + }; onKeyDown = (e) => { const { suggestions, disabled } = this.props; @@ -136,22 +136,22 @@ export default class AutosuggestInput extends ImmutablePureComponent { } this.props.onKeyDown(e); - } + }; onBlur = () => { this.setState({ suggestionsHidden: true, focused: false }); - } + }; onFocus = () => { this.setState({ focused: true }); - } + }; onSuggestionClick = (e) => { const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index')); e.preventDefault(); this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion); this.input.focus(); - } + }; componentWillReceiveProps (nextProps) { if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { @@ -161,7 +161,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { setInput = (c) => { this.input = c; - } + }; renderSuggestion = (suggestion, i) => { const { selectedSuggestion } = this.state; @@ -183,7 +183,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { {inner}
); - } + }; render () { const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength, lang } = this.props; diff --git a/app/javascript/flavours/glitch/components/autosuggest_textarea.js b/app/javascript/flavours/glitch/components/autosuggest_textarea.js index 68c083433..6e6e567b9 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_textarea.js +++ b/app/javascript/flavours/glitch/components/autosuggest_textarea.js @@ -75,7 +75,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { } this.props.onChange(e); - } + }; onKeyDown = (e) => { const { suggestions, disabled } = this.props; @@ -133,25 +133,25 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { } this.props.onKeyDown(e); - } + }; onBlur = () => { this.setState({ suggestionsHidden: true, focused: false }); - } + }; onFocus = (e) => { this.setState({ focused: true }); if (this.props.onFocus) { this.props.onFocus(e); } - } + }; onSuggestionClick = (e) => { const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index')); e.preventDefault(); this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion); this.textarea.focus(); - } + }; componentWillReceiveProps (nextProps) { if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { @@ -161,14 +161,14 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { setTextarea = (c) => { this.textarea = c; - } + }; onPaste = (e) => { if (e.clipboardData && e.clipboardData.files.length === 1) { this.props.onPaste(e.clipboardData.files); e.preventDefault(); } - } + }; renderSuggestion = (suggestion, i) => { const { selectedSuggestion } = this.state; @@ -190,7 +190,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { {inner} ); - } + }; render () { const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, lang, children } = this.props; diff --git a/app/javascript/flavours/glitch/components/avatar.js b/app/javascript/flavours/glitch/components/avatar.js index 38fd99af5..f30b33e70 100644 --- a/app/javascript/flavours/glitch/components/avatar.js +++ b/app/javascript/flavours/glitch/components/avatar.js @@ -28,12 +28,12 @@ export default class Avatar extends React.PureComponent { handleMouseEnter = () => { if (this.props.animate) return; this.setState({ hovering: true }); - } + }; handleMouseLeave = () => { if (this.props.animate) return; this.setState({ hovering: false }); - } + }; render () { const { diff --git a/app/javascript/flavours/glitch/components/button.js b/app/javascript/flavours/glitch/components/button.js index b1815c3e1..40b8f5a15 100644 --- a/app/javascript/flavours/glitch/components/button.js +++ b/app/javascript/flavours/glitch/components/button.js @@ -19,11 +19,11 @@ export default class Button extends React.PureComponent { if (!this.props.disabled) { this.props.onClick(e); } - } + }; setRef = (c) => { this.node = c; - } + }; focus() { this.node.focus(); diff --git a/app/javascript/flavours/glitch/components/column.js b/app/javascript/flavours/glitch/components/column.js index cf0e6d5e4..47293ef18 100644 --- a/app/javascript/flavours/glitch/components/column.js +++ b/app/javascript/flavours/glitch/components/column.js @@ -29,11 +29,11 @@ export default class Column extends React.PureComponent { } this._interruptScrollAnimation(); - } + }; setRef = c => { this.node = c; - } + }; componentDidMount () { if (this.props.bindToDocument) { diff --git a/app/javascript/flavours/glitch/components/column_back_button.js b/app/javascript/flavours/glitch/components/column_back_button.js index 05688f867..e9e2615cb 100644 --- a/app/javascript/flavours/glitch/components/column_back_button.js +++ b/app/javascript/flavours/glitch/components/column_back_button.js @@ -26,7 +26,7 @@ export default class ColumnBackButton extends React.PureComponent { } else { this.context.router.history.push('/'); } - } + }; render () { const { multiColumn } = this.props; diff --git a/app/javascript/flavours/glitch/components/column_back_button_slim.js b/app/javascript/flavours/glitch/components/column_back_button_slim.js index faa0c23a8..b43d85b3b 100644 --- a/app/javascript/flavours/glitch/components/column_back_button_slim.js +++ b/app/javascript/flavours/glitch/components/column_back_button_slim.js @@ -21,7 +21,7 @@ export default class ColumnBackButtonSlim extends React.PureComponent { } else { this.context.router.history.push('/'); } - } + }; render () { return ( diff --git a/app/javascript/flavours/glitch/components/column_header.js b/app/javascript/flavours/glitch/components/column_header.js index 0f89b3a97..3790960dd 100644 --- a/app/javascript/flavours/glitch/components/column_header.js +++ b/app/javascript/flavours/glitch/components/column_header.js @@ -55,39 +55,39 @@ class ColumnHeader extends React.PureComponent { } else { this.context.router.history.push('/'); } - } + }; handleToggleClick = (e) => { e.stopPropagation(); this.setState({ collapsed: !this.state.collapsed, animating: true }); - } + }; handleTitleClick = () => { this.props.onClick?.(); - } + }; handleMoveLeft = () => { this.props.onMove(-1); - } + }; handleMoveRight = () => { this.props.onMove(1); - } + }; handleBackClick = (event) => { this.historyBack(event.shiftKey); - } + }; handleTransitionEnd = () => { this.setState({ animating: false }); - } + }; handlePin = () => { if (!this.props.pinned) { this.historyBack(); } this.props.onPin(); - } + }; render () { const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder, appendContent, collapseIssues } = this.props; diff --git a/app/javascript/flavours/glitch/components/dismissable_banner.js b/app/javascript/flavours/glitch/components/dismissable_banner.js index ff52a619d..c4968ac3c 100644 --- a/app/javascript/flavours/glitch/components/dismissable_banner.js +++ b/app/javascript/flavours/glitch/components/dismissable_banner.js @@ -24,7 +24,7 @@ class DismissableBanner extends React.PureComponent { handleDismiss = () => { const { id } = this.props; this.setState({ visible: false }, () => bannerSettings.set(id, true)); - } + }; render () { const { visible } = this.state; diff --git a/app/javascript/flavours/glitch/components/display_name.js b/app/javascript/flavours/glitch/components/display_name.js index 1c2297578..19f63ec60 100644 --- a/app/javascript/flavours/glitch/components/display_name.js +++ b/app/javascript/flavours/glitch/components/display_name.js @@ -27,7 +27,7 @@ export default class DisplayName extends React.PureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-original'); } - } + }; handleMouseLeave = ({ currentTarget }) => { if (autoPlayGif) { @@ -40,7 +40,7 @@ export default class DisplayName extends React.PureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-static'); } - } + }; render() { const { account, className, inline, localDomain, others, onAccountClick } = this.props; @@ -74,7 +74,7 @@ export default class DisplayName extends React.PureComponent { )).reduce((prev, cur) => [prev, ', ', cur]); if (others.size - 2 > 0) { - displayName.push(` +${others.size - 2}`); + displayName.push(` +${others.size - 2}`); } suffix = ( diff --git a/app/javascript/flavours/glitch/components/domain.js b/app/javascript/flavours/glitch/components/domain.js index 697065d87..e09fa4591 100644 --- a/app/javascript/flavours/glitch/components/domain.js +++ b/app/javascript/flavours/glitch/components/domain.js @@ -19,7 +19,7 @@ class Account extends ImmutablePureComponent { handleDomainUnblock = () => { this.props.onUnblockDomain(this.props.domain); - } + }; render () { const { domain, intl } = this.props; diff --git a/app/javascript/flavours/glitch/components/dropdown_menu.js b/app/javascript/flavours/glitch/components/dropdown_menu.js index 7c70f750f..f4b6e059f 100644 --- a/app/javascript/flavours/glitch/components/dropdown_menu.js +++ b/app/javascript/flavours/glitch/components/dropdown_menu.js @@ -36,7 +36,7 @@ class DropdownMenu extends React.PureComponent { if (this.node && !this.node.contains(e.target)) { this.props.onClose(); } - } + }; componentDidMount () { document.addEventListener('click', this.handleDocumentClick, false); @@ -56,11 +56,11 @@ class DropdownMenu extends React.PureComponent { setRef = c => { this.node = c; - } + }; setFocusRef = c => { this.focusedItem = c; - } + }; handleKeyDown = e => { const items = Array.from(this.node.querySelectorAll('a, button')); @@ -97,18 +97,18 @@ class DropdownMenu extends React.PureComponent { e.preventDefault(); e.stopPropagation(); } - } + }; handleItemKeyPress = e => { if (e.key === 'Enter' || e.key === ' ') { this.handleClick(e); } - } + }; handleClick = e => { const { onItemClick } = this.props; onItemClick(e); - } + }; renderItem = (option, i) => { if (option === null) { @@ -124,7 +124,7 @@ class DropdownMenu extends React.PureComponent { ); - } + }; render () { const { items, scrollable, renderHeader, loading } = this.props; @@ -194,7 +194,7 @@ export default class Dropdown extends React.PureComponent { } else { this.props.onOpen(this.state.id, this.handleItemClick, type !== 'click'); } - } + }; handleClose = () => { if (this.activeElement) { @@ -202,13 +202,13 @@ export default class Dropdown extends React.PureComponent { this.activeElement = null; } this.props.onClose(this.state.id); - } + }; handleMouseDown = () => { if (!this.state.open) { this.activeElement = document.activeElement; } - } + }; handleButtonKeyDown = (e) => { switch(e.key) { @@ -217,7 +217,7 @@ export default class Dropdown extends React.PureComponent { this.handleMouseDown(); break; } - } + }; handleKeyPress = (e) => { switch(e.key) { @@ -228,7 +228,7 @@ export default class Dropdown extends React.PureComponent { e.preventDefault(); break; } - } + }; handleItemClick = e => { const { onItemClick } = this.props; @@ -247,25 +247,25 @@ export default class Dropdown extends React.PureComponent { e.preventDefault(); this.context.router.history.push(item.to); } - } + }; setTargetRef = c => { this.target = c; - } + }; findTarget = () => { return this.target; - } + }; componentWillUnmount = () => { if (this.state.id === this.props.openDropdownId) { this.handleClose(); } - } + }; close = () => { this.handleClose(); - } + }; render () { const { diff --git a/app/javascript/flavours/glitch/components/edited_timestamp/index.js b/app/javascript/flavours/glitch/components/edited_timestamp/index.js index 9648133af..c973bda58 100644 --- a/app/javascript/flavours/glitch/components/edited_timestamp/index.js +++ b/app/javascript/flavours/glitch/components/edited_timestamp/index.js @@ -36,7 +36,7 @@ class EditedTimestamp extends React.PureComponent { return ( ); - } + }; renderItem = (item, index, { onClick, onKeyPress }) => { const formattedDate = ; @@ -53,7 +53,7 @@ class EditedTimestamp extends React.PureComponent { ); - } + }; render () { const { timestamp, intl, statusId } = this.props; diff --git a/app/javascript/flavours/glitch/components/error_boundary.js b/app/javascript/flavours/glitch/components/error_boundary.js index e0ca3e2b0..8518dfc86 100644 --- a/app/javascript/flavours/glitch/components/error_boundary.js +++ b/app/javascript/flavours/glitch/components/error_boundary.js @@ -18,7 +18,7 @@ export default class ErrorBoundary extends React.PureComponent { stackTrace: undefined, mappedStackTrace: undefined, componentStack: undefined, - } + }; componentDidCatch(error, info) { this.setState({ diff --git a/app/javascript/flavours/glitch/components/gifv.js b/app/javascript/flavours/glitch/components/gifv.js index b775e5200..1f0f99b46 100644 --- a/app/javascript/flavours/glitch/components/gifv.js +++ b/app/javascript/flavours/glitch/components/gifv.js @@ -17,7 +17,7 @@ export default class GIFV extends React.PureComponent { handleLoadedData = () => { this.setState({ loading: false }); - } + }; componentWillReceiveProps (nextProps) { if (nextProps.src !== this.props.src) { @@ -32,7 +32,7 @@ export default class GIFV extends React.PureComponent { e.stopPropagation(); onClick(); } - } + }; render () { const { src, width, height, alt } = this.props; diff --git a/app/javascript/flavours/glitch/components/icon_button.js b/app/javascript/flavours/glitch/components/icon_button.js index 2485f0f48..10d7926be 100644 --- a/app/javascript/flavours/glitch/components/icon_button.js +++ b/app/javascript/flavours/glitch/components/icon_button.js @@ -46,7 +46,7 @@ export default class IconButton extends React.PureComponent { state = { activate: false, deactivate: false, - } + }; componentWillReceiveProps (nextProps) { if (!nextProps.animate) return; @@ -64,25 +64,25 @@ export default class IconButton extends React.PureComponent { if (!this.props.disabled) { this.props.onClick(e); } - } + }; handleKeyPress = (e) => { if (this.props.onKeyPress && !this.props.disabled) { this.props.onKeyPress(e); } - } + }; handleMouseDown = (e) => { if (!this.props.disabled && this.props.onMouseDown) { this.props.onMouseDown(e); } - } + }; handleKeyDown = (e) => { if (!this.props.disabled && this.props.onKeyDown) { this.props.onKeyDown(e); } - } + }; render () { // Hack required for some icons which have an overriden size diff --git a/app/javascript/flavours/glitch/components/intersection_observer_article.js b/app/javascript/flavours/glitch/components/intersection_observer_article.js index b28e44e4c..77cd66358 100644 --- a/app/javascript/flavours/glitch/components/intersection_observer_article.js +++ b/app/javascript/flavours/glitch/components/intersection_observer_article.js @@ -21,7 +21,7 @@ export default class IntersectionObserverArticle extends React.Component { state = { isHidden: false, // set to true in requestIdleCallback to trigger un-render - } + }; shouldComponentUpdate (nextProps, nextState) { const isUnrendered = !this.state.isIntersecting && (this.state.isHidden || this.props.cachedHeight); @@ -63,7 +63,7 @@ export default class IntersectionObserverArticle extends React.Component { scheduleIdleTask(this.calculateHeight); this.setState(this.updateStateAfterIntersection); - } + }; updateStateAfterIntersection = (prevState) => { if (prevState.isIntersecting !== false && !this.entry.isIntersecting) { @@ -73,7 +73,7 @@ export default class IntersectionObserverArticle extends React.Component { isIntersecting: this.entry.isIntersecting, isHidden: false, }; - } + }; calculateHeight = () => { const { onHeightChange, saveHeightKey, id } = this.props; @@ -84,7 +84,7 @@ export default class IntersectionObserverArticle extends React.Component { if (onHeightChange && saveHeightKey) { onHeightChange(saveHeightKey, id, this.height); } - } + }; hideIfNotIntersecting = () => { if (!this.componentMounted) { @@ -96,11 +96,11 @@ export default class IntersectionObserverArticle extends React.Component { // this is to save DOM nodes and avoid using up too much memory. // See: https://github.com/mastodon/mastodon/issues/2900 this.setState((prevState) => ({ isHidden: !prevState.isIntersecting })); - } + }; handleRef = (node) => { this.node = node; - } + }; render () { const { children, id, index, listLength, cachedHeight } = this.props; @@ -121,8 +121,9 @@ export default class IntersectionObserverArticle extends React.Component { aria-setsize={listLength} data-id={id} tabIndex='0' - style={style}> - {children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })} + style={style} + > + {children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })} ); } diff --git a/app/javascript/flavours/glitch/components/load_gap.js b/app/javascript/flavours/glitch/components/load_gap.js index fe3f60a58..6ed9a38c6 100644 --- a/app/javascript/flavours/glitch/components/load_gap.js +++ b/app/javascript/flavours/glitch/components/load_gap.js @@ -19,7 +19,7 @@ class LoadGap extends React.PureComponent { handleClick = () => { this.props.onClick(this.props.maxId); - } + }; render () { const { disabled, intl } = this.props; diff --git a/app/javascript/flavours/glitch/components/load_more.js b/app/javascript/flavours/glitch/components/load_more.js index 389c3e1e1..ab9428e35 100644 --- a/app/javascript/flavours/glitch/components/load_more.js +++ b/app/javascript/flavours/glitch/components/load_more.js @@ -8,11 +8,11 @@ export default class LoadMore extends React.PureComponent { onClick: PropTypes.func, disabled: PropTypes.bool, visible: PropTypes.bool, - } + }; static defaultProps = { visible: true, - } + }; render() { const { disabled, visible } = this.props; diff --git a/app/javascript/flavours/glitch/components/load_pending.js b/app/javascript/flavours/glitch/components/load_pending.js index 7e2702403..a75259146 100644 --- a/app/javascript/flavours/glitch/components/load_pending.js +++ b/app/javascript/flavours/glitch/components/load_pending.js @@ -7,7 +7,7 @@ export default class LoadPending extends React.PureComponent { static propTypes = { onClick: PropTypes.func, count: PropTypes.number, - } + }; render() { const { count } = this.props; diff --git a/app/javascript/flavours/glitch/components/media_attachments.js b/app/javascript/flavours/glitch/components/media_attachments.js index a517fcf30..33f01bb5a 100644 --- a/app/javascript/flavours/glitch/components/media_attachments.js +++ b/app/javascript/flavours/glitch/components/media_attachments.js @@ -30,7 +30,7 @@ export default class MediaAttachments extends ImmutablePureComponent { return (
); - } + }; renderLoadingVideoPlayer = () => { const { height, width } = this.props; @@ -38,7 +38,7 @@ export default class MediaAttachments extends ImmutablePureComponent { return (
); - } + }; renderLoadingAudioPlayer = () => { const { height, width } = this.props; @@ -46,7 +46,7 @@ export default class MediaAttachments extends ImmutablePureComponent { return (
); - } + }; render () { const { status, width, height, revealed } = this.props; diff --git a/app/javascript/flavours/glitch/components/media_gallery.js b/app/javascript/flavours/glitch/components/media_gallery.js index 23e279589..c11ac46c2 100644 --- a/app/javascript/flavours/glitch/components/media_gallery.js +++ b/app/javascript/flavours/glitch/components/media_gallery.js @@ -60,14 +60,14 @@ class Item extends React.PureComponent { if (this.hoverToPlay()) { e.target.play(); } - } + }; handleMouseLeave = (e) => { if (this.hoverToPlay()) { e.target.pause(); e.target.currentTime = 0; } - } + }; getAutoPlay() { return this.props.autoplay || autoPlayGif; @@ -91,11 +91,11 @@ class Item extends React.PureComponent { } e.stopPropagation(); - } + }; handleImageLoad = () => { this.setState({ loaded: true }); - } + }; render () { const { attachment, index, size, standalone, letterbox, displayWidth, visible } = this.props; @@ -307,11 +307,11 @@ class MediaGallery extends React.PureComponent { } else { this.setState({ visible: !this.state.visible }); } - } + }; handleClick = (index) => { this.props.onOpenMedia(this.props.media, index); - } + }; handleRef = (node) => { this.node = node; @@ -319,11 +319,11 @@ class MediaGallery extends React.PureComponent { if (this.node) { this._setDimensions(); } - } + }; _setDimensions () { const width = this.node.offsetWidth; - + if (width && width != this.state.width) { // offsetWidth triggers a layout, so only calculate when we need to if (this.props.cacheWidth) { @@ -360,7 +360,7 @@ class MediaGallery extends React.PureComponent { } else if (width) { style.height = width / (16/9); } else { - return (
); + return (
); } if (this.isStandaloneEligible()) { diff --git a/app/javascript/flavours/glitch/components/modal_root.js b/app/javascript/flavours/glitch/components/modal_root.js index 056277447..5a5563e87 100644 --- a/app/javascript/flavours/glitch/components/modal_root.js +++ b/app/javascript/flavours/glitch/components/modal_root.js @@ -5,6 +5,7 @@ import { createBrowserHistory } from 'history'; import { multiply } from 'color-blend'; export default class ModalRoot extends React.PureComponent { + static contextTypes = { router: PropTypes.object, }; @@ -28,7 +29,7 @@ export default class ModalRoot extends React.PureComponent { && !!this.props.children && !this.props.noEsc) { this.props.onClose(); } - } + }; handleKeyDown = (e) => { if (e.key === 'Tab') { @@ -49,7 +50,7 @@ export default class ModalRoot extends React.PureComponent { e.preventDefault(); } } - } + }; componentDidMount () { window.addEventListener('keyup', this.handleKeyUp, false); @@ -125,11 +126,11 @@ export default class ModalRoot extends React.PureComponent { getSiblings = () => { return Array(...this.node.parentElement.childNodes).filter(node => node !== this.node); - } + }; setRef = ref => { this.node = ref; - } + }; render () { const { children, onClose } = this.props; diff --git a/app/javascript/flavours/glitch/components/permalink.js b/app/javascript/flavours/glitch/components/permalink.js index 718b02115..b09b17eeb 100644 --- a/app/javascript/flavours/glitch/components/permalink.js +++ b/app/javascript/flavours/glitch/components/permalink.js @@ -24,12 +24,12 @@ export default class Permalink extends React.PureComponent { if (this.context.router) { e.preventDefault(); - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(this.props.to, state); } } - } + }; render () { const { diff --git a/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.js b/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.js index 01dce0a38..8bfdf343c 100644 --- a/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.js +++ b/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.js @@ -22,7 +22,7 @@ class PictureInPicturePlaceholder extends React.PureComponent { handleClick = () => { const { dispatch } = this.props; dispatch(removePictureInPicture()); - } + }; setRef = c => { this.node = c; @@ -30,7 +30,7 @@ class PictureInPicturePlaceholder extends React.PureComponent { if (this.node) { this._setDimensions(); } - } + }; _setDimensions () { const width = this.node.offsetWidth; diff --git a/app/javascript/flavours/glitch/components/poll.js b/app/javascript/flavours/glitch/components/poll.js index da65cd241..53ece560e 100644 --- a/app/javascript/flavours/glitch/components/poll.js +++ b/app/javascript/flavours/glitch/components/poll.js @@ -95,7 +95,7 @@ class Poll extends ImmutablePureComponent { tmp[value] = true; this.setState({ selected: tmp }); } - } + }; handleOptionChange = ({ target: { value } }) => { this._toggleOption(value); @@ -107,7 +107,7 @@ class Poll extends ImmutablePureComponent { e.stopPropagation(); e.preventDefault(); } - } + }; handleVote = () => { if (this.props.disabled) { diff --git a/app/javascript/flavours/glitch/components/scrollable_list.js b/app/javascript/flavours/glitch/components/scrollable_list.js index 8eb2b66d4..ae1ba3037 100644 --- a/app/javascript/flavours/glitch/components/scrollable_list.js +++ b/app/javascript/flavours/glitch/components/scrollable_list.js @@ -137,7 +137,7 @@ class ScrollableList extends PureComponent { } this.mouseMovedRecently = false; this.scrollToTopOnMouseIdle = false; - } + }; componentDidMount () { this.attachScrollListener(); @@ -154,29 +154,29 @@ class ScrollableList extends PureComponent { } else { return null; } - } + }; getScrollTop = () => { return this.props.bindToDocument ? document.scrollingElement.scrollTop : this.node.scrollTop; - } + }; getScrollHeight = () => { return this.props.bindToDocument ? document.scrollingElement.scrollHeight : this.node.scrollHeight; - } + }; getClientHeight = () => { return this.props.bindToDocument ? document.scrollingElement.clientHeight : this.node.clientHeight; - } + }; updateScrollBottom = (snapshot) => { const newScrollTop = this.getScrollHeight() - snapshot; this.setScrollTop(newScrollTop); - } + }; cacheMediaWidth = (width) => { if (width && this.state.cachedMediaWidth != width) this.setState({ cachedMediaWidth: width }); - } + }; getSnapshotBeforeUpdate (prevProps, prevState) { const someItemInserted = React.Children.count(prevProps.children) > 0 && @@ -208,7 +208,7 @@ class ScrollableList extends PureComponent { onFullScreenChange = () => { this.setState({ fullscreen: isFullscreen() }); - } + }; attachIntersectionObserver () { this.intersectionObserverWrapper.connect({ @@ -256,12 +256,12 @@ class ScrollableList extends PureComponent { setRef = (c) => { this.node = c; - } + }; handleLoadMore = e => { e.preventDefault(); this.props.onLoadMore(); - } + }; handleLoadPending = e => { e.preventDefault(); @@ -273,7 +273,7 @@ class ScrollableList extends PureComponent { this.clearMouseIdleTimer(); this.mouseIdleTimer = setTimeout(this.handleMouseIdle, MOUSE_IDLE_DELAY); this.mouseMovedRecently = true; - } + }; render () { const { children, scrollKey, trackScroll, showLoading, isLoading, hasMore, numPending, prepend, alwaysPrepend, append, emptyMessage, onLoadMore } = this.props; diff --git a/app/javascript/flavours/glitch/components/setting_text.js b/app/javascript/flavours/glitch/components/setting_text.js index 2c1b70bc3..3a21a0601 100644 --- a/app/javascript/flavours/glitch/components/setting_text.js +++ b/app/javascript/flavours/glitch/components/setting_text.js @@ -13,7 +13,7 @@ export default class SettingText extends React.PureComponent { handleChange = (e) => { this.props.onChange(this.props.settingPath, e.target.value); - } + }; render () { const { settings, settingPath, label } = this.props; diff --git a/app/javascript/flavours/glitch/components/spoilers.js b/app/javascript/flavours/glitch/components/spoilers.js index 8527403c1..75e4ec3a1 100644 --- a/app/javascript/flavours/glitch/components/spoilers.js +++ b/app/javascript/flavours/glitch/components/spoilers.js @@ -4,6 +4,7 @@ import { FormattedMessage } from 'react-intl'; export default class Spoilers extends React.PureComponent { + static propTypes = { spoilerText: PropTypes.string, children: PropTypes.node, @@ -11,27 +12,27 @@ class Spoilers extends React.PureComponent { state = { hidden: true, - } + }; handleSpoilerClick = () => { this.setState({ hidden: !this.state.hidden }); - } + }; render () { const { spoilerText, children } = this.props; const { hidden } = this.state; - const toggleText = hidden ? - : - ; + const toggleText = hidden ? + () : + (); return ([

@@ -43,8 +44,9 @@ class Spoilers extends React.PureComponent {

,
{children} -
+
, ]); } + } diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index cbd8eb31c..34880efe4 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -54,7 +54,7 @@ export const defaultMediaVisibility = (status, settings) => { } return (displayMedia !== 'hide_all' && !status.get('sensitive') || displayMedia === 'show_all'); -} +}; export default @injectIntl class Status extends ImmutablePureComponent { @@ -117,7 +117,7 @@ class Status extends ImmutablePureComponent { revealBehindCW: undefined, showCard: false, forceFilter: undefined, - } + }; // Avoid checking props that are functions (and whose equality will always // evaluate to false. See react-immutable-pure-component for usage. @@ -132,14 +132,14 @@ class Status extends ImmutablePureComponent { 'expanded', 'unread', 'pictureInPicture', - ] + ]; updateOnStates = [ 'isExpanded', 'isCollapsed', 'showMedia', 'forceFilter', - ] + ]; // If our settings have changed to disable collapsed statuses, then we // need to make sure that we uncollapse every one. We do that by watching @@ -302,7 +302,9 @@ class Status extends ImmutablePureComponent { if (this.node && this.props.getScrollPosition) { const position = this.props.getScrollPosition(); if (position !== null && this.node.offsetTop < position.top) { - requestAnimationFrame(() => { this.props.updateScrollBottom(position.height - position.top); }); + requestAnimationFrame(() => { + this.props.updateScrollBottom(position.height - position.top); + }); } } } @@ -321,7 +323,7 @@ class Status extends ImmutablePureComponent { } else { this.setState({ isCollapsed: false }); } - } + }; setExpansion = (value) => { if (this.props.settings.getIn(['content_warnings', 'shared_state']) && this.props.status.get('hidden') === value) { @@ -332,7 +334,7 @@ class Status extends ImmutablePureComponent { if (value) { this.setCollapsed(false); } - } + }; // `parseClick()` takes a click event and responds appropriately. // If our status is collapsed, then clicking on it should uncollapse it. @@ -361,17 +363,17 @@ class Status extends ImmutablePureComponent { status.getIn(['reblog', 'id'], status.get('id')) }`; } - let state = {...router.history.location.state}; + let state = { ...router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; router.history.push(destination, state); } e.preventDefault(); } - } + }; handleToggleMediaVisibility = () => { this.setState({ showMedia: !this.state.showMedia }); - } + }; handleExpandedToggle = () => { if (this.props.settings.getIn(['content_warnings', 'shared_state'])) { @@ -384,11 +386,11 @@ class Status extends ImmutablePureComponent { handleOpenVideo = (options) => { const { status } = this.props; this.props.onOpenVideo(status.get('id'), status.getIn(['media_attachments', 0]), options); - } + }; handleOpenMedia = (media, index) => { this.props.onOpenMedia(this.props.status.get('id'), media, index); - } + }; handleHotkeyOpenMedia = e => { const { status, onOpenMedia, onOpenVideo } = this.props; @@ -403,84 +405,84 @@ class Status extends ImmutablePureComponent { onOpenMedia(statusId, status.get('media_attachments'), 0); } } - } + }; handleDeployPictureInPicture = (type, mediaProps) => { const { deployPictureInPicture, status } = this.props; deployPictureInPicture(status, type, mediaProps); - } + }; handleHotkeyReply = e => { e.preventDefault(); this.props.onReply(this.props.status, this.context.router.history); - } + }; handleHotkeyFavourite = (e) => { this.props.onFavourite(this.props.status, e); - } + }; handleHotkeyBoost = e => { this.props.onReblog(this.props.status, e); - } + }; handleHotkeyBookmark = e => { this.props.onBookmark(this.props.status, e); - } + }; handleHotkeyMention = e => { e.preventDefault(); this.props.onMention(this.props.status.get('account'), this.context.router.history); - } + }; handleHotkeyOpen = () => { - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; const status = this.props.status; this.context.router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`, state); - } + }; handleHotkeyOpenProfile = () => { - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state); - } + }; handleHotkeyMoveUp = e => { this.props.onMoveUp(this.props.containerId || this.props.id, e.target.getAttribute('data-featured')); - } + }; handleHotkeyMoveDown = e => { this.props.onMoveDown(this.props.containerId || this.props.id, e.target.getAttribute('data-featured')); - } + }; handleHotkeyCollapse = e => { if (!this.props.settings.getIn(['collapsed', 'enabled'])) return; this.setCollapsed(!this.state.isCollapsed); - } + }; handleHotkeyToggleSensitive = () => { this.handleToggleMediaVisibility(); - } + }; handleUnfilterClick = e => { this.setState({ forceFilter: false }); e.preventDefault(); - } + }; handleFilterClick = () => { this.setState({ forceFilter: true }); - } + }; handleRef = c => { this.node = c; - } + }; handleTranslate = () => { this.props.onTranslate(this.props.status); - } + }; renderLoadingMediaGallery () { return
; diff --git a/app/javascript/flavours/glitch/components/status_action_bar.js b/app/javascript/flavours/glitch/components/status_action_bar.js index baf61000a..02c5442b5 100644 --- a/app/javascript/flavours/glitch/components/status_action_bar.js +++ b/app/javascript/flavours/glitch/components/status_action_bar.js @@ -86,7 +86,7 @@ class StatusActionBar extends ImmutablePureComponent { 'showReplyCount', 'withCounters', 'withDismiss', - ] + ]; handleReplyClick = () => { const { signedIn } = this.context.identity; @@ -96,14 +96,14 @@ class StatusActionBar extends ImmutablePureComponent { } else { this.props.onInteractionModal('reply', this.props.status); } - } + }; handleShareClick = () => { navigator.share({ text: this.props.status.get('search_index'), url: this.props.status.get('url'), }); - } + }; handleFavouriteClick = (e) => { const { signedIn } = this.context.identity; @@ -113,7 +113,7 @@ class StatusActionBar extends ImmutablePureComponent { } else { this.props.onInteractionModal('favourite', this.props.status); } - } + }; handleReblogClick = e => { const { signedIn } = this.context.identity; @@ -123,78 +123,78 @@ class StatusActionBar extends ImmutablePureComponent { } else { this.props.onInteractionModal('reblog', this.props.status); } - } + }; handleBookmarkClick = (e) => { this.props.onBookmark(this.props.status, e); - } + }; handleDeleteClick = () => { this.props.onDelete(this.props.status, this.context.router.history); - } + }; handleRedraftClick = () => { this.props.onDelete(this.props.status, this.context.router.history, true); - } + }; handleEditClick = () => { this.props.onEdit(this.props.status, this.context.router.history); - } + }; handlePinClick = () => { this.props.onPin(this.props.status); - } + }; handleMentionClick = () => { this.props.onMention(this.props.status.get('account'), this.context.router.history); - } + }; handleDirectClick = () => { this.props.onDirect(this.props.status.get('account'), this.context.router.history); - } + }; handleMuteClick = () => { this.props.onMute(this.props.status.get('account')); - } + }; handleBlockClick = () => { this.props.onBlock(this.props.status); - } + }; handleOpen = () => { - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; if (state.mastodonModalKey) { this.context.router.history.replace(`/@${this.props.status.getIn(['account', 'acct'])}/${this.props.status.get('id')}`, { mastodonBackSteps: (state.mastodonBackSteps || 0) + 1 }); } else { state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/${this.props.status.get('id')}`, state); } - } + }; handleEmbed = () => { this.props.onEmbed(this.props.status); - } + }; handleReport = () => { this.props.onReport(this.props.status); - } + }; handleConversationMuteClick = () => { this.props.onMuteConversation(this.props.status); - } + }; handleCopy = () => { const url = this.props.status.get('url'); navigator.clipboard.writeText(url); - } + }; handleHideClick = () => { this.props.onFilter(); - } + }; handleFilterClick = () => { this.props.onAddFilter(this.props.status); - } + }; render () { const { status, intl, withDismiss, withCounters, showReplyCount, scrollKey } = this.props; diff --git a/app/javascript/flavours/glitch/components/status_content.js b/app/javascript/flavours/glitch/components/status_content.js index c59f42220..790a5c659 100644 --- a/app/javascript/flavours/glitch/components/status_content.js +++ b/app/javascript/flavours/glitch/components/status_content.js @@ -12,7 +12,7 @@ const textMatchesTarget = (text, origin, host) => { return (text === origin || text === host || text.startsWith(origin + '/') || text.startsWith(host + '/') || 'www.' + text === host || ('www.' + text).startsWith(host + '/')); -} +}; const isLinkMisleading = (link) => { let linkTextParts = []; @@ -168,8 +168,8 @@ class StatusContent extends React.PureComponent { link.setAttribute('title', link.href); link.classList.add('unhandled-link'); - link.setAttribute('target', '_blank'); - link.setAttribute('rel', 'noopener nofollow noreferrer'); + link.setAttribute('target', '_blank'); + link.setAttribute('rel', 'noopener nofollow noreferrer'); try { if (tagLinks && isLinkMisleading(link)) { @@ -210,7 +210,7 @@ class StatusContent extends React.PureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-original'); } - } + }; handleMouseLeave = ({ currentTarget }) => { if (autoPlayGif) { @@ -223,7 +223,7 @@ class StatusContent extends React.PureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-static'); } - } + }; componentDidMount () { this._updateStatusLinks(); @@ -238,13 +238,13 @@ class StatusContent extends React.PureComponent { if (this.props.collapsed) { if (this.props.parseClick) this.props.parseClick(e); } - } + }; onMentionClick = (mention, e) => { if (this.props.parseClick) { this.props.parseClick(e, `/@${mention.get('acct')}`); } - } + }; onHashtagClick = (hashtag, e) => { hashtag = hashtag.replace(/^#/, ''); @@ -252,11 +252,11 @@ class StatusContent extends React.PureComponent { if (this.props.parseClick) { this.props.parseClick(e, `/tags/${hashtag}`); } - } + }; handleMouseDown = (e) => { this.startXY = [e.clientX, e.clientY]; - } + }; handleMouseUp = (e) => { const { parseClick, disabled } = this.props; @@ -281,7 +281,7 @@ class StatusContent extends React.PureComponent { } this.startXY = null; - } + }; handleSpoilerClick = (e) => { e.preventDefault(); @@ -291,15 +291,15 @@ class StatusContent extends React.PureComponent { } else { this.setState({ hidden: !this.state.hidden }); } - } + }; handleTranslate = () => { this.props.onTranslate(); - } + }; setContentsRef = (c) => { this.contentsNode = c; - } + }; render () { const { diff --git a/app/javascript/flavours/glitch/components/status_header.js b/app/javascript/flavours/glitch/components/status_header.js index 990dea536..21d8b4212 100644 --- a/app/javascript/flavours/glitch/components/status_header.js +++ b/app/javascript/flavours/glitch/components/status_header.js @@ -21,12 +21,12 @@ export default class StatusHeader extends React.PureComponent { handleClick = (acct, e) => { const { parseClick } = this.props; parseClick(e, `/@${acct}`); - } + }; handleAccountClick = (e) => { const { status } = this.props; this.handleClick(status.getIn(['account', 'acct']), e); - } + }; // Rendering. render () { diff --git a/app/javascript/flavours/glitch/components/status_icons.js b/app/javascript/flavours/glitch/components/status_icons.js index 71ffb2e56..c4cb42741 100644 --- a/app/javascript/flavours/glitch/components/status_icons.js +++ b/app/javascript/flavours/glitch/components/status_icons.js @@ -60,22 +60,22 @@ class StatusIcons extends React.PureComponent { setCollapsed(!collapsed); e.preventDefault(); } - } + }; mediaIconTitleText (mediaIcon) { const { intl } = this.props; switch (mediaIcon) { - case 'link': - return intl.formatMessage(messages.previewCard); - case 'picture-o': - return intl.formatMessage(messages.pictures); - case 'tasks': - return intl.formatMessage(messages.poll); - case 'video-camera': - return intl.formatMessage(messages.video); - case 'music': - return intl.formatMessage(messages.audio); + case 'link': + return intl.formatMessage(messages.previewCard); + case 'picture-o': + return intl.formatMessage(messages.pictures); + case 'tasks': + return intl.formatMessage(messages.poll); + case 'video-camera': + return intl.formatMessage(messages.video); + case 'music': + return intl.formatMessage(messages.audio); } } diff --git a/app/javascript/flavours/glitch/components/status_list.js b/app/javascript/flavours/glitch/components/status_list.js index 0d843a27d..a9c06f693 100644 --- a/app/javascript/flavours/glitch/components/status_list.js +++ b/app/javascript/flavours/glitch/components/status_list.js @@ -35,7 +35,7 @@ export default class StatusList extends ImmutablePureComponent { getFeaturedStatusCount = () => { return this.props.featuredStatusIds ? this.props.featuredStatusIds.size : 0; - } + }; getCurrentStatusIndex = (id, featured) => { if (featured) { @@ -43,21 +43,21 @@ export default class StatusList extends ImmutablePureComponent { } else { return this.props.statusIds.indexOf(id) + this.getFeaturedStatusCount(); } - } + }; handleMoveUp = (id, featured) => { const elementIndex = this.getCurrentStatusIndex(id, featured) - 1; this._selectChild(elementIndex, true); - } + }; handleMoveDown = (id, featured) => { const elementIndex = this.getCurrentStatusIndex(id, featured) + 1; this._selectChild(elementIndex, false); - } + }; handleLoadOlder = debounce(() => { this.props.onLoadMore(this.props.statusIds.size > 0 ? this.props.statusIds.last() : undefined); - }, 300, { leading: true }) + }, 300, { leading: true }); _selectChild (index, align_top) { const container = this.node.node; @@ -75,7 +75,7 @@ export default class StatusList extends ImmutablePureComponent { setRef = c => { this.node = c; - } + }; render () { const { statusIds, featuredStatusIds, onLoadMore, timelineId, ...other } = this.props; diff --git a/app/javascript/flavours/glitch/components/status_prepend.js b/app/javascript/flavours/glitch/components/status_prepend.js index f82533062..8c4343b04 100644 --- a/app/javascript/flavours/glitch/components/status_prepend.js +++ b/app/javascript/flavours/glitch/components/status_prepend.js @@ -18,7 +18,7 @@ export default class StatusPrepend extends React.PureComponent { handleClick = (e) => { const { account, parseClick } = this.props; parseClick(e, `/@${account.get('acct')}`); - } + }; Message = () => { const { type, account } = this.props; @@ -98,7 +98,7 @@ export default class StatusPrepend extends React.PureComponent { ); } return null; - } + }; render () { const { Message } = this; @@ -126,7 +126,7 @@ export default class StatusPrepend extends React.PureComponent { case 'update': iconId = 'pencil'; break; - }; + } return !type ? null : (
diff --git a/app/javascript/flavours/glitch/features/account/components/header.js b/app/javascript/flavours/glitch/features/account/components/header.js index 963ce7bf3..c11a472e7 100644 --- a/app/javascript/flavours/glitch/features/account/components/header.js +++ b/app/javascript/flavours/glitch/features/account/components/header.js @@ -109,7 +109,7 @@ class Header extends ImmutablePureComponent { openEditProfile = () => { window.open(profileLink, '_blank'); - } + }; handleMouseEnter = ({ currentTarget }) => { if (autoPlayGif) { @@ -122,7 +122,7 @@ class Header extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-original'); } - } + }; handleMouseLeave = ({ currentTarget }) => { if (autoPlayGif) { @@ -135,14 +135,14 @@ class Header extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-static'); } - } + }; handleAvatarClick = e => { if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); this.props.onOpenAvatar(); } - } + }; handleShare = () => { const { account } = this.props; @@ -153,7 +153,7 @@ class Header extends ImmutablePureComponent { }).catch((e) => { if (e.name !== 'AbortError') console.error(e); }); - } + }; render () { const { account, hidden, intl, domain } = this.props; @@ -177,8 +177,7 @@ class Header extends ImmutablePureComponent { if (me !== account.get('id') && account.getIn(['relationship', 'followed_by'])) { info.push(); - } - else if (me !== account.get('id') && account.getIn(['relationship', 'blocking'])) { + } else if (me !== account.get('id') && account.getIn(['relationship', 'blocking'])) { info.push(); } @@ -378,7 +377,7 @@ class Header extends ImmutablePureComponent { {fields.map((pair, i) => (
- +
{pair.get('verified_at') && }
diff --git a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.js b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.js index f20ee685e..d169875b0 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.js +++ b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.js @@ -22,20 +22,20 @@ export default class MediaItem extends ImmutablePureComponent { handleImageLoad = () => { this.setState({ loaded: true }); - } + }; handleMouseEnter = e => { if (this.hoverToPlay()) { e.target.play(); } - } + }; handleMouseLeave = e => { if (this.hoverToPlay()) { e.target.pause(); e.target.currentTime = 0; } - } + }; hoverToPlay () { return !autoPlayGif && ['gifv', 'video'].indexOf(this.props.attachment.get('type')) !== -1; @@ -51,7 +51,7 @@ export default class MediaItem extends ImmutablePureComponent { this.setState({ visible: true }); } } - } + }; render () { const { attachment, displayWidth } = this.props; diff --git a/app/javascript/flavours/glitch/features/account_gallery/index.js b/app/javascript/flavours/glitch/features/account_gallery/index.js index 638224bc0..afd6e5161 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/index.js +++ b/app/javascript/flavours/glitch/features/account_gallery/index.js @@ -45,7 +45,7 @@ class LoadMoreMedia extends ImmutablePureComponent { handleLoadMore = () => { this.props.onLoadMore(this.props.maxId); - } + }; render () { return ( @@ -109,13 +109,13 @@ class AccountGallery extends ImmutablePureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; handleScrollToBottom = () => { if (this.props.hasMore) { this.handleLoadMore(this.props.attachments.size > 0 ? this.props.attachments.last().getIn(['status', 'id']) : undefined); } - } + }; handleScroll = e => { const { scrollTop, scrollHeight, clientHeight } = e.target; @@ -124,7 +124,7 @@ class AccountGallery extends ImmutablePureComponent { if (150 > offset && !this.props.isLoading) { this.handleScrollToBottom(); } - } + }; handleLoadMore = maxId => { this.props.dispatch(expandAccountMediaTimeline(this.props.accountId, { maxId })); @@ -133,11 +133,11 @@ class AccountGallery extends ImmutablePureComponent { handleLoadOlder = e => { e.preventDefault(); this.handleScrollToBottom(); - } + }; setColumnRef = c => { this.column = c; - } + }; handleOpenMedia = attachment => { const { dispatch } = this.props; @@ -153,13 +153,13 @@ class AccountGallery extends ImmutablePureComponent { dispatch(openModal('MEDIA', { media, index, statusId })); } - } + }; handleRef = c => { if (c) { this.setState({ width: c.offsetWidth }); } - } + }; render () { const { attachments, isLoading, hasMore, isAccount, multiColumn, suspended } = this.props; diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/header.js b/app/javascript/flavours/glitch/features/account_timeline/components/header.js index 90c4c9d51..eec065b43 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/header.js +++ b/app/javascript/flavours/glitch/features/account_timeline/components/header.js @@ -37,35 +37,35 @@ export default class Header extends ImmutablePureComponent { handleFollow = () => { this.props.onFollow(this.props.account); - } + }; handleBlock = () => { this.props.onBlock(this.props.account); - } + }; handleMention = () => { this.props.onMention(this.props.account, this.context.router.history); - } + }; handleDirect = () => { this.props.onDirect(this.props.account, this.context.router.history); - } + }; handleReport = () => { this.props.onReport(this.props.account); - } + }; handleReblogToggle = () => { this.props.onReblogToggle(this.props.account); - } + }; handleNotifyToggle = () => { this.props.onNotifyToggle(this.props.account); - } + }; handleMute = () => { this.props.onMute(this.props.account); - } + }; handleBlockDomain = () => { const domain = this.props.account.get('acct').split('@')[1]; @@ -73,7 +73,7 @@ export default class Header extends ImmutablePureComponent { if (!domain) return; this.props.onBlockDomain(domain); - } + }; handleUnblockDomain = () => { const domain = this.props.account.get('acct').split('@')[1]; @@ -81,31 +81,31 @@ export default class Header extends ImmutablePureComponent { if (!domain) return; this.props.onUnblockDomain(domain); - } + }; handleEndorseToggle = () => { this.props.onEndorseToggle(this.props.account); - } + }; handleAddToList = () => { this.props.onAddToList(this.props.account); - } + }; handleEditAccountNote = () => { this.props.onEditAccountNote(this.props.account); - } + }; handleChangeLanguages = () => { this.props.onChangeLanguages(this.props.account); - } + }; handleInteractionModal = () => { this.props.onInteractionModal(this.props.account); - } + }; handleOpenAvatar = () => { this.props.onOpenAvatar(this.props.account); - } + }; render () { const { account, hidden, hideTabs } = this.props; diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.js b/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.js index ca0e60672..dc2b3e3e6 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.js +++ b/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.js @@ -20,7 +20,7 @@ class LimitedAccountHint extends React.PureComponent { static propTypes = { accountId: PropTypes.string.isRequired, reveal: PropTypes.func, - } + }; render () { const { reveal } = this.props; diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.js b/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.js index 308407e94..40bdc4034 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.js +++ b/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.js @@ -21,13 +21,13 @@ export default class MovedNote extends ImmutablePureComponent { handleAccountClick = e => { if (e.button === 0) { e.preventDefault(); - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.to.get('acct')}`, state); } e.stopPropagation(); - } + }; render () { const { from, to } = this.props; diff --git a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js index 25bcd0119..3ec47cf2f 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js +++ b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js @@ -12,7 +12,7 @@ import { } from 'flavours/glitch/actions/accounts'; import { mentionCompose, - directCompose + directCompose, } from 'flavours/glitch/actions/compose'; import { initMuteModal } from 'flavours/glitch/actions/mutes'; import { initBlockModal } from 'flavours/glitch/actions/blocks'; diff --git a/app/javascript/flavours/glitch/features/account_timeline/index.js b/app/javascript/flavours/glitch/features/account_timeline/index.js index b79082f00..9151c1990 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/index.js +++ b/app/javascript/flavours/glitch/features/account_timeline/index.js @@ -140,15 +140,15 @@ class AccountTimeline extends ImmutablePureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; handleLoadMore = maxId => { this.props.dispatch(expandAccountTimeline(this.props.accountId, { maxId, withReplies: this.props.withReplies, tagged: this.props.params.tagged })); - } + }; setRef = c => { this.column = c; - } + }; render () { const { accountId, statusIds, featuredStatusIds, isLoading, hasMore, suspended, isAccount, hidden, multiColumn, remote, remoteUrl } = this.props; diff --git a/app/javascript/flavours/glitch/features/audio/index.js b/app/javascript/flavours/glitch/features/audio/index.js index 3a0d49100..1a1d438c0 100644 --- a/app/javascript/flavours/glitch/features/audio/index.js +++ b/app/javascript/flavours/glitch/features/audio/index.js @@ -75,7 +75,7 @@ class Audio extends React.PureComponent { if (this.player) { this._setDimensions(); } - } + }; _pack() { return { @@ -107,11 +107,11 @@ class Audio extends React.PureComponent { setSeekRef = c => { this.seek = c; - } + }; setVolumeRef = c => { this.volume = c; - } + }; setAudioRef = c => { this.audio = c; @@ -120,14 +120,14 @@ class Audio extends React.PureComponent { this.audio.volume = 1; this.audio.muted = false; } - } + }; setCanvasRef = c => { this.canvas = c; this.visualizer.setCanvas(c); - } - + }; + componentDidMount () { window.addEventListener('scroll', this.handleScroll); window.addEventListener('resize', this.handleResize, { passive: true }); @@ -169,7 +169,7 @@ class Audio extends React.PureComponent { } else { this.setState({ paused: true }, () => this.audio.pause()); } - } + }; handleResize = debounce(() => { if (this.player) { @@ -187,7 +187,7 @@ class Audio extends React.PureComponent { } this._renderCanvas(); - } + }; handlePause = () => { this.setState({ paused: true }); @@ -195,7 +195,7 @@ class Audio extends React.PureComponent { if (this.audioContext) { this.audioContext.suspend(); } - } + }; handleProgress = () => { const lastTimeRange = this.audio.buffered.length - 1; @@ -203,7 +203,7 @@ class Audio extends React.PureComponent { if (lastTimeRange > -1) { this.setState({ buffer: Math.ceil(this.audio.buffered.end(lastTimeRange) / this.audio.duration * 100) }); } - } + }; toggleMute = () => { const muted = !this.state.muted; @@ -213,7 +213,7 @@ class Audio extends React.PureComponent { this.gainNode.gain.value = muted ? 0 : this.state.volume; } }); - } + }; toggleReveal = () => { if (this.props.onToggleVisibility) { @@ -221,7 +221,7 @@ class Audio extends React.PureComponent { } else { this.setState({ revealed: !this.state.revealed }); } - } + }; handleVolumeMouseDown = e => { document.addEventListener('mousemove', this.handleMouseVolSlide, true); @@ -233,14 +233,14 @@ class Audio extends React.PureComponent { e.preventDefault(); e.stopPropagation(); - } + }; handleVolumeMouseUp = () => { document.removeEventListener('mousemove', this.handleMouseVolSlide, true); document.removeEventListener('mouseup', this.handleVolumeMouseUp, true); document.removeEventListener('touchmove', this.handleMouseVolSlide, true); document.removeEventListener('touchend', this.handleVolumeMouseUp, true); - } + }; handleMouseDown = e => { document.addEventListener('mousemove', this.handleMouseMove, true); @@ -254,7 +254,7 @@ class Audio extends React.PureComponent { e.preventDefault(); e.stopPropagation(); - } + }; handleMouseUp = () => { document.removeEventListener('mousemove', this.handleMouseMove, true); @@ -264,7 +264,7 @@ class Audio extends React.PureComponent { this.setState({ dragging: false }); this.audio.play(); - } + }; handleMouseMove = throttle(e => { const { x } = getPointerPosition(this.seek, e); @@ -282,7 +282,7 @@ class Audio extends React.PureComponent { currentTime: this.audio.currentTime, duration: this.audio.duration, }); - } + }; handleMouseVolSlide = throttle(e => { const { x } = getPointerPosition(this.volume, e); @@ -317,11 +317,11 @@ class Audio extends React.PureComponent { handleMouseEnter = () => { this.setState({ hovered: true }); - } + }; handleMouseLeave = () => { this.setState({ hovered: false }); - } + }; handleLoadedData = () => { const { autoPlay, currentTime } = this.props; @@ -333,7 +333,7 @@ class Audio extends React.PureComponent { if (autoPlay) { this.togglePlay(); } - } + }; _initAudioContext () { const AudioContext = window.AudioContext || window.webkitAudioContext; @@ -367,7 +367,7 @@ class Audio extends React.PureComponent { }).catch(err => { console.error(err); }); - } + }; _renderCanvas () { requestAnimationFrame(() => { @@ -438,7 +438,7 @@ class Audio extends React.PureComponent { e.stopPropagation(); this.togglePlay(); } - } + }; handleKeyDown = e => { switch(e.key) { @@ -463,7 +463,7 @@ class Audio extends React.PureComponent { this.seekBy(10); break; } - } + }; render () { const { src, intl, alt, editable, autoPlay, sensitive, blurhash } = this.props; diff --git a/app/javascript/flavours/glitch/features/bookmarked_statuses/index.js b/app/javascript/flavours/glitch/features/bookmarked_statuses/index.js index 8978ac5fc..8e25bc6fd 100644 --- a/app/javascript/flavours/glitch/features/bookmarked_statuses/index.js +++ b/app/javascript/flavours/glitch/features/bookmarked_statuses/index.js @@ -48,24 +48,24 @@ class Bookmarks extends ImmutablePureComponent { } else { dispatch(addColumn('BOOKMARKS', {})); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; handleLoadMore = debounce(() => { this.props.dispatch(expandBookmarkedStatuses()); - }, 300, { leading: true }) + }, 300, { leading: true }); render () { const { intl, statusIds, columnId, multiColumn, hasMore, isLoading } = this.props; diff --git a/app/javascript/flavours/glitch/features/closed_registrations_modal/index.js b/app/javascript/flavours/glitch/features/closed_registrations_modal/index.js index cb91636cb..bdaa9885c 100644 --- a/app/javascript/flavours/glitch/features/closed_registrations_modal/index.js +++ b/app/javascript/flavours/glitch/features/closed_registrations_modal/index.js @@ -72,4 +72,4 @@ class ClosedRegistrationsModal extends ImmutablePureComponent { ); } -}; +} diff --git a/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js index b892f08ad..eac1c4bba 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js @@ -12,7 +12,7 @@ const mapStateToProps = (state, { columnId }) => { settings: (uuid && index >= 0) ? columns.get(index).get('params') : state.getIn(['settings', 'community']), }; }; - + const mapDispatchToProps = (dispatch, { columnId }) => { return { onChange (key, checked) { diff --git a/app/javascript/flavours/glitch/features/community_timeline/index.js b/app/javascript/flavours/glitch/features/community_timeline/index.js index 67bf54875..b9a59fdc7 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/index.js +++ b/app/javascript/flavours/glitch/features/community_timeline/index.js @@ -63,16 +63,16 @@ class CommunityTimeline extends React.PureComponent { } else { dispatch(addColumn('COMMUNITY', { other: { onlyMedia } })); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; componentDidMount () { const { dispatch, onlyMedia } = this.props; @@ -112,13 +112,13 @@ class CommunityTimeline extends React.PureComponent { setRef = c => { this.column = c; - } + }; handleLoadMore = maxId => { const { dispatch, onlyMedia } = this.props; dispatch(expandCommunityTimeline({ maxId, onlyMedia })); - } + }; render () { const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/action_bar.js b/app/javascript/flavours/glitch/features/compose/components/action_bar.js index 838ef09ea..1843fdacb 100644 --- a/app/javascript/flavours/glitch/features/compose/components/action_bar.js +++ b/app/javascript/flavours/glitch/features/compose/components/action_bar.js @@ -32,7 +32,7 @@ class ActionBar extends React.PureComponent { handleLogout = () => { this.props.onLogout(); - } + }; render () { const { intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index 2b57cf15d..c5655c4f2 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -22,9 +22,9 @@ import { length } from 'stringz'; const messages = defineMessages({ placeholder: { id: 'compose_form.placeholder', defaultMessage: 'What is on your mind?' }, missingDescriptionMessage: { id: 'confirmations.missing_media_description.message', - defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.' }, + defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.' }, missingDescriptionConfirm: { id: 'confirmations.missing_media_description.confirm', - defaultMessage: 'Send anyway' }, + defaultMessage: 'Send anyway' }, spoiler_placeholder: { id: 'compose_form.spoiler_placeholder', defaultMessage: 'Write your warning here' }, }); @@ -83,22 +83,22 @@ class ComposeForm extends ImmutablePureComponent { handleChange = (e) => { this.props.onChange(e.target.value); - } + }; getFulltextForCharacterCounting = () => { return [ this.props.spoiler? this.props.spoilerText: '', countableText(this.props.text), - this.props.advancedOptions && this.props.advancedOptions.get('do_not_federate') ? ' 👁️' : '' + this.props.advancedOptions && this.props.advancedOptions.get('do_not_federate') ? ' 👁️' : '', ].join(''); - } + }; canSubmit = () => { const { isSubmitting, isChangingUpload, isUploading, anyMedia } = this.props; const fulltext = this.getFulltextForCharacterCounting(); return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxChars || (!fulltext.trim().length && !anyMedia)); - } + }; handleSubmit = (overriddenVisibility = null) => { const { @@ -129,7 +129,7 @@ class ComposeForm extends ImmutablePureComponent { } onSubmit(this.context.router ? this.context.router.history : null); } - } + }; // Changes the text value of the spoiler. handleChangeSpoiler = ({ target: { value } }) => { @@ -137,7 +137,7 @@ class ComposeForm extends ImmutablePureComponent { if (onChangeSpoilerText) { onChangeSpoilerText(value); } - } + }; setRef = c => { this.composeForm = c; @@ -150,7 +150,7 @@ class ComposeForm extends ImmutablePureComponent { if (onPickEmoji) { onPickEmoji(selectionStart, data); } - } + }; // Handles the secondary submit button. handleSecondarySubmit = () => { @@ -158,16 +158,16 @@ class ComposeForm extends ImmutablePureComponent { sideArm, } = this.props; this.handleSubmit(sideArm === 'none' ? null : sideArm); - } + }; // Selects a suggestion from the autofill. onSuggestionSelected = (tokenStart, token, value) => { this.props.onSuggestionSelected(tokenStart, token, value, ['text']); - } + }; onSpoilerSuggestionSelected = (tokenStart, token, value) => { this.props.onSuggestionSelected(tokenStart, token, value, ['spoiler_text']); - } + }; handleKeyDown = (e) => { if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) { @@ -177,21 +177,21 @@ class ComposeForm extends ImmutablePureComponent { if (e.keyCode == 13 && e.altKey) { this.handleSecondarySubmit(); } - } + }; // Sets a reference to the textarea. setAutosuggestTextarea = (textareaComponent) => { if (textareaComponent) { this.textarea = textareaComponent.textarea; } - } + }; // Sets a reference to the CW field. handleRefSpoilerText = (spoilerComponent) => { if (spoilerComponent) { this.spoilerText = spoilerComponent.input; } - } + }; handleFocus = () => { if (this.composeForm && !this.props.singleColumn) { @@ -200,7 +200,7 @@ class ComposeForm extends ImmutablePureComponent { this.composeForm.scrollIntoView(); } } - } + }; componentDidMount () { this._updateFocusAndSelection({ }); @@ -217,7 +217,7 @@ class ComposeForm extends ImmutablePureComponent { // - Replying to more than one user, selects any usernames past // the first; this provides a convenient shortcut to drop // everyone else from the conversation. - _updateFocusAndSelection = (prevProps) => { + _updateFocusAndSelection = (prevProps) => { const { textarea, spoilerText, @@ -271,7 +271,7 @@ class ComposeForm extends ImmutablePureComponent { } } } - } + }; render () { diff --git a/app/javascript/flavours/glitch/features/compose/components/dropdown.js b/app/javascript/flavours/glitch/features/compose/components/dropdown.js index d98b311d9..fe4ab36f5 100644 --- a/app/javascript/flavours/glitch/features/compose/components/dropdown.js +++ b/app/javascript/flavours/glitch/features/compose/components/dropdown.js @@ -64,7 +64,7 @@ export default class ComposerOptionsDropdown extends React.PureComponent { } this.setState({ open: !this.state.open, openedViaKeyboard: type !== 'click' }); } - } + }; handleKeyDown = (e) => { switch (e.key) { @@ -72,13 +72,13 @@ export default class ComposerOptionsDropdown extends React.PureComponent { this.handleClose(); break; } - } + }; handleMouseDown = () => { if (!this.state.open) { this.activeElement = document.activeElement; } - } + }; handleButtonKeyDown = (e) => { switch(e.key) { @@ -87,7 +87,7 @@ export default class ComposerOptionsDropdown extends React.PureComponent { this.handleMouseDown(); break; } - } + }; handleKeyPress = (e) => { switch(e.key) { @@ -98,14 +98,14 @@ export default class ComposerOptionsDropdown extends React.PureComponent { e.preventDefault(); break; } - } + }; handleClose = () => { if (this.state.open && this.activeElement) { this.activeElement.focus({ preventScroll: true }); } this.setState({ open: false }); - } + }; handleItemClick = (e) => { const { @@ -151,22 +151,22 @@ export default class ComposerOptionsDropdown extends React.PureComponent { ...rest, active: value && name === value, name, - }) + }), ), }; - } + }; setTargetRef = c => { this.target = c; - } + }; findTarget = () => { return this.target; - } + }; handleOverlayEnter = (state) => { this.setState({ placement: state.placement }); - } + }; // Rendering. render () { diff --git a/app/javascript/flavours/glitch/features/compose/components/dropdown_menu.js b/app/javascript/flavours/glitch/features/compose/components/dropdown_menu.js index c4895dfd0..1ea0df536 100644 --- a/app/javascript/flavours/glitch/features/compose/components/dropdown_menu.js +++ b/app/javascript/flavours/glitch/features/compose/components/dropdown_menu.js @@ -44,12 +44,12 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent if (this.node && !this.node.contains(e.target)) { this.props.onClose(); } - } + }; // Stores our node in `this.node`. setRef = (node) => { this.node = node; - } + }; // On mounting, we add our listeners. componentDidMount () { @@ -84,7 +84,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent onClose(); } onChange(name); - } + }; // Handle changes differently whether the dropdown is a list of options or actions handleChange = (name) => { @@ -93,7 +93,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent } else { this.setState({ value: name }); } - } + }; handleKeyDown = (e) => { const index = Number(e.currentTarget.getAttribute('data-index')); @@ -135,11 +135,11 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent e.preventDefault(); e.stopPropagation(); } - } + }; setFocusRef = c => { this.focusedItem = c; - } + }; renderItem = (item, i) => { const { name, icon, meta, text } = item; @@ -177,7 +177,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent {contents}
); - } + }; // Rendering. render () { diff --git a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js index 38c735551..66355e088 100644 --- a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js +++ b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js @@ -58,7 +58,7 @@ class ModifierPickerMenu extends React.PureComponent { handleClick = e => { this.props.onSelect(e.currentTarget.getAttribute('data-index') * 1); - } + }; componentWillReceiveProps (nextProps) { if (nextProps.active) { @@ -76,7 +76,7 @@ class ModifierPickerMenu extends React.PureComponent { if (this.node && !this.node.contains(e.target)) { this.props.onClose(); } - } + }; attachListeners () { document.addEventListener('click', this.handleDocumentClick, false); @@ -90,7 +90,7 @@ class ModifierPickerMenu extends React.PureComponent { setRef = c => { this.node = c; - } + }; render () { const { active } = this.props; @@ -125,12 +125,12 @@ class ModifierPicker extends React.PureComponent { } else { this.props.onOpen(); } - } + }; handleSelect = modifier => { this.props.onChange(modifier); this.props.onClose(); - } + }; render () { const { active, modifier } = this.props; @@ -175,7 +175,7 @@ class EmojiPickerMenu extends React.PureComponent { if (this.node && !this.node.contains(e.target)) { this.props.onClose(); } - } + }; componentDidMount () { document.addEventListener('click', this.handleDocumentClick, false); @@ -199,7 +199,7 @@ class EmojiPickerMenu extends React.PureComponent { setRef = c => { this.node = c; - } + }; getI18n = () => { const { intl } = this.props; @@ -220,7 +220,7 @@ class EmojiPickerMenu extends React.PureComponent { custom: intl.formatMessage(messages.custom), }, }; - } + }; handleClick = (emoji, event) => { if (!emoji.native) { @@ -230,19 +230,19 @@ class EmojiPickerMenu extends React.PureComponent { this.props.onClose(); } this.props.onPick(emoji); - } + }; handleModifierOpen = () => { this.setState({ modifierOpen: true }); - } + }; handleModifierClose = () => { this.setState({ modifierOpen: false }); - } + }; handleModifierChange = modifier => { this.props.onSkinTone(modifier); - } + }; render () { const { loading, style, intl, custom_emojis, skinTone, frequentlyUsedEmojis } = this.props; @@ -327,7 +327,7 @@ class EmojiPickerDropdown extends React.PureComponent { setRef = (c) => { this.dropdown = c; - } + }; onShowDropdown = () => { this.setState({ active: true }); @@ -344,11 +344,11 @@ class EmojiPickerDropdown extends React.PureComponent { this.setState({ loading: false, active: false }); }); } - } + }; onHideDropdown = () => { this.setState({ active: false }); - } + }; onToggle = (e) => { if (!this.state.loading && (!e.key || e.key === 'Enter')) { @@ -358,21 +358,21 @@ class EmojiPickerDropdown extends React.PureComponent { this.onShowDropdown(e); } } - } + }; handleKeyDown = e => { if (e.key === 'Escape') { this.onHideDropdown(); } - } + }; setTargetRef = c => { this.target = c; - } + }; findTarget = () => { return this.target; - } + }; render () { const { intl, onPickEmoji, onSkinTone, skinTone, frequentlyUsedEmojis, button } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/header.js b/app/javascript/flavours/glitch/features/compose/components/header.js index 7ecb573ab..dcbdafa57 100644 --- a/app/javascript/flavours/glitch/features/compose/components/header.js +++ b/app/javascript/flavours/glitch/features/compose/components/header.js @@ -47,6 +47,7 @@ const messages = defineMessages({ export default @injectIntl class Header extends ImmutablePureComponent { + static propTypes = { columns: ImmutablePropTypes.list, unreadNotifications: PropTypes.number, @@ -63,7 +64,7 @@ class Header extends ImmutablePureComponent { this.props.onLogout(); return false; - } + }; render () { const { intl, columns, unreadNotifications, showNotificationsBadge, onSettingsClick } = this.props; @@ -71,8 +72,8 @@ class Header extends ImmutablePureComponent { // Only renders the component if the column isn't being shown. const renderForColumn = conditionalRender.bind(null, columnId => !columns || !columns.some( - column => column.get('id') === columnId - ) + column => column.get('id') === columnId, + ), ); // The result. @@ -125,10 +126,11 @@ class Header extends ImmutablePureComponent { ); - }; + } + } diff --git a/app/javascript/flavours/glitch/features/compose/components/language_dropdown.js b/app/javascript/flavours/glitch/features/compose/components/language_dropdown.js index 3a1fa0226..3f8411ab1 100644 --- a/app/javascript/flavours/glitch/features/compose/components/language_dropdown.js +++ b/app/javascript/flavours/glitch/features/compose/components/language_dropdown.js @@ -40,7 +40,7 @@ class LanguageDropdownMenu extends React.PureComponent { if (this.node && !this.node.contains(e.target)) { this.props.onClose(); } - } + }; componentDidMount () { document.addEventListener('click', this.handleDocumentClick, false); @@ -63,15 +63,15 @@ class LanguageDropdownMenu extends React.PureComponent { setRef = c => { this.node = c; - } + }; setListRef = c => { this.listNode = c; - } + }; handleSearchChange = ({ target }) => { this.setState({ searchValue: target.value }); - } + }; search () { const { languages, value, frequentlyUsedLanguages } = this.props; @@ -122,7 +122,7 @@ class LanguageDropdownMenu extends React.PureComponent { this.props.onClose(); this.props.onChange(value); - } + }; handleKeyDown = e => { const { onClose } = this.props; @@ -163,7 +163,7 @@ class LanguageDropdownMenu extends React.PureComponent { e.preventDefault(); e.stopPropagation(); } - } + }; handleSearchKeyDown = e => { const { onChange, onClose } = this.props; @@ -199,11 +199,11 @@ class LanguageDropdownMenu extends React.PureComponent { break; } - } + }; handleClear = () => { this.setState({ searchValue: '' }); - } + }; renderItem = lang => { const { value } = this.props; @@ -213,7 +213,7 @@ class LanguageDropdownMenu extends React.PureComponent { {lang[2]} ({lang[1]})
); - } + }; render () { const { intl } = this.props; @@ -259,7 +259,7 @@ class LanguageDropdown extends React.PureComponent { } this.setState({ open: !this.state.open }); - } + }; handleClose = () => { const { value, onClose } = this.props; @@ -270,24 +270,24 @@ class LanguageDropdown extends React.PureComponent { this.setState({ open: false }); onClose(value); - } + }; handleChange = value => { const { onChange } = this.props; onChange(value); - } + }; setTargetRef = c => { this.target = c; - } + }; findTarget = () => { return this.target; - } + }; handleOverlayEnter = (state) => { this.setState({ placement: state.placement }); - } + }; render () { const { value, intl, frequentlyUsedLanguages } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/options.js b/app/javascript/flavours/glitch/features/compose/components/options.js index b5276c371..e09e13bcb 100644 --- a/app/javascript/flavours/glitch/features/compose/components/options.js +++ b/app/javascript/flavours/glitch/features/compose/components/options.js @@ -144,7 +144,7 @@ class ComposerOptions extends ImmutablePureComponent { if (files.length && onUpload) { onUpload(files); } - } + }; // Handles attachment clicks. handleClickAttach = (name) => { @@ -164,12 +164,12 @@ class ComposerOptions extends ImmutablePureComponent { } return; } - } + }; // Handles a ref to the file input. handleRefFileElement = (fileElement) => { this.fileElement = fileElement; - } + }; renderToggleItemContents = (item) => { const { onChangeAdvancedOption } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/poll_form.js b/app/javascript/flavours/glitch/features/compose/components/poll_form.js index 2ab3c64ac..13b7322d3 100644 --- a/app/javascript/flavours/glitch/features/compose/components/poll_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/poll_form.js @@ -49,15 +49,15 @@ class Option extends React.PureComponent { onSuggestionsClearRequested = () => { this.props.onClearSuggestions(); - } + }; onSuggestionsFetchRequested = (token) => { this.props.onFetchSuggestions(token); - } + }; onSuggestionSelected = (tokenStart, token, value) => { this.props.onSuggestionSelected(tokenStart, token, value, ['poll', 'options', this.props.index]); - } + }; render () { const { isPollMultiple, title, lang, index, autoFocus, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/publisher.js b/app/javascript/flavours/glitch/features/compose/components/publisher.js index 9d53b7ee3..59254990b 100644 --- a/app/javascript/flavours/glitch/features/compose/components/publisher.js +++ b/app/javascript/flavours/glitch/features/compose/components/publisher.js @@ -94,5 +94,6 @@ class Publisher extends ImmutablePureComponent {
); - }; + } + } diff --git a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.js b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.js index 7ad9e2b64..ca167d114 100644 --- a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.js +++ b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.js @@ -33,7 +33,7 @@ class ReplyIndicator extends ImmutablePureComponent { if (onCancel) { onCancel(); } - } + }; // Rendering. render () { diff --git a/app/javascript/flavours/glitch/features/compose/components/search.js b/app/javascript/flavours/glitch/features/compose/components/search.js index e5874de75..6241e2a0a 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search.js +++ b/app/javascript/flavours/glitch/features/compose/components/search.js @@ -71,14 +71,14 @@ class Search extends React.PureComponent { setRef = c => { this.searchForm = c; - } + }; handleChange = (e) => { const { onChange } = this.props; if (onChange) { onChange(e.target.value); } - } + }; handleClear = (e) => { const { @@ -90,11 +90,11 @@ class Search extends React.PureComponent { if (onClear && (submitted || value && value.length)) { onClear(); } - } + }; handleBlur = () => { this.setState({ expanded: false }); - } + }; handleFocus = () => { this.setState({ expanded: true }); @@ -106,7 +106,7 @@ class Search extends React.PureComponent { this.searchForm.scrollIntoView(); } } - } + }; handleKeyUp = (e) => { const { onSubmit } = this.props; @@ -121,11 +121,11 @@ class Search extends React.PureComponent { case 'Escape': focusRoot(); } - } + }; findTarget = () => { return this.searchForm; - } + }; render () { const { intl, value, submitted } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/search_results.js b/app/javascript/flavours/glitch/features/compose/components/search_results.js index c2178702c..23ff60936 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search_results.js +++ b/app/javascript/flavours/glitch/features/compose/components/search_results.js @@ -103,7 +103,7 @@ class SearchResults extends ImmutablePureComponent {
- {results.get('statuses').map(statusId => )} + {results.get('statuses').map(statusId => )} {results.get('statuses').size >= 5 && }
@@ -136,5 +136,6 @@ class SearchResults extends ImmutablePureComponent { {hashtags} ); - }; + } + } diff --git a/app/javascript/flavours/glitch/features/compose/components/textarea_icons.js b/app/javascript/flavours/glitch/features/compose/components/textarea_icons.js index 25c2443b1..d8ee5c81b 100644 --- a/app/javascript/flavours/glitch/features/compose/components/textarea_icons.js +++ b/app/javascript/flavours/glitch/features/compose/components/textarea_icons.js @@ -51,9 +51,10 @@ class TextareaIcons extends ImmutablePureComponent { id={icon} /> - ) : null + ) : null, ) : null} ); } + } diff --git a/app/javascript/flavours/glitch/features/compose/components/upload.js b/app/javascript/flavours/glitch/features/compose/components/upload.js index cd4524540..c82b8d55a 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload.js +++ b/app/javascript/flavours/glitch/features/compose/components/upload.js @@ -23,12 +23,12 @@ export default class Upload extends ImmutablePureComponent { handleUndoClick = e => { e.stopPropagation(); this.props.onUndo(this.props.media.get('id')); - } + }; handleFocalPointClick = e => { e.stopPropagation(); this.props.onOpenFocalPoint(this.props.media.get('id')); - } + }; render () { const { media } = this.props; @@ -39,7 +39,7 @@ export default class Upload extends ImmutablePureComponent { return (
- + {({ scale }) => (
diff --git a/app/javascript/flavours/glitch/features/compose/components/upload_form.js b/app/javascript/flavours/glitch/features/compose/components/upload_form.js index 7ebbac963..f2e7fe7a2 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/upload_form.js @@ -6,6 +6,7 @@ import UploadContainer from '../containers/upload_container'; import SensitiveButtonContainer from '../containers/sensitive_button_container'; export default class UploadForm extends ImmutablePureComponent { + static propTypes = { mediaIds: ImmutablePropTypes.list.isRequired, }; diff --git a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js index 8f2947672..56eaaf920 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js @@ -22,11 +22,11 @@ import { privacyPreference } from 'flavours/glitch/utils/privacy_preference'; const messages = defineMessages({ missingDescriptionMessage: { id: 'confirmations.missing_media_description.message', - defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.' }, + defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.' }, missingDescriptionConfirm: { id: 'confirmations.missing_media_description.confirm', - defaultMessage: 'Send anyway' }, + defaultMessage: 'Send anyway' }, missingDescriptionEdit: { id: 'confirmations.missing_media_description.edit', - defaultMessage: 'Edit media' }, + defaultMessage: 'Edit media' }, }); // State mapping. @@ -38,12 +38,12 @@ function mapStateToProps (state) { const sideArmRestrictedPrivacy = replyPrivacy ? privacyPreference(replyPrivacy, sideArmBasePrivacy) : null; let sideArmPrivacy = null; switch (state.getIn(['local_settings', 'side_arm_reply_mode'])) { - case 'copy': - sideArmPrivacy = replyPrivacy; - break; - case 'restrict': - sideArmPrivacy = sideArmRestrictedPrivacy; - break; + case 'copy': + sideArmPrivacy = replyPrivacy; + break; + case 'restrict': + sideArmPrivacy = sideArmRestrictedPrivacy; + break; } sideArmPrivacy = sideArmPrivacy || sideArmBasePrivacy; return { @@ -72,7 +72,7 @@ function mapStateToProps (state) { isInReply: state.getIn(['compose', 'in_reply_to']) !== null, lang: state.getIn(['compose', 'language']), }; -}; +} // Dispatch mapping. const mapDispatchToProps = (dispatch, { intl }) => ({ @@ -124,7 +124,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ onConfirm: () => { if (overriddenVisibility) { dispatch(changeComposeVisibility(overriddenVisibility)); - }; + } dispatch(submitCompose(routerHistory)); }, secondary: intl.formatMessage(messages.missingDescriptionEdit), diff --git a/app/javascript/flavours/glitch/features/compose/containers/options_container.js b/app/javascript/flavours/glitch/features/compose/containers/options_container.js index 5de9f5419..19a90ac8b 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/options_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/options_container.js @@ -23,7 +23,7 @@ function mapStateToProps (state) { showContentTypeChoice: state.getIn(['local_settings', 'show_content_type_choice']), contentType: state.getIn(['compose', 'content_type']), }; -}; +} const mapDispatchToProps = (dispatch) => ({ diff --git a/app/javascript/flavours/glitch/features/compose/containers/warning_container.js b/app/javascript/flavours/glitch/features/compose/containers/warning_container.js index b2ed40b82..9402601f8 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/warning_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/warning_container.js @@ -8,7 +8,7 @@ import { profileLink, termsLink } from 'flavours/glitch/utils/backend_links'; const buildHashtagRE = () => { try { - const HASHTAG_SEPARATORS = "_\\u00b7\\u200c"; + const HASHTAG_SEPARATORS = '_\\u00b7\\u200c'; const ALPHA = '\\p{L}\\p{M}'; const WORD = '\\p{L}\\p{M}\\p{N}\\p{Pc}'; return new RegExp( @@ -22,7 +22,7 @@ const buildHashtagRE = () => { '[' + WORD + '_]*' + '[' + ALPHA + ']' + '[' + WORD + '_]*' + - '))', 'iu' + '))', 'iu', ); } catch { return /(?:^|[^\/\)\w])#(\w*[a-zA-Z·]\w*)/i; diff --git a/app/javascript/flavours/glitch/features/compose/index.js b/app/javascript/flavours/glitch/features/compose/index.js index 8ca378672..68eb05e2c 100644 --- a/app/javascript/flavours/glitch/features/compose/index.js +++ b/app/javascript/flavours/glitch/features/compose/index.js @@ -43,6 +43,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ export default @connect(mapStateToProps, mapDispatchToProps) @injectIntl class Compose extends React.PureComponent { + static propTypes = { multiColumn: PropTypes.bool, showSearch: PropTypes.bool, diff --git a/app/javascript/flavours/glitch/features/compose/util/counter.js b/app/javascript/flavours/glitch/features/compose/util/counter.js index 7aa9e87b1..5a68bad99 100644 --- a/app/javascript/flavours/glitch/features/compose/util/counter.js +++ b/app/javascript/flavours/glitch/features/compose/util/counter.js @@ -6,4 +6,4 @@ export function countableText(inputText) { return inputText .replace(urlRegex, urlPlaceholder) .replace(/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '$1@$3'); -}; +} diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js index 00d9fdcd0..ad2a68ebd 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js +++ b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js @@ -60,12 +60,12 @@ class Conversation extends ImmutablePureComponent { } destination = `/statuses/${lastStatus.get('id')}`; } - let state = {...router.history.location.state}; + let state = { ...router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; router.history.push(destination, state); e.preventDefault(); } - } + }; handleMouseEnter = ({ currentTarget }) => { if (autoPlayGif) { @@ -78,7 +78,7 @@ class Conversation extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-original'); } - } + }; handleMouseLeave = ({ currentTarget }) => { if (autoPlayGif) { @@ -91,7 +91,7 @@ class Conversation extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-static'); } - } + }; handleClick = () => { if (!this.context.router) { @@ -105,31 +105,31 @@ class Conversation extends ImmutablePureComponent { } this.context.router.history.push(`/@${lastStatus.getIn(['account', 'acct'])}/${lastStatus.get('id')}`); - } + }; handleMarkAsRead = () => { this.props.markRead(); - } + }; handleReply = () => { this.props.reply(this.props.lastStatus, this.context.router.history); - } + }; handleDelete = () => { this.props.delete(); - } + }; handleHotkeyMoveUp = () => { this.props.onMoveUp(this.props.conversationId); - } + }; handleHotkeyMoveDown = () => { this.props.onMoveDown(this.props.conversationId); - } + }; handleConversationMute = () => { this.props.onMute(this.props.lastStatus); - } + }; handleShowMore = () => { this.props.onToggleHidden(this.props.lastStatus); @@ -141,7 +141,7 @@ class Conversation extends ImmutablePureComponent { setExpansion = value => { this.setState({ isExpanded: value }); - } + }; render () { const { accounts, lastStatus, unread, scrollKey, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.js b/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.js index c2aff1b57..ae72179e2 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.js +++ b/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.js @@ -16,17 +16,17 @@ export default class ConversationsList extends ImmutablePureComponent { onLoadMore: PropTypes.func, }; - getCurrentIndex = id => this.props.conversations.findIndex(x => x.get('id') === id) + getCurrentIndex = id => this.props.conversations.findIndex(x => x.get('id') === id); handleMoveUp = id => { const elementIndex = this.getCurrentIndex(id) - 1; this._selectChild(elementIndex, true); - } + }; handleMoveDown = id => { const elementIndex = this.getCurrentIndex(id) + 1; this._selectChild(elementIndex, false); - } + }; _selectChild (index, align_top) { const container = this.node.node; @@ -44,7 +44,7 @@ export default class ConversationsList extends ImmutablePureComponent { setRef = c => { this.node = c; - } + }; handleLoadOlder = debounce(() => { const last = this.props.conversations.last(); @@ -52,7 +52,7 @@ export default class ConversationsList extends ImmutablePureComponent { if (last && last.get('last_status')) { this.props.onLoadMore(last.get('last_status')); } - }, 300, { leading: true }) + }, 300, { leading: true }); render () { const { conversations, onLoadMore, ...other } = this.props; diff --git a/app/javascript/flavours/glitch/features/direct_timeline/index.js b/app/javascript/flavours/glitch/features/direct_timeline/index.js index d55c63c2b..afd348988 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/index.js +++ b/app/javascript/flavours/glitch/features/direct_timeline/index.js @@ -43,16 +43,16 @@ class DirectTimeline extends React.PureComponent { } else { dispatch(addColumn('DIRECT', {})); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; componentDidMount () { const { dispatch, conversationsMode } = this.props; @@ -89,15 +89,15 @@ class DirectTimeline extends React.PureComponent { setRef = c => { this.column = c; - } + }; handleLoadMoreTimeline = maxId => { this.props.dispatch(expandDirectTimeline({ maxId })); - } + }; handleLoadMoreConversations = maxId => { this.props.dispatch(expandConversations({ maxId })); - } + }; render () { const { intl, hasUnread, columnId, multiColumn, conversationsMode } = this.props; diff --git a/app/javascript/flavours/glitch/features/directory/components/account_card.js b/app/javascript/flavours/glitch/features/directory/components/account_card.js index ccc3dd3d2..3fddb5b81 100644 --- a/app/javascript/flavours/glitch/features/directory/components/account_card.js +++ b/app/javascript/flavours/glitch/features/directory/components/account_card.js @@ -118,7 +118,7 @@ class AccountCard extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-original'); } - } + }; handleMouseLeave = ({ currentTarget }) => { if (autoPlayGif) { @@ -131,7 +131,7 @@ class AccountCard extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-static'); } - } + }; handleFollow = () => { this.props.onFollow(this.props.account); @@ -143,11 +143,11 @@ class AccountCard extends ImmutablePureComponent { handleMute = () => { this.props.onMute(this.props.account); - } + }; handleEditProfile = () => { window.open('/settings/profile', '_blank'); - } + }; handleDismiss = (e) => { const { account, onDismiss } = this.props; @@ -155,7 +155,7 @@ class AccountCard extends ImmutablePureComponent { e.preventDefault(); e.stopPropagation(); - } + }; render() { const { account, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/directory/index.js b/app/javascript/flavours/glitch/features/directory/index.js index 94bcd578c..07875b3e1 100644 --- a/app/javascript/flavours/glitch/features/directory/index.js +++ b/app/javascript/flavours/glitch/features/directory/index.js @@ -64,7 +64,7 @@ class Directory extends React.PureComponent { } else { dispatch(addColumn('DIRECTORY', this.getParams(this.props, this.state))); } - } + }; getParams = (props, state) => ({ order: state.order === null ? (props.params.order || 'active') : state.order, @@ -74,11 +74,11 @@ class Directory extends React.PureComponent { handleMove = dir => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; componentDidMount () { const { dispatch } = this.props; @@ -97,7 +97,7 @@ class Directory extends React.PureComponent { setRef = c => { this.column = c; - } + }; handleChangeOrder = e => { const { dispatch, columnId } = this.props; @@ -107,7 +107,7 @@ class Directory extends React.PureComponent { } else { this.setState({ order: e.target.value }); } - } + }; handleChangeLocal = e => { const { dispatch, columnId } = this.props; @@ -117,12 +117,12 @@ class Directory extends React.PureComponent { } else { this.setState({ local: e.target.value === '1' }); } - } + }; handleLoadMore = () => { const { dispatch } = this.props; dispatch(expandDirectory(this.getParams(this.props, this.state))); - } + }; render () { const { isLoading, accountIds, intl, columnId, multiColumn, domain } = this.props; diff --git a/app/javascript/flavours/glitch/features/explore/index.js b/app/javascript/flavours/glitch/features/explore/index.js index da0dc7f7c..4cbc5294b 100644 --- a/app/javascript/flavours/glitch/features/explore/index.js +++ b/app/javascript/flavours/glitch/features/explore/index.js @@ -41,11 +41,11 @@ class Explore extends React.PureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; render() { const { intl, multiColumn, isSearching } = this.props; diff --git a/app/javascript/flavours/glitch/features/explore/statuses.js b/app/javascript/flavours/glitch/features/explore/statuses.js index 0a5c9de23..21768dd24 100644 --- a/app/javascript/flavours/glitch/features/explore/statuses.js +++ b/app/javascript/flavours/glitch/features/explore/statuses.js @@ -33,7 +33,7 @@ class Statuses extends React.PureComponent { handleLoadMore = debounce(() => { const { dispatch } = this.props; dispatch(expandTrendingStatuses()); - }, 300, { leading: true }) + }, 300, { leading: true }); render () { const { isLoading, hasMore, statusIds, multiColumn } = this.props; diff --git a/app/javascript/flavours/glitch/features/explore/suggestions.js b/app/javascript/flavours/glitch/features/explore/suggestions.js index 52e5ce62b..1c9b99266 100644 --- a/app/javascript/flavours/glitch/features/explore/suggestions.js +++ b/app/javascript/flavours/glitch/features/explore/suggestions.js @@ -29,7 +29,7 @@ class Suggestions extends React.PureComponent { handleDismiss = (accountId) => { const { dispatch } = this.props; dispatch(dismissSuggestion(accountId)); - } + }; render () { const { isLoading, suggestions } = this.props; diff --git a/app/javascript/flavours/glitch/features/favourited_statuses/index.js b/app/javascript/flavours/glitch/features/favourited_statuses/index.js index a03e1a4eb..0667c205b 100644 --- a/app/javascript/flavours/glitch/features/favourited_statuses/index.js +++ b/app/javascript/flavours/glitch/features/favourited_statuses/index.js @@ -48,24 +48,24 @@ class Favourites extends ImmutablePureComponent { } else { dispatch(addColumn('FAVOURITES', {})); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; handleLoadMore = debounce(() => { this.props.dispatch(expandFavouritedStatuses()); - }, 300, { leading: true }) + }, 300, { leading: true }); render () { const { intl, statusIds, columnId, multiColumn, hasMore, isLoading } = this.props; diff --git a/app/javascript/flavours/glitch/features/favourites/index.js b/app/javascript/flavours/glitch/features/favourites/index.js index 47c3279c4..ba58ed43b 100644 --- a/app/javascript/flavours/glitch/features/favourites/index.js +++ b/app/javascript/flavours/glitch/features/favourites/index.js @@ -48,15 +48,15 @@ class Favourites extends ImmutablePureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; handleRefresh = () => { this.props.dispatch(fetchFavourites(this.props.params.statusId)); - } + }; render () { const { intl, accountIds, multiColumn } = this.props; diff --git a/app/javascript/flavours/glitch/features/filters/select_filter.js b/app/javascript/flavours/glitch/features/filters/select_filter.js index 5391766c9..57adb59cc 100644 --- a/app/javascript/flavours/glitch/features/filters/select_filter.js +++ b/app/javascript/flavours/glitch/features/filters/select_filter.js @@ -71,7 +71,7 @@ class SelectFilter extends React.PureComponent { {filter[1]} {warning}
); - } + }; renderCreateNew (name) { return ( @@ -83,11 +83,11 @@ class SelectFilter extends React.PureComponent { handleSearchChange = ({ target }) => { this.setState({ searchValue: target.value }); - } + }; setListRef = c => { this.listNode = c; - } + }; handleKeyDown = e => { const index = Array.from(this.listNode.childNodes).findIndex(node => node === e.currentTarget); @@ -125,7 +125,7 @@ class SelectFilter extends React.PureComponent { e.preventDefault(); e.stopPropagation(); } - } + }; handleSearchKeyDown = e => { let element = null; @@ -143,11 +143,11 @@ class SelectFilter extends React.PureComponent { break; } - } + }; handleClear = () => { this.setState({ searchValue: '' }); - } + }; handleItemClick = e => { const value = e.currentTarget.getAttribute('data-index'); @@ -155,7 +155,7 @@ class SelectFilter extends React.PureComponent { e.preventDefault(); this.props.onSelectFilter(value); - } + }; handleNewFilterClick = e => { e.preventDefault(); diff --git a/app/javascript/flavours/glitch/features/follow_recommendations/components/account.js b/app/javascript/flavours/glitch/features/follow_recommendations/components/account.js index 2c668da3e..7c8a71879 100644 --- a/app/javascript/flavours/glitch/features/follow_recommendations/components/account.js +++ b/app/javascript/flavours/glitch/features/follow_recommendations/components/account.js @@ -50,7 +50,7 @@ class Account extends ImmutablePureComponent { } else { dispatch(followAccount(account.get('id'))); } - } + }; render () { const { account, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/follow_recommendations/index.js b/app/javascript/flavours/glitch/features/follow_recommendations/index.js index d9d962b7c..11396d2a3 100644 --- a/app/javascript/flavours/glitch/features/follow_recommendations/index.js +++ b/app/javascript/flavours/glitch/features/follow_recommendations/index.js @@ -69,7 +69,7 @@ class FollowRecommendations extends ImmutablePureComponent { })); router.history.push('/home'); - } + }; render () { const { suggestions, isLoading } = this.props; diff --git a/app/javascript/flavours/glitch/features/followers/index.js b/app/javascript/flavours/glitch/features/followers/index.js index 7122c1905..10fd76865 100644 --- a/app/javascript/flavours/glitch/features/followers/index.js +++ b/app/javascript/flavours/glitch/features/followers/index.js @@ -107,11 +107,11 @@ class Followers extends ImmutablePureComponent { setRef = c => { this.column = c; - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; render () { const { accountId, accountIds, hasMore, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl } = this.props; diff --git a/app/javascript/flavours/glitch/features/following/index.js b/app/javascript/flavours/glitch/features/following/index.js index 4ad670105..5af4e60b6 100644 --- a/app/javascript/flavours/glitch/features/following/index.js +++ b/app/javascript/flavours/glitch/features/following/index.js @@ -107,11 +107,11 @@ class Following extends ImmutablePureComponent { setRef = c => { this.column = c; - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; render () { const { accountId, accountIds, hasMore, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl } = this.props; diff --git a/app/javascript/flavours/glitch/features/getting_started/components/announcements.js b/app/javascript/flavours/glitch/features/getting_started/components/announcements.js index 93f3c9428..5ff4f0523 100644 --- a/app/javascript/flavours/glitch/features/getting_started/components/announcements.js +++ b/app/javascript/flavours/glitch/features/getting_started/components/announcements.js @@ -35,7 +35,7 @@ class Content extends ImmutablePureComponent { setRef = c => { this.node = c; - } + }; componentDidMount () { this._updateLinks(); @@ -89,7 +89,7 @@ class Content extends ImmutablePureComponent { e.preventDefault(); this.context.router.history.push(`/@${mention.get('acct')}`); } - } + }; onHashtagClick = (hashtag, e) => { hashtag = hashtag.replace(/^#/, ''); @@ -98,14 +98,14 @@ class Content extends ImmutablePureComponent { e.preventDefault(); this.context.router.history.push(`/tags/${hashtag}`); } - } + }; onStatusClick = (status, e) => { if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); this.context.router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`); } - } + }; handleMouseEnter = ({ currentTarget }) => { if (autoPlayGif) { @@ -118,7 +118,7 @@ class Content extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-original'); } - } + }; handleMouseLeave = ({ currentTarget }) => { if (autoPlayGif) { @@ -131,7 +131,7 @@ class Content extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-static'); } - } + }; render () { const { announcement } = this.props; @@ -216,11 +216,11 @@ class Reaction extends ImmutablePureComponent { } else { addReaction(announcementId, reaction.get('name')); } - } + }; - handleMouseEnter = () => this.setState({ hovered: true }) + handleMouseEnter = () => this.setState({ hovered: true }); - handleMouseLeave = () => this.setState({ hovered: false }) + handleMouseLeave = () => this.setState({ hovered: false }); render () { const { reaction } = this.props; @@ -254,7 +254,7 @@ class ReactionsBar extends ImmutablePureComponent { handleEmojiPick = data => { const { addReaction, announcementId } = this.props; addReaction(announcementId, data.native.replace(/:/g, '')); - } + }; willEnter () { return { scale: reduceMotion ? 1 : 0 }; @@ -397,15 +397,15 @@ class Announcements extends ImmutablePureComponent { handleChangeIndex = index => { this.setState({ index: index % this.props.announcements.size }); - } + }; handleNextClick = () => { this.setState({ index: (this.state.index + 1) % this.props.announcements.size }); - } + }; handlePrevClick = () => { this.setState({ index: (this.props.announcements.size + this.state.index - 1) % this.props.announcements.size }); - } + }; render () { const { announcements, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/getting_started/index.js b/app/javascript/flavours/glitch/features/getting_started/index.js index f9d79013b..91b33c1dd 100644 --- a/app/javascript/flavours/glitch/features/getting_started/index.js +++ b/app/javascript/flavours/glitch/features/getting_started/index.js @@ -79,9 +79,9 @@ const badgeDisplay = (number, limit) => { const NAVIGATION_PANEL_BREAKPOINT = 600 + (285 * 2) + (10 * 2); - export default @connect(makeMapStateToProps, mapDispatchToProps) +export default @connect(makeMapStateToProps, mapDispatchToProps) @injectIntl - class GettingStarted extends ImmutablePureComponent { +class GettingStarted extends ImmutablePureComponent { static contextTypes = { router: PropTypes.object.isRequired, @@ -164,7 +164,7 @@ const NAVIGATION_PANEL_BREAKPOINT = 600 + (285 * 2) + (10 * 2);
{lists.filter(list => !columns.find(item => item.get('id') === 'LIST' && item.getIn(['params', 'id']) === list.get('id'))).map(list => - + , )}
, ]); diff --git a/app/javascript/flavours/glitch/features/getting_started_misc/index.js b/app/javascript/flavours/glitch/features/getting_started_misc/index.js index de354d6b1..613b43df7 100644 --- a/app/javascript/flavours/glitch/features/getting_started_misc/index.js +++ b/app/javascript/flavours/glitch/features/getting_started_misc/index.js @@ -35,11 +35,11 @@ class gettingStartedMisc extends ImmutablePureComponent { openOnboardingModal = (e) => { this.props.dispatch(openModal('ONBOARDING')); - } + }; openFeaturedAccountsModal = (e) => { this.props.dispatch(openModal('PINNED_ACCOUNTS_EDITOR')); - } + }; render () { const { intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.js b/app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.js index ede8907e5..ac7863ed3 100644 --- a/app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.js +++ b/app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.js @@ -38,7 +38,7 @@ class ColumnSettings extends React.PureComponent { } else { return tags; } - }; + } onSelect = mode => value => { const oldValue = this.tags(mode); @@ -98,7 +98,7 @@ class ColumnSettings extends React.PureComponent { default: return ''; } - }; + } render () { const { settings, onChange } = this.props; diff --git a/app/javascript/flavours/glitch/features/hashtag_timeline/index.js b/app/javascript/flavours/glitch/features/hashtag_timeline/index.js index 219dc0ec6..54a67804e 100644 --- a/app/javascript/flavours/glitch/features/hashtag_timeline/index.js +++ b/app/javascript/flavours/glitch/features/hashtag_timeline/index.js @@ -54,7 +54,7 @@ class HashtagTimeline extends React.PureComponent { } else { dispatch(addColumn('HASHTAG', { id: this.props.params.id })); } - } + }; title = () => { const { id } = this.props.params; @@ -73,7 +73,7 @@ class HashtagTimeline extends React.PureComponent { } return title; - } + }; additionalFor = (mode) => { const { tags } = this.props.params; @@ -83,16 +83,16 @@ class HashtagTimeline extends React.PureComponent { } else { return ''; } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; _subscribe (dispatch, id, tags = {}, local) { const { signedIn } = this.context.identity; @@ -157,14 +157,14 @@ class HashtagTimeline extends React.PureComponent { setRef = c => { this.column = c; - } + }; handleLoadMore = maxId => { const { dispatch, params } = this.props; const { id, tags, local } = params; dispatch(expandHashtagTimeline(id, { maxId, tags, local })); - } + }; handleFollow = () => { const { dispatch, params, tag } = this.props; @@ -180,7 +180,7 @@ class HashtagTimeline extends React.PureComponent { } else { dispatch(followHashtag(id)); } - } + }; render () { const { hasUnread, columnId, multiColumn, tag, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/home_timeline/index.js b/app/javascript/flavours/glitch/features/home_timeline/index.js index 5ed108ad2..b2bfd3f17 100644 --- a/app/javascript/flavours/glitch/features/home_timeline/index.js +++ b/app/javascript/flavours/glitch/features/home_timeline/index.js @@ -60,24 +60,24 @@ class HomeTimeline extends React.PureComponent { } else { dispatch(addColumn('HOME', {})); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; handleLoadMore = maxId => { this.props.dispatch(expandHomeTimeline({ maxId })); - } + }; componentDidMount () { setTimeout(() => this.props.dispatch(fetchAnnouncements()), 700); @@ -116,7 +116,7 @@ class HomeTimeline extends React.PureComponent { handleToggleAnnouncementsClick = (e) => { e.stopPropagation(); this.props.dispatch(toggleShowAnnouncements()); - } + }; render () { const { intl, hasUnread, columnId, multiColumn, hasAnnouncements, unreadAnnouncements, showAnnouncements } = this.props; diff --git a/app/javascript/flavours/glitch/features/interaction_modal/index.js b/app/javascript/flavours/glitch/features/interaction_modal/index.js index b71c041c9..3a54105a3 100644 --- a/app/javascript/flavours/glitch/features/interaction_modal/index.js +++ b/app/javascript/flavours/glitch/features/interaction_modal/index.js @@ -30,14 +30,14 @@ class Copypaste extends React.PureComponent { setRef = c => { this.input = c; - } + }; handleInputClick = () => { this.setState({ copied: false }); this.input.focus(); this.input.select(); this.input.setSelectionRange(0, this.input.value.length); - } + }; handleButtonClick = () => { const { value } = this.props; @@ -45,7 +45,7 @@ class Copypaste extends React.PureComponent { this.input.blur(); this.setState({ copied: true }); this.timeout = setTimeout(() => this.setState({ copied: false }), 700); - } + }; componentWillUnmount () { if (this.timeout) clearTimeout(this.timeout); @@ -86,7 +86,7 @@ class InteractionModal extends React.PureComponent { handleSignupClick = () => { this.props.onSignupClick(); - } + }; render () { const { url, type, displayNameHtml } = this.props; diff --git a/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.js b/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.js index a8cab2762..418c2a3e7 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.js +++ b/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.js @@ -33,16 +33,16 @@ class ListForm extends React.PureComponent { handleChange = e => { this.props.onChange(e.target.value); - } + }; handleSubmit = e => { e.preventDefault(); this.props.onSubmit(); - } + }; handleClick = () => { this.props.onSubmit(); - } + }; render () { const { value, disabled, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/list_editor/components/search.js b/app/javascript/flavours/glitch/features/list_editor/components/search.js index 192643f77..94782ba69 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/search.js +++ b/app/javascript/flavours/glitch/features/list_editor/components/search.js @@ -20,17 +20,17 @@ export default class Search extends React.PureComponent { handleChange = e => { this.props.onChange(e.target.value); - } + }; handleKeyUp = e => { if (e.keyCode === 13) { this.props.onSubmit(this.props.value); } - } + }; handleClear = () => { this.props.onClear(); - } + }; render () { const { value, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/list_timeline/index.js b/app/javascript/flavours/glitch/features/list_timeline/index.js index a94c05c56..3f1503548 100644 --- a/app/javascript/flavours/glitch/features/list_timeline/index.js +++ b/app/javascript/flavours/glitch/features/list_timeline/index.js @@ -58,16 +58,16 @@ class ListTimeline extends React.PureComponent { dispatch(addColumn('LIST', { id: this.props.params.id })); this.context.router.history.push('/'); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; componentDidMount () { const { dispatch } = this.props; @@ -105,16 +105,16 @@ class ListTimeline extends React.PureComponent { setRef = c => { this.column = c; - } + }; handleLoadMore = maxId => { const { id } = this.props.params; this.props.dispatch(expandListTimeline(id, { maxId })); - } + }; handleEditClick = () => { this.props.dispatch(openModal('LIST_EDITOR', { listId: this.props.params.id })); - } + }; handleDeleteClick = () => { const { dispatch, columnId, intl } = this.props; @@ -126,20 +126,20 @@ class ListTimeline extends React.PureComponent { onConfirm: () => { dispatch(deleteList(id)); - if (!!columnId) { + if (columnId) { dispatch(removeColumn(columnId)); } else { this.context.router.history.push('/lists'); } }, })); - } + }; handleRepliesPolicyChange = ({ target }) => { const { dispatch, list } = this.props; const { id } = this.props.params; this.props.dispatch(updateList(id, undefined, false, target.value)); - } + }; render () { const { hasUnread, columnId, multiColumn, list, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/lists/components/new_list_form.js b/app/javascript/flavours/glitch/features/lists/components/new_list_form.js index cc78d30b7..e78a6a3bc 100644 --- a/app/javascript/flavours/glitch/features/lists/components/new_list_form.js +++ b/app/javascript/flavours/glitch/features/lists/components/new_list_form.js @@ -34,16 +34,16 @@ class NewListForm extends React.PureComponent { handleChange = e => { this.props.onChange(e.target.value); - } + }; handleSubmit = e => { e.preventDefault(); this.props.onSubmit(); - } + }; handleClick = () => { this.props.onSubmit(); - } + }; render () { const { value, disabled, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/local_settings/navigation/index.js b/app/javascript/flavours/glitch/features/local_settings/navigation/index.js index 98dda182f..cc1f3df6d 100644 --- a/app/javascript/flavours/glitch/features/local_settings/navigation/index.js +++ b/app/javascript/flavours/glitch/features/local_settings/navigation/index.js @@ -72,7 +72,7 @@ class LocalSettingsNavigation extends React.PureComponent { /> - + - + - + - + @@ -306,7 +306,7 @@ class LocalSettingsPage extends React.PureComponent { defaultMessage='user preferences' /> - ) + ), }} /> @@ -414,7 +414,7 @@ class LocalSettingsPage extends React.PureComponent { onChange={onChange} dependsOn={[['collapsed', 'enabled']]} dependsOnNot={[['collapsed', 'auto', 'all']]} - inputProps={{type: 'number', min: '200', max: '999'}} + inputProps={{ type: 'number', min: '200', max: '999' }} > diff --git a/app/javascript/flavours/glitch/features/local_settings/page/item/index.js b/app/javascript/flavours/glitch/features/local_settings/page/item/index.js index 86da640ba..41c0676a2 100644 --- a/app/javascript/flavours/glitch/features/local_settings/page/item/index.js +++ b/app/javascript/flavours/glitch/features/local_settings/page/item/index.js @@ -31,7 +31,7 @@ export default class LocalSettingsPageItem extends React.PureComponent { if (options && options.length > 0) onChange(item, target.value); else if (placeholder) onChange(item, target.value); else onChange(item, target.checked); - } + }; render () { const { handleChange } = this; @@ -55,7 +55,7 @@ export default class LocalSettingsPageItem extends React.PureComponent { let optionId = `${id}--${opt.value}`; return (
diff --git a/app/javascript/flavours/glitch/features/notifications/components/admin_report.js b/app/javascript/flavours/glitch/features/notifications/components/admin_report.js index 4662bd953..556df8f66 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/admin_report.js +++ b/app/javascript/flavours/glitch/features/notifications/components/admin_report.js @@ -32,28 +32,28 @@ export default class AdminReport extends ImmutablePureComponent { handleMoveUp = () => { const { notification, onMoveUp } = this.props; onMoveUp(notification.get('id')); - } + }; handleMoveDown = () => { const { notification, onMoveDown } = this.props; onMoveDown(notification.get('id')); - } + }; handleOpen = () => { this.handleOpenProfile(); - } + }; handleOpenProfile = () => { const { notification } = this.props; this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); - } + }; handleMention = e => { e.preventDefault(); const { notification, onMention } = this.props; onMention(notification.get('account'), this.context.router.history); - } + }; getHandlers () { return { diff --git a/app/javascript/flavours/glitch/features/notifications/components/admin_signup.js b/app/javascript/flavours/glitch/features/notifications/components/admin_signup.js index 355ebef94..ead2a9701 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/admin_signup.js +++ b/app/javascript/flavours/glitch/features/notifications/components/admin_signup.js @@ -26,28 +26,28 @@ export default class NotificationFollow extends ImmutablePureComponent { handleMoveUp = () => { const { notification, onMoveUp } = this.props; onMoveUp(notification.get('id')); - } + }; handleMoveDown = () => { const { notification, onMoveDown } = this.props; onMoveDown(notification.get('id')); - } + }; handleOpen = () => { this.handleOpenProfile(); - } + }; handleOpenProfile = () => { const { notification } = this.props; this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); - } + }; handleMention = e => { e.preventDefault(); const { notification, onMention } = this.props; onMention(notification.get('account'), this.context.router.history); - } + }; getHandlers () { return { diff --git a/app/javascript/flavours/glitch/features/notifications/components/column_settings.js b/app/javascript/flavours/glitch/features/notifications/components/column_settings.js index 64fd98bd9..1c04218ba 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/column_settings.js +++ b/app/javascript/flavours/glitch/features/notifications/components/column_settings.js @@ -27,7 +27,7 @@ export default class ColumnSettings extends React.PureComponent { onPushChange = (path, checked) => { this.props.onChange(['push', ...path], checked); - } + }; render () { const { settings, pushSettings, onChange, onClear, alertsEnabled, browserSupport, browserPermission, onRequestNotificationPermission } = this.props; diff --git a/app/javascript/flavours/glitch/features/notifications/components/follow.js b/app/javascript/flavours/glitch/features/notifications/components/follow.js index b8fad19d0..434d6609d 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/follow.js +++ b/app/javascript/flavours/glitch/features/notifications/components/follow.js @@ -26,28 +26,28 @@ export default class NotificationFollow extends ImmutablePureComponent { handleMoveUp = () => { const { notification, onMoveUp } = this.props; onMoveUp(notification.get('id')); - } + }; handleMoveDown = () => { const { notification, onMoveDown } = this.props; onMoveDown(notification.get('id')); - } + }; handleOpen = () => { this.handleOpenProfile(); - } + }; handleOpenProfile = () => { const { notification } = this.props; this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); - } + }; handleMention = e => { e.preventDefault(); const { notification, onMention } = this.props; onMention(notification.get('account'), this.context.router.history); - } + }; getHandlers () { return { diff --git a/app/javascript/flavours/glitch/features/notifications/components/follow_request.js b/app/javascript/flavours/glitch/features/notifications/components/follow_request.js index 69b92a06f..a3fdf8a61 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/follow_request.js +++ b/app/javascript/flavours/glitch/features/notifications/components/follow_request.js @@ -32,28 +32,28 @@ class FollowRequest extends ImmutablePureComponent { handleMoveUp = () => { const { notification, onMoveUp } = this.props; onMoveUp(notification.get('id')); - } + }; handleMoveDown = () => { const { notification, onMoveDown } = this.props; onMoveDown(notification.get('id')); - } + }; handleOpen = () => { this.handleOpenProfile(); - } + }; handleOpenProfile = () => { const { notification } = this.props; this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); - } + }; handleMention = e => { e.preventDefault(); const { notification, onMention } = this.props; onMention(notification.get('account'), this.context.router.history); - } + }; getHandlers () { return { diff --git a/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js b/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js index dd163225e..7b6ab0c7d 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js +++ b/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js @@ -23,11 +23,11 @@ class NotificationsPermissionBanner extends React.PureComponent { handleClick = () => { this.props.dispatch(requestBrowserPermission()); - } + }; handleClose = () => { this.props.dispatch(changeSetting(['notifications', 'dismissPermissionBanner'], true)); - } + }; render () { const { intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/notifications/components/overlay.js b/app/javascript/flavours/glitch/features/notifications/components/overlay.js index f3ccafc06..21d3f8acf 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/overlay.js +++ b/app/javascript/flavours/glitch/features/notifications/components/overlay.js @@ -29,7 +29,7 @@ class NotificationOverlay extends ImmutablePureComponent { const mark = !this.props.notification.get('markedForDelete'); const id = this.props.notification.get('id'); this.props.onMarkForDelete(id, mark); - } + }; render () { const { notification, show, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.js b/app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.js index 223b7f75f..2f0b48ef9 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.js +++ b/app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import classNames from 'classnames' +import classNames from 'classnames'; export default class PillBarButton extends React.PureComponent { @@ -12,12 +12,12 @@ export default class PillBarButton extends React.PureComponent { label: PropTypes.node.isRequired, onChange: PropTypes.func.isRequired, disabled: PropTypes.bool, - } + }; onChange = () => { const { settings, settingPath } = this.props; this.props.onChange(settingPath, !settings.getIn(settingPath)); - } + }; render () { const { prefix, settings, settingPath, label, disabled } = this.props; diff --git a/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js b/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js index e472f7c4f..dc7b89b7f 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js +++ b/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js @@ -14,11 +14,11 @@ export default class SettingToggle extends React.PureComponent { onChange: PropTypes.func.isRequired, defaultValue: PropTypes.bool, disabled: PropTypes.bool, - } + }; onChange = ({ target }) => { this.props.onChange(this.props.settingPath, target.checked); - } + }; render () { const { prefix, settings, settingPath, label, meta, defaultValue, disabled } = this.props; diff --git a/app/javascript/flavours/glitch/features/notifications/index.js b/app/javascript/flavours/glitch/features/notifications/index.js index fc42a4de4..fff365617 100644 --- a/app/javascript/flavours/glitch/features/notifications/index.js +++ b/app/javascript/flavours/glitch/features/notifications/index.js @@ -158,30 +158,30 @@ class Notifications extends React.PureComponent { } else { dispatch(addColumn('NOTIFICATIONS', {})); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; setColumnRef = c => { this.column = c; - } + }; handleMoveUp = id => { const elementIndex = this.props.notifications.findIndex(item => item !== null && item.get('id') === id) - 1; this._selectChild(elementIndex, true); - } + }; handleMoveDown = id => { const elementIndex = this.props.notifications.findIndex(item => item !== null && item.get('id') === id) + 1; this._selectChild(elementIndex, false); - } + }; _selectChild (index, align_top) { const container = this.column.node; @@ -213,16 +213,16 @@ class Notifications extends React.PureComponent { handleTransitionEndNCD = () => { this.setState({ animatingNCD: false }); - } + }; onEnterCleaningMode = () => { this.setState({ animatingNCD: true }); this.props.onEnterCleaningMode(!this.props.notifCleaningActive); - } + }; handleMarkAsRead = () => { this.props.onMarkAsRead(); - } + }; render () { const { intl, notifications, isLoading, isUnread, columnId, multiColumn, hasMore, numPending, showFilterBar, lastReadId, canMarkAsRead, needsNotificationPermission } = this.props; diff --git a/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js b/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js index f05a763e0..bc312d530 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js +++ b/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js @@ -114,7 +114,7 @@ class Footer extends ImmutablePureComponent { _performReblog = (privacy) => { const { dispatch, status } = this.props; dispatch(reblog(status, privacy)); - } + }; handleReblogClick = e => { const { dispatch, status } = this.props; @@ -151,7 +151,7 @@ class Footer extends ImmutablePureComponent { } router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`); - } + }; render () { const { status, intl, showReplyCount, withOpenButton } = this.props; diff --git a/app/javascript/flavours/glitch/features/picture_in_picture/index.js b/app/javascript/flavours/glitch/features/picture_in_picture/index.js index 3e6a20faa..d445b6d58 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/index.js +++ b/app/javascript/flavours/glitch/features/picture_in_picture/index.js @@ -35,7 +35,7 @@ class PictureInPicture extends React.Component { handleClose = () => { const { dispatch } = this.props; dispatch(removePictureInPicture()); - } + }; render () { const { type, src, currentTime, accountId, statusId, left } = this.props; diff --git a/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js b/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js index 5a1efce0a..db586ecf7 100644 --- a/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js +++ b/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js @@ -4,7 +4,7 @@ import { injectIntl } from 'react-intl'; import { fetchPinnedAccountsSuggestions, clearPinnedAccountsSuggestions, - changePinnedAccountsSuggestions + changePinnedAccountsSuggestions, } from '../../../actions/accounts'; import Search from 'flavours/glitch/features/list_editor/components/search'; diff --git a/app/javascript/flavours/glitch/features/pinned_statuses/index.js b/app/javascript/flavours/glitch/features/pinned_statuses/index.js index eeeab46ab..b7bd46fbe 100644 --- a/app/javascript/flavours/glitch/features/pinned_statuses/index.js +++ b/app/javascript/flavours/glitch/features/pinned_statuses/index.js @@ -37,11 +37,11 @@ class PinnedStatuses extends ImmutablePureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; render () { const { intl, statusIds, hasMore, multiColumn } = this.props; diff --git a/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js index 5091bfb90..97b756658 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux'; import ColumnSettings from '../components/column_settings'; import { changeSetting } from 'flavours/glitch/actions/settings'; import { changeColumnParams } from 'flavours/glitch/actions/columns'; - + const mapStateToProps = (state, { columnId }) => { const uuid = columnId; const columns = state.getIn(['settings', 'columns']); diff --git a/app/javascript/flavours/glitch/features/public_timeline/index.js b/app/javascript/flavours/glitch/features/public_timeline/index.js index a61a47de1..810643f97 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/index.js +++ b/app/javascript/flavours/glitch/features/public_timeline/index.js @@ -68,16 +68,16 @@ class PublicTimeline extends React.PureComponent { } else { dispatch(addColumn(onlyRemote ? 'REMOTE' : 'PUBLIC', { other: { onlyMedia, onlyRemote, allowLocalOnly } })); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; componentDidMount () { const { dispatch, onlyMedia, onlyRemote, allowLocalOnly } = this.props; @@ -116,13 +116,13 @@ class PublicTimeline extends React.PureComponent { setRef = c => { this.column = c; - } + }; handleLoadMore = maxId => { const { dispatch, onlyMedia, onlyRemote, allowLocalOnly } = this.props; dispatch(expandPublicTimeline({ maxId, onlyMedia, onlyRemote, allowLocalOnly })); - } + }; render () { const { intl, columnId, hasUnread, multiColumn, onlyMedia, onlyRemote, allowLocalOnly } = this.props; diff --git a/app/javascript/flavours/glitch/features/reblogs/index.js b/app/javascript/flavours/glitch/features/reblogs/index.js index b097ff9d7..46b1ed4e5 100644 --- a/app/javascript/flavours/glitch/features/reblogs/index.js +++ b/app/javascript/flavours/glitch/features/reblogs/index.js @@ -48,15 +48,15 @@ class Reblogs extends ImmutablePureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; handleRefresh = () => { this.props.dispatch(fetchReblogs(this.props.params.statusId)); - } + }; render () { const { intl, accountIds, multiColumn } = this.props; diff --git a/app/javascript/flavours/glitch/features/report/components/option.js b/app/javascript/flavours/glitch/features/report/components/option.js index 7e94f0654..6ecfc7a24 100644 --- a/app/javascript/flavours/glitch/features/report/components/option.js +++ b/app/javascript/flavours/glitch/features/report/components/option.js @@ -24,12 +24,12 @@ export default class Option extends React.PureComponent { e.preventDefault(); onToggle(value, !checked); } - } + }; handleChange = e => { const { value, onToggle } = this.props; onToggle(value, e.target.checked); - } + }; render () { const { name, value, checked, label, labelComponent, description, multiple } = this.props; diff --git a/app/javascript/flavours/glitch/features/status/components/action_bar.js b/app/javascript/flavours/glitch/features/status/components/action_bar.js index 73913dd49..4901fc4cc 100644 --- a/app/javascript/flavours/glitch/features/status/components/action_bar.js +++ b/app/javascript/flavours/glitch/features/status/components/action_bar.js @@ -68,75 +68,75 @@ class ActionBar extends React.PureComponent { handleReplyClick = () => { this.props.onReply(this.props.status); - } + }; handleReblogClick = (e) => { this.props.onReblog(this.props.status, e); - } + }; handleFavouriteClick = (e) => { this.props.onFavourite(this.props.status, e); - } + }; handleBookmarkClick = (e) => { this.props.onBookmark(this.props.status, e); - } + }; handleDeleteClick = () => { this.props.onDelete(this.props.status, this.context.router.history); - } + }; handleRedraftClick = () => { this.props.onDelete(this.props.status, this.context.router.history, true); - } + }; handleEditClick = () => { this.props.onEdit(this.props.status, this.context.router.history); - } + }; handleDirectClick = () => { this.props.onDirect(this.props.status.get('account'), this.context.router.history); - } + }; handleMentionClick = () => { this.props.onMention(this.props.status.get('account'), this.context.router.history); - } + }; handleMuteClick = () => { this.props.onMute(this.props.status.get('account')); - } + }; handleConversationMuteClick = () => { this.props.onMuteConversation(this.props.status); - } + }; handleBlockClick = () => { this.props.onBlock(this.props.status); - } + }; handleReport = () => { this.props.onReport(this.props.status); - } + }; handlePinClick = () => { this.props.onPin(this.props.status); - } + }; handleShare = () => { navigator.share({ text: this.props.status.get('search_index'), url: this.props.status.get('url'), }); - } + }; handleEmbed = () => { this.props.onEmbed(this.props.status); - } + }; handleCopy = () => { const url = this.props.status.get('url'); navigator.clipboard.writeText(url); - } + }; render () { const { status, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/status/components/card.js b/app/javascript/flavours/glitch/features/status/components/card.js index 2d2e49eb8..6a306ed14 100644 --- a/app/javascript/flavours/glitch/features/status/components/card.js +++ b/app/javascript/flavours/glitch/features/status/components/card.js @@ -138,7 +138,7 @@ export default class Card extends React.PureComponent { } else { this.setState({ embedded: true }); } - } + }; setRef = c => { this.node = c; @@ -146,17 +146,17 @@ export default class Card extends React.PureComponent { if (this.node) { this._setDimensions(); } - } + }; handleImageLoad = () => { this.setState({ previewLoaded: true }); - } + }; handleReveal = e => { e.preventDefault(); e.stopPropagation(); this.setState({ revealed: true }); - } + }; renderVideo () { const { card } = this.props; diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.js b/app/javascript/flavours/glitch/features/status/components/detailed_status.js index 907fc3f1c..644881fa5 100644 --- a/app/javascript/flavours/glitch/features/status/components/detailed_status.js +++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.js @@ -56,28 +56,28 @@ class DetailedStatus extends ImmutablePureComponent { handleAccountClick = (e) => { if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey) && this.context.router) { e.preventDefault(); - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state); } e.stopPropagation(); - } + }; parseClick = (e, destination) => { if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey) && this.context.router) { e.preventDefault(); - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(destination, state); } e.stopPropagation(); - } + }; handleOpenVideo = (options) => { this.props.onOpenVideo(this.props.status.getIn(['media_attachments', 0]), options); - } + }; _measureHeight (heightJustChanged) { if (this.props.measureHeight && this.node) { @@ -92,7 +92,7 @@ class DetailedStatus extends ImmutablePureComponent { setRef = c => { this.node = c; this._measureHeight(); - } + }; componentDidUpdate (prevProps, prevState) { this._measureHeight(prevState.height !== this.state.height); @@ -100,7 +100,7 @@ class DetailedStatus extends ImmutablePureComponent { handleChildUpdate = () => { this._measureHeight(); - } + }; handleModalLink = e => { e.preventDefault(); @@ -114,12 +114,12 @@ class DetailedStatus extends ImmutablePureComponent { } window.open(href, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes'); - } + }; handleTranslate = () => { const { onTranslate, status } = this.props; onTranslate(status); - } + }; render () { const status = (this.props.status && this.props.status.get('reblog')) ? this.props.status.get('reblog') : this.props.status; diff --git a/app/javascript/flavours/glitch/features/status/index.js b/app/javascript/flavours/glitch/features/status/index.js index c22e7f0bd..9b49d41e4 100644 --- a/app/javascript/flavours/glitch/features/status/index.js +++ b/app/javascript/flavours/glitch/features/status/index.js @@ -263,15 +263,15 @@ class Status extends ImmutablePureComponent { } else if (this.props.status.get('spoiler_text')) { this.setExpansion(!this.state.isExpanded); } - } + }; handleToggleMediaVisibility = () => { this.setState({ showMedia: !this.state.showMedia }); - } + }; handleModalFavourite = (status) => { this.props.dispatch(favourite(status)); - } + }; handleFavouriteClick = (status, e) => { const { dispatch } = this.props; @@ -294,7 +294,7 @@ class Status extends ImmutablePureComponent { url: status.get('url'), })); } - } + }; handlePin = (status) => { if (status.get('pinned')) { @@ -302,7 +302,7 @@ class Status extends ImmutablePureComponent { } else { this.props.dispatch(pin(status)); } - } + }; handleReplyClick = (status) => { const { askReplyConfirmation, dispatch, intl } = this.props; @@ -326,7 +326,7 @@ class Status extends ImmutablePureComponent { url: status.get('url'), })); } - } + }; handleModalReblog = (status, privacy) => { const { dispatch } = this.props; @@ -336,7 +336,7 @@ class Status extends ImmutablePureComponent { } else { dispatch(reblog(status, privacy)); } - } + }; handleReblogClick = (status, e) => { const { settings, dispatch } = this.props; @@ -357,7 +357,7 @@ class Status extends ImmutablePureComponent { url: status.get('url'), })); } - } + }; handleBookmarkClick = (status) => { if (status.get('bookmarked')) { @@ -365,7 +365,7 @@ class Status extends ImmutablePureComponent { } else { this.props.dispatch(bookmark(status)); } - } + }; handleDeleteClick = (status, history, withRedraft = false) => { const { dispatch, intl } = this.props; @@ -379,27 +379,27 @@ class Status extends ImmutablePureComponent { onConfirm: () => dispatch(deleteStatus(status.get('id'), history, withRedraft)), })); } - } + }; handleEditClick = (status, history) => { this.props.dispatch(editStatus(status.get('id'), history)); - } + }; handleDirectClick = (account, router) => { this.props.dispatch(directCompose(account, router)); - } + }; handleMentionClick = (account, router) => { this.props.dispatch(mentionCompose(account, router)); - } + }; handleOpenMedia = (media, index) => { this.props.dispatch(openModal('MEDIA', { statusId: this.props.status.get('id'), media, index })); - } + }; handleOpenVideo = (media, options) => { this.props.dispatch(openModal('VIDEO', { statusId: this.props.status.get('id'), media, options })); - } + }; handleHotkeyOpenMedia = e => { const { status } = this.props; @@ -413,11 +413,11 @@ class Status extends ImmutablePureComponent { this.handleOpenMedia(status.get('media_attachments'), 0); } } - } + }; handleMuteClick = (account) => { this.props.dispatch(initMuteModal(account)); - } + }; handleConversationMuteClick = (status) => { if (status.get('muted')) { @@ -425,7 +425,7 @@ class Status extends ImmutablePureComponent { } else { this.props.dispatch(muteStatus(status.get('id'))); } - } + }; handleToggleAll = () => { const { status, ancestorsIds, descendantsIds, settings } = this.props; @@ -442,7 +442,7 @@ class Status extends ImmutablePureComponent { } this.setState({ isExpanded: !isExpanded, threadExpanded: !isExpanded }); - } + }; handleTranslate = status => { const { dispatch } = this.props; @@ -452,61 +452,61 @@ class Status extends ImmutablePureComponent { } else { dispatch(translateStatus(status.get('id'))); } - } + }; handleBlockClick = (status) => { const { dispatch } = this.props; const account = status.get('account'); dispatch(initBlockModal(account)); - } + }; handleReport = (status) => { this.props.dispatch(initReport(status.get('account'), status)); - } + }; handleEmbed = (status) => { this.props.dispatch(openModal('EMBED', { url: status.get('url') })); - } + }; handleHotkeyToggleSensitive = () => { this.handleToggleMediaVisibility(); - } + }; handleHotkeyMoveUp = () => { this.handleMoveUp(this.props.status.get('id')); - } + }; handleHotkeyMoveDown = () => { this.handleMoveDown(this.props.status.get('id')); - } + }; handleHotkeyReply = e => { e.preventDefault(); this.handleReplyClick(this.props.status); - } + }; handleHotkeyFavourite = () => { this.handleFavouriteClick(this.props.status); - } + }; handleHotkeyBoost = () => { this.handleReblogClick(this.props.status); - } + }; handleHotkeyBookmark = () => { this.handleBookmarkClick(this.props.status); - } + }; handleHotkeyMention = e => { e.preventDefault(); this.handleMentionClick(this.props.status); - } + }; handleHotkeyOpenProfile = () => { - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state); - } + }; handleMoveUp = id => { const { status, ancestorsIds, descendantsIds } = this.props; @@ -523,7 +523,7 @@ class Status extends ImmutablePureComponent { this._selectChild(index - 1, true); } } - } + }; handleMoveDown = id => { const { status, ancestorsIds, descendantsIds } = this.props; @@ -540,7 +540,7 @@ class Status extends ImmutablePureComponent { this._selectChild(index + 1, false); } } - } + }; _selectChild (index, align_top) { const container = this.node; @@ -558,7 +558,7 @@ class Status extends ImmutablePureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; renderChildren (list) { return list.map(id => ( @@ -575,15 +575,15 @@ class Status extends ImmutablePureComponent { setExpansion = value => { this.setState({ isExpanded: value }); - } + }; setRef = c => { this.node = c; - } + }; setColumnRef = c => { this.column = c; - } + }; componentDidUpdate (prevProps) { if (this.props.params.statusId && (this.props.params.statusId !== prevProps.params.statusId || prevProps.ancestorsIds.size < this.props.ancestorsIds.size)) { @@ -605,7 +605,7 @@ class Status extends ImmutablePureComponent { onFullScreenChange = () => { this.setState({ fullscreen: isFullscreen() }); - } + }; render () { let ancestors, descendants; diff --git a/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js b/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js index fa69d82a4..35083503c 100644 --- a/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js +++ b/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js @@ -72,7 +72,7 @@ class SubscribedLanguagesModal extends ImmutablePureComponent { handleSubmit = () => { this.props.onSubmit(this.state.selectedLanguages.toArray()); this.props.onClose(); - } + }; renderItem (value) { const language = this.props.languages.find(language => language[0] === value); diff --git a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js index aae2e4426..c6e3ee37c 100644 --- a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js @@ -52,7 +52,7 @@ export default class ActionsModal extends ImmutablePureComponent { ); - } + }; render () { const status = this.props.status && ( diff --git a/app/javascript/flavours/glitch/features/ui/components/block_modal.js b/app/javascript/flavours/glitch/features/ui/components/block_modal.js index a07baeaa6..6c9d2043c 100644 --- a/app/javascript/flavours/glitch/features/ui/components/block_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/block_modal.js @@ -55,20 +55,20 @@ class BlockModal extends React.PureComponent { handleClick = () => { this.props.onClose(); this.props.onConfirm(this.props.account); - } + }; handleSecondary = () => { this.props.onClose(); this.props.onBlockAndReport(this.props.account); - } + }; handleCancel = () => { this.props.onClose(); - } + }; setRef = (c) => { this.button = c; - } + }; render () { const { account } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/boost_modal.js b/app/javascript/flavours/glitch/features/ui/components/boost_modal.js index 8d9496bb9..a65b84e20 100644 --- a/app/javascript/flavours/glitch/features/ui/components/boost_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/boost_modal.js @@ -58,17 +58,17 @@ class BoostModal extends ImmutablePureComponent { handleReblog = () => { this.props.onReblog(this.props.status, this.props.privacy); this.props.onClose(); - } + }; handleAccountClick = (e) => { if (e.button === 0) { e.preventDefault(); this.props.onClose(); - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state); } - } + }; _findContainer = () => { return document.getElementsByClassName('modal-root__container')[0]; @@ -76,7 +76,7 @@ class BoostModal extends ImmutablePureComponent { setRef = (c) => { this.button = c; - } + }; render () { const { status, missingMediaDescription, privacy, intl } = this.props; @@ -116,9 +116,9 @@ class BoostModal extends ImmutablePureComponent {
{ missingMediaDescription ? - + : - Shift + }} /> + Shift + }} /> }
diff --git a/app/javascript/flavours/glitch/features/ui/components/bundle.js b/app/javascript/flavours/glitch/features/ui/components/bundle.js index 8f0d7b8b1..27b13ecfe 100644 --- a/app/javascript/flavours/glitch/features/ui/components/bundle.js +++ b/app/javascript/flavours/glitch/features/ui/components/bundle.js @@ -15,7 +15,7 @@ class Bundle extends React.Component { onFetch: PropTypes.func, onFetchSuccess: PropTypes.func, onFetchFail: PropTypes.func, - } + }; static defaultProps = { loading: emptyComponent, @@ -24,14 +24,14 @@ class Bundle extends React.Component { onFetch: noop, onFetchSuccess: noop, onFetchFail: noop, - } + }; - static cache = {} + static cache = {}; state = { mod: undefined, forceRender: false, - } + }; componentWillMount() { this.load(this.props); @@ -84,7 +84,7 @@ class Bundle extends React.Component { this.setState({ mod: null }); onFetchFail(error); }); - } + }; render() { const { loading: Loading, error: Error, children, renderDelay } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/bundle_column_error.js b/app/javascript/flavours/glitch/features/ui/components/bundle_column_error.js index 7cbe1413d..88304dc36 100644 --- a/app/javascript/flavours/glitch/features/ui/components/bundle_column_error.js +++ b/app/javascript/flavours/glitch/features/ui/components/bundle_column_error.js @@ -31,7 +31,7 @@ class GIF extends React.PureComponent { if (!animate) { this.setState({ hovering: true }); } - } + }; handleMouseLeave = () => { const { animate } = this.props; @@ -39,7 +39,7 @@ class GIF extends React.PureComponent { if (!animate) { this.setState({ hovering: false }); } - } + }; render () { const { src, staticSrc, className, animate } = this.props; @@ -75,7 +75,7 @@ class CopyButton extends React.PureComponent { navigator.clipboard.writeText(value); this.setState({ copied: true }); this.timeout = setTimeout(() => this.setState({ copied: false }), 700); - } + }; componentWillUnmount () { if (this.timeout) clearTimeout(this.timeout); @@ -113,7 +113,7 @@ class BundleColumnError extends React.PureComponent { if (onRetry) { onRetry(); } - } + }; render () { const { errorType, multiColumn, stacktrace } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.js b/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.js index 2c14a1e5c..b79105450 100644 --- a/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.js +++ b/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.js @@ -16,11 +16,11 @@ class BundleModalError extends React.Component { onRetry: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, - } + }; handleRetry = () => { this.props.onRetry(); - } + }; render () { const { onClose, intl: { formatMessage } } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/column.js b/app/javascript/flavours/glitch/features/ui/components/column.js index e9c1e2f87..cc2abc43a 100644 --- a/app/javascript/flavours/glitch/features/ui/components/column.js +++ b/app/javascript/flavours/glitch/features/ui/components/column.js @@ -25,7 +25,7 @@ export default class Column extends React.PureComponent { } this._interruptScrollAnimation = scrollTop(scrollable); - } + }; scrollTop () { const scrollable = this.props.bindToDocument ? document.scrollingElement : this.node.querySelector('.scrollable'); @@ -42,11 +42,11 @@ export default class Column extends React.PureComponent { if (typeof this._interruptScrollAnimation !== 'undefined') { this._interruptScrollAnimation(); } - }, 200) + }, 200); setRef = (c) => { this.node = c; - } + }; render () { const { heading, icon, children, active, hideHeadingOnMobile, name } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/column_header.js b/app/javascript/flavours/glitch/features/ui/components/column_header.js index 528ff73a6..151476f8b 100644 --- a/app/javascript/flavours/glitch/features/ui/components/column_header.js +++ b/app/javascript/flavours/glitch/features/ui/components/column_header.js @@ -15,7 +15,7 @@ export default class ColumnHeader extends React.PureComponent { handleClick = () => { this.props.onClick(); - } + }; render () { const { icon, type, active, columnHeaderId } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/column_link.js b/app/javascript/flavours/glitch/features/ui/components/column_link.js index bd1c20b47..dcdac077f 100644 --- a/app/javascript/flavours/glitch/features/ui/components/column_link.js +++ b/app/javascript/flavours/glitch/features/ui/components/column_link.js @@ -30,7 +30,7 @@ const ColumnLink = ({ icon, text, to, onClick, href, method, badge, transparent, e.preventDefault(); e.stopPropagation(); return onClick(e); - } + }; return ( {iconElement} diff --git a/app/javascript/flavours/glitch/features/ui/components/columns_area.js b/app/javascript/flavours/glitch/features/ui/components/columns_area.js index 993a50796..3b3b0d58f 100644 --- a/app/javascript/flavours/glitch/features/ui/components/columns_area.js +++ b/app/javascript/flavours/glitch/features/ui/components/columns_area.js @@ -59,7 +59,7 @@ export default class ColumnsArea extends ImmutablePureComponent { state = { renderComposePanel: !(this.mediaQuery && this.mediaQuery.matches), - } + }; componentDidMount() { if (!this.props.singleColumn) { @@ -113,7 +113,7 @@ export default class ColumnsArea extends ImmutablePureComponent { handleLayoutChange = (e) => { this.setState({ renderComposePanel: !e.matches }); - } + }; handleWheel = () => { if (typeof this._interruptScrollAnimation !== 'function') { @@ -121,19 +121,19 @@ export default class ColumnsArea extends ImmutablePureComponent { } this._interruptScrollAnimation(); - } + }; setRef = (node) => { this.node = node; - } + }; renderLoading = columnId => () => { return columnId === 'COMPOSE' ? : ; - } + }; renderError = (props) => { return ; - } + }; render () { const { columns, children, singleColumn, navbarUnder, openSettings } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/compose_panel.js b/app/javascript/flavours/glitch/features/ui/components/compose_panel.js index dde252a61..34c194c99 100644 --- a/app/javascript/flavours/glitch/features/ui/components/compose_panel.js +++ b/app/javascript/flavours/glitch/features/ui/components/compose_panel.js @@ -55,4 +55,4 @@ class ComposePanel extends React.PureComponent { ); } -}; +} diff --git a/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js b/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js index a665b9fb1..94935de5d 100644 --- a/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js @@ -34,24 +34,24 @@ class ConfirmationModal extends React.PureComponent { if (this.props.onDoNotAsk && this.doNotAskCheckbox.checked) { this.props.onDoNotAsk(); } - } + }; handleSecondary = () => { this.props.onClose(); this.props.onSecondary(); - } + }; handleCancel = () => { this.props.onClose(); - } + }; setRef = (c) => { this.button = c; - } + }; setDoNotAskRef = (c) => { this.doNotAskCheckbox = c; - } + }; render () { const { message, confirm, secondary, onDoNotAsk } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.js b/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.js index 68f04cb21..37f52b014 100644 --- a/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.js @@ -30,11 +30,11 @@ class DeprecatedSettingsModal extends React.PureComponent { handleClick = () => { this.props.onConfirm(); this.props.onClose(); - } + }; setRef = (c) => { this.button = c; - } + }; render () { const { settings, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/disabled_account_banner.js b/app/javascript/flavours/glitch/features/ui/components/disabled_account_banner.js index c861d4d81..35933bedb 100644 --- a/app/javascript/flavours/glitch/features/ui/components/disabled_account_banner.js +++ b/app/javascript/flavours/glitch/features/ui/components/disabled_account_banner.js @@ -46,7 +46,7 @@ class DisabledAccountBanner extends React.PureComponent { this.props.onLogout(); return false; - } + }; render () { const { disabledAcct, movedToAcct } = this.props; @@ -89,4 +89,4 @@ class DisabledAccountBanner extends React.PureComponent { ); } -}; +} diff --git a/app/javascript/flavours/glitch/features/ui/components/doodle_modal.js b/app/javascript/flavours/glitch/features/ui/components/doodle_modal.js index 0d10204fc..c8ea33a0e 100644 --- a/app/javascript/flavours/glitch/features/ui/components/doodle_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/doodle_modal.js @@ -279,7 +279,7 @@ class DoodleModal extends ImmutablePureComponent { this.swapped = false; window.addEventListener('keyup', this.handleKeyUp, false); window.addEventListener('keydown', this.handleKeyDown, false); - }; + } /** * Tear component down @@ -575,7 +575,7 @@ class DoodleModal extends ImmutablePureComponent {
@@ -602,7 +602,7 @@ class DoodleModal extends ImmutablePureComponent { 'foreground': this.fg === c[0], 'background': this.bg === c[0], })} - /> + />, ) }
diff --git a/app/javascript/flavours/glitch/features/ui/components/embed_modal.js b/app/javascript/flavours/glitch/features/ui/components/embed_modal.js index 624b68f7e..92bfa79c4 100644 --- a/app/javascript/flavours/glitch/features/ui/components/embed_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/embed_modal.js @@ -17,7 +17,7 @@ class EmbedModal extends ImmutablePureComponent { onClose: PropTypes.func.isRequired, onError: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, - } + }; state = { loading: false, @@ -48,11 +48,11 @@ class EmbedModal extends ImmutablePureComponent { setIframeRef = c => { this.iframe = c; - } + }; handleTextareaClick = (e) => { e.target.select(); - } + }; render () { const { intl, onClose } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js b/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js index d7f671d58..78cbfeb51 100644 --- a/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js @@ -38,21 +38,21 @@ class FavouriteModal extends ImmutablePureComponent { handleFavourite = () => { this.props.onFavourite(this.props.status); this.props.onClose(); - } + }; handleAccountClick = (e) => { if (e.button === 0) { e.preventDefault(); this.props.onClose(); - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state); } - } + }; setRef = (c) => { this.button = c; - } + }; render () { const { status, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js index 9eb1c0fbf..e36657fab 100644 --- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js @@ -135,7 +135,7 @@ class FocalPointModal extends ImmutablePureComponent { this.updatePosition(e); this.setState({ dragging: true }); - } + }; handleTouchStart = e => { document.addEventListener('touchmove', this.handleMouseMove); @@ -143,25 +143,25 @@ class FocalPointModal extends ImmutablePureComponent { this.updatePosition(e); this.setState({ dragging: true }); - } + }; handleMouseMove = e => { this.updatePosition(e); - } + }; handleMouseUp = () => { document.removeEventListener('mousemove', this.handleMouseMove); document.removeEventListener('mouseup', this.handleMouseUp); this.setState({ dragging: false }); - } + }; handleTouchEnd = () => { document.removeEventListener('touchmove', this.handleMouseMove); document.removeEventListener('touchend', this.handleTouchEnd); this.setState({ dragging: false }); - } + }; updatePosition = e => { const { x, y } = getPointerPosition(this.node, e); @@ -169,11 +169,11 @@ class FocalPointModal extends ImmutablePureComponent { const focusY = (y - .5) * -2; this.props.onChangeFocus(focusX, focusY); - } + }; handleChange = e => { this.props.onChangeDescription(e.target.value); - } + }; handleKeyDown = (e) => { if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) { @@ -182,11 +182,11 @@ class FocalPointModal extends ImmutablePureComponent { this.props.onChangeDescription(e.target.value); this.handleSubmit(); } - } + }; handleSubmit = () => { this.props.onSave(this.props.description, this.props.focusX, this.props.focusY); - } + }; getCloseConfirmationMessage = () => { const { intl, dirty } = this.props; @@ -199,15 +199,15 @@ class FocalPointModal extends ImmutablePureComponent { } else { return null; } - } + }; setRef = c => { this.node = c; - } + }; handleTextDetection = () => { this._detectText(); - } + }; _detectText = (refreshCache = false) => { const { media } = this.props; @@ -258,21 +258,21 @@ class FocalPointModal extends ImmutablePureComponent { console.error(e); this.setState({ detecting: false }); }); - } + }; handleThumbnailChange = e => { if (e.target.files.length > 0) { this.props.onSelectThumbnail(e.target.files); } - } + }; setFileInputRef = c => { this.fileInput = c; - } + }; handleFileInputClick = () => { this.fileInput.click(); - } + }; render () { const { media, intl, account, onClose, isUploadingThumbnail, description, lang, focusX, focusY, dirty, is_changing_upload } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/image_loader.js b/app/javascript/flavours/glitch/features/ui/components/image_loader.js index dfa0efe49..92aeef5c4 100644 --- a/app/javascript/flavours/glitch/features/ui/components/image_loader.js +++ b/app/javascript/flavours/glitch/features/ui/components/image_loader.js @@ -14,7 +14,7 @@ export default class ImageLoader extends PureComponent { height: PropTypes.number, onClick: PropTypes.func, zoomButtonHidden: PropTypes.bool, - } + }; static defaultProps = { alt: '', @@ -26,7 +26,7 @@ export default class ImageLoader extends PureComponent { loading: true, error: false, width: null, - } + }; removers = []; canvas = null; @@ -86,7 +86,7 @@ export default class ImageLoader extends PureComponent { image.addEventListener('load', handleLoad); image.src = previewSrc; this.removers.push(removeEventListeners); - }) + }); clearPreviewCanvas () { const { width, height } = this.canvas; @@ -126,7 +126,7 @@ export default class ImageLoader extends PureComponent { setCanvasRef = c => { this.canvas = c; if (c) this.setState({ width: c.offsetWidth }); - } + }; render () { const { alt, src, width, height, onClick } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/link_footer.js b/app/javascript/flavours/glitch/features/ui/components/link_footer.js index ac0c78674..c4bea9f31 100644 --- a/app/javascript/flavours/glitch/features/ui/components/link_footer.js +++ b/app/javascript/flavours/glitch/features/ui/components/link_footer.js @@ -44,7 +44,7 @@ class LinkFooter extends React.PureComponent { this.props.onLogout(); return false; - } + }; render () { const { signedIn, permissions } = this.context.identity; @@ -93,4 +93,4 @@ class LinkFooter extends React.PureComponent { ); } -}; +} diff --git a/app/javascript/flavours/glitch/features/ui/components/media_modal.js b/app/javascript/flavours/glitch/features/ui/components/media_modal.js index ec3af857d..24559264e 100644 --- a/app/javascript/flavours/glitch/features/ui/components/media_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/media_modal.js @@ -47,27 +47,27 @@ class MediaModal extends ImmutablePureComponent { handleSwipe = (index) => { this.setState({ index: index % this.props.media.size }); - } + }; handleTransitionEnd = () => { this.setState({ zoomButtonHidden: false, }); - } + }; handleNextClick = () => { this.setState({ index: (this.getIndex() + 1) % this.props.media.size, zoomButtonHidden: true, }); - } + }; handlePrevClick = () => { this.setState({ index: (this.props.media.size + this.getIndex() - 1) % this.props.media.size, zoomButtonHidden: true, }); - } + }; handleChangeIndex = (e) => { const index = Number(e.currentTarget.getAttribute('data-index')); @@ -76,7 +76,7 @@ class MediaModal extends ImmutablePureComponent { index: index % this.props.media.size, zoomButtonHidden: true, }); - } + }; handleKeyDown = (e) => { switch(e.key) { @@ -91,7 +91,7 @@ class MediaModal extends ImmutablePureComponent { e.stopPropagation(); break; } - } + }; componentDidMount () { window.addEventListener('keydown', this.handleKeyDown, false); diff --git a/app/javascript/flavours/glitch/features/ui/components/modal_root.js b/app/javascript/flavours/glitch/features/ui/components/modal_root.js index 379f57cbb..d04a2d53a 100644 --- a/app/javascript/flavours/glitch/features/ui/components/modal_root.js +++ b/app/javascript/flavours/glitch/features/ui/components/modal_root.js @@ -76,7 +76,7 @@ export default class ModalRoot extends React.PureComponent { }; componentDidUpdate () { - if (!!this.props.type) { + if (this.props.type) { document.body.classList.add('with-modals--active'); document.documentElement.style.marginRight = `${getScrollbarWidth()}px`; } else { @@ -87,17 +87,17 @@ export default class ModalRoot extends React.PureComponent { setBackgroundColor = color => { this.setState({ backgroundColor: color }); - } + }; renderLoading = modalId => () => { return ['MEDIA', 'VIDEO', 'BOOST', 'FAVOURITE', 'DOODLE', 'CONFIRM', 'ACTIONS'].indexOf(modalId) === -1 ? : null; - } + }; renderError = (props) => { const { onClose } = this.props; return ; - } + }; handleClose = (ignoreFocus = false) => { const { onClose } = this.props; @@ -110,14 +110,14 @@ export default class ModalRoot extends React.PureComponent { // This would be much smoother with react-intl 3+ and `forwardRef`. } onClose(message, ignoreFocus); - } + }; setModalRef = (c) => { this._modal = c; - } + }; // prevent closing of modal when clicking the overlay - noop = () => {} + noop = () => {}; render () { const { type, props, ignoreFocus } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/mute_modal.js b/app/javascript/flavours/glitch/features/ui/components/mute_modal.js index 7d25db316..f8bb9a364 100644 --- a/app/javascript/flavours/glitch/features/ui/components/mute_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/mute_modal.js @@ -65,23 +65,23 @@ class MuteModal extends React.PureComponent { handleClick = () => { this.props.onClose(); this.props.onConfirm(this.props.account, this.props.notifications, this.props.muteDuration); - } + }; handleCancel = () => { this.props.onClose(); - } + }; setRef = (c) => { this.button = c; - } + }; toggleNotifications = () => { this.props.onToggleNotifications(); - } + }; changeMuteDuration = (e) => { this.props.onChangeMuteDuration(e); - } + }; render () { const { account, notifications, muteDuration, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js b/app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js index 611fae1ce..d972fe3b5 100644 --- a/app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js @@ -49,7 +49,7 @@ const PageTwo = ({ intl, myAccount }) => ( privacy='public' text='Awoo! #introductions' spoilerText='' - suggestions={ [] } + suggestions={[]} />
@@ -195,7 +195,7 @@ class OnboardingModal extends React.PureComponent { , , ]; - }; + } componentDidMount() { window.addEventListener('keyup', this.handleKeyUp); @@ -208,30 +208,30 @@ class OnboardingModal extends React.PureComponent { handleSkip = (e) => { e.preventDefault(); this.props.onClose(); - } + }; handleDot = (e) => { const i = Number(e.currentTarget.getAttribute('data-index')); e.preventDefault(); this.setState({ currentIndex: i }); - } + }; handlePrev = () => { this.setState(({ currentIndex }) => ({ currentIndex: Math.max(0, currentIndex - 1), })); - } + }; handleNext = () => { const { pages } = this; this.setState(({ currentIndex }) => ({ currentIndex: Math.min(currentIndex + 1, pages.length - 1), })); - } + }; handleSwipe = (index) => { this.setState({ currentIndex: index }); - } + }; handleKeyUp = ({ key }) => { switch (key) { @@ -242,11 +242,11 @@ class OnboardingModal extends React.PureComponent { this.handleNext(); break; } - } + }; handleClose = () => { this.props.onClose(); - } + }; render () { const { pages } = this; diff --git a/app/javascript/flavours/glitch/features/ui/components/report_modal.js b/app/javascript/flavours/glitch/features/ui/components/report_modal.js index 7b6a4a784..4d7f84bae 100644 --- a/app/javascript/flavours/glitch/features/ui/components/report_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/report_modal.js @@ -96,7 +96,7 @@ class ReportModal extends ImmutablePureComponent { } else { this.setState({ selectedRuleIds: selectedRuleIds.remove(ruleId) }); } - } + }; handleChangeCategory = category => { this.setState({ category }); diff --git a/app/javascript/flavours/glitch/features/ui/components/upload_area.js b/app/javascript/flavours/glitch/features/ui/components/upload_area.js index 6958ba9df..0e07b67f8 100644 --- a/app/javascript/flavours/glitch/features/ui/components/upload_area.js +++ b/app/javascript/flavours/glitch/features/ui/components/upload_area.js @@ -22,7 +22,7 @@ export default class UploadArea extends React.PureComponent { break; } } - } + }; componentDidMount () { window.addEventListener('keyup', this.handleKeyUp, false); diff --git a/app/javascript/flavours/glitch/features/ui/components/zoomable_image.js b/app/javascript/flavours/glitch/features/ui/components/zoomable_image.js index caeeced64..50b36b478 100644 --- a/app/javascript/flavours/glitch/features/ui/components/zoomable_image.js +++ b/app/javascript/flavours/glitch/features/ui/components/zoomable_image.js @@ -102,7 +102,7 @@ class ZoomableImage extends React.PureComponent { onClick: PropTypes.func, zoomButtonHidden: PropTypes.bool, intl: PropTypes.object.isRequired, - } + }; static defaultProps = { alt: '', @@ -132,7 +132,7 @@ class ZoomableImage extends React.PureComponent { dragged: false, lockScroll: { x: 0, y: 0 }, lockTranslate: { x: 0, y: 0 }, - } + }; removers = []; container = null; @@ -212,7 +212,7 @@ class ZoomableImage extends React.PureComponent { // lock horizontal scroll this.container.scrollLeft = Math.max(this.container.scrollLeft + event.pixelX, this.state.lockScroll.x); - } + }; mouseDownHandler = e => { this.container.style.cursor = 'grabbing'; @@ -228,7 +228,7 @@ class ZoomableImage extends React.PureComponent { this.image.addEventListener('mousemove', this.mouseMoveHandler); this.image.addEventListener('mouseup', this.mouseUpHandler); - } + }; mouseMoveHandler = e => { const dx = e.clientX - this.state.dragPosition.x; @@ -238,7 +238,7 @@ class ZoomableImage extends React.PureComponent { this.container.scrollTop = Math.max(this.state.dragPosition.top - dy, this.state.lockScroll.y); this.setState({ dragged: true }); - } + }; mouseUpHandler = () => { this.container.style.cursor = 'grab'; @@ -246,13 +246,13 @@ class ZoomableImage extends React.PureComponent { this.image.removeEventListener('mousemove', this.mouseMoveHandler); this.image.removeEventListener('mouseup', this.mouseUpHandler); - } + }; handleTouchStart = e => { if (e.touches.length !== 2) return; this.lastDistance = getDistance(...e.touches); - } + }; handleTouchMove = e => { const { scrollTop, scrollHeight, clientHeight } = this.container; @@ -275,7 +275,7 @@ class ZoomableImage extends React.PureComponent { this.lastMidpoint = midpoint; this.lastDistance = distance; - } + }; zoom(nextScale, midpoint) { const { scale, zoomMatrix } = this.state; @@ -314,11 +314,11 @@ class ZoomableImage extends React.PureComponent { const handler = this.props.onClick; if (handler) handler(); this.setState({ navigationHidden: !this.state.navigationHidden }); - } + }; handleMouseDown = e => { e.preventDefault(); - } + }; initZoomMatrix = () => { const { width, height } = this.props; @@ -350,7 +350,7 @@ class ZoomableImage extends React.PureComponent { translateY: translateY, }, }); - } + }; handleZoomClick = e => { e.preventDefault(); @@ -392,15 +392,15 @@ class ZoomableImage extends React.PureComponent { this.container.style.cursor = 'grab'; this.container.style.removeProperty('user-select'); - } + }; setContainerRef = c => { this.container = c; - } + }; setImageRef = c => { this.image = c; - } + }; render () { const { alt, src, width, height, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js index d8889f9f9..9255e346e 100644 --- a/app/javascript/flavours/glitch/features/ui/index.js +++ b/app/javascript/flavours/glitch/features/ui/index.js @@ -162,7 +162,7 @@ class SwitchingColumnsArea extends React.PureComponent { if (c) { this.node = c; } - } + }; render () { const { children, mobile, navbarUnder } = this.props; @@ -240,7 +240,7 @@ class SwitchingColumnsArea extends React.PureComponent { ); - }; + } } @@ -292,7 +292,7 @@ class UI extends React.Component { // but we set user-friendly message for other browsers, e.g. Edge. e.returnValue = intl.formatMessage(messages.beforeUnload); } - } + }; handleDragEnter = (e) => { e.preventDefault(); @@ -308,7 +308,7 @@ class UI extends React.Component { if (e.dataTransfer && e.dataTransfer.types.includes('Files') && this.props.canUploadMore && this.context.identity.signedIn) { this.setState({ draggingOver: true }); } - } + }; handleDragOver = (e) => { if (this.dataTransferIsText(e.dataTransfer)) return false; @@ -322,7 +322,7 @@ class UI extends React.Component { } return false; - } + }; handleDrop = (e) => { if (this.dataTransferIsText(e.dataTransfer)) return; @@ -335,7 +335,7 @@ class UI extends React.Component { if (e.dataTransfer && e.dataTransfer.files.length >= 1 && this.props.canUploadMore && this.context.identity.signedIn) { this.props.dispatch(uploadCompose(e.dataTransfer.files)); } - } + }; handleDragLeave = (e) => { e.preventDefault(); @@ -348,15 +348,15 @@ class UI extends React.Component { } this.setState({ draggingOver: false }); - } + }; dataTransferIsText = (dataTransfer) => { return (dataTransfer && Array.from(dataTransfer.types).filter((type) => type === 'text/plain').length === 1); - } + }; closeUploadModal = () => { this.setState({ draggingOver: false }); - } + }; handleServiceWorkerPostMessage = ({ data }) => { if (data.type === 'navigate') { @@ -364,7 +364,7 @@ class UI extends React.Component { } else { console.warn('Unknown message type:', data.type); } - } + }; handleVisibilityChange = () => { const visibility = !document[this.visibilityHiddenProp]; @@ -372,7 +372,7 @@ class UI extends React.Component { if (visibility) { this.props.dispatch(submitMarkers({ immediate: true })); } - } + }; handleLayoutChange = debounce(() => { this.props.dispatch(clearHeight()); // The cached heights are no longer accurate, invalidate @@ -389,7 +389,7 @@ class UI extends React.Component { } else { this.handleLayoutChange(); } - } + }; componentDidMount () { const { signedIn } = this.context.identity; @@ -407,7 +407,7 @@ class UI extends React.Component { navigator.serviceWorker.addEventListener('message', this.handleServiceWorkerPostMessage); } - this.favicon = new Favico({ animation:"none" }); + this.favicon = new Favico({ animation:'none' }); // On first launch, redirect to the follow recommendations page if (signedIn && this.props.firstLaunch) { @@ -487,7 +487,7 @@ class UI extends React.Component { setRef = c => { this.node = c; - } + }; handleHotkeyNew = e => { e.preventDefault(); @@ -497,7 +497,7 @@ class UI extends React.Component { if (element) { element.focus(); } - } + }; handleHotkeySearch = e => { e.preventDefault(); @@ -507,17 +507,17 @@ class UI extends React.Component { if (element) { element.focus(); } - } + }; handleHotkeyForceNew = e => { this.handleHotkeyNew(e); this.props.dispatch(resetCompose()); - } + }; handleHotkeyToggleComposeSpoilers = e => { e.preventDefault(); this.props.dispatch(changeComposeSpoilerness()); - } + }; handleHotkeyFocusColumn = e => { const index = (e.key * 1) + 1; // First child is drawer, skip that @@ -535,7 +535,7 @@ class UI extends React.Component { status.focus(); } } - } + }; handleHotkeyBack = () => { // if history is exhausted, or we would leave mastodon, just go to root. @@ -544,11 +544,11 @@ class UI extends React.Component { } else { this.props.history.push('/'); } - } + }; setHotkeysRef = c => { this.hotkeys = c; - } + }; handleHotkeyToggleHelp = () => { if (this.props.location.pathname === '/keyboard-shortcuts') { @@ -556,55 +556,55 @@ class UI extends React.Component { } else { this.props.history.push('/keyboard-shortcuts'); } - } + }; handleHotkeyGoToHome = () => { this.props.history.push('/home'); - } + }; handleHotkeyGoToNotifications = () => { this.props.history.push('/notifications'); - } + }; handleHotkeyGoToLocal = () => { this.props.history.push('/public/local'); - } + }; handleHotkeyGoToFederated = () => { this.props.history.push('/public'); - } + }; handleHotkeyGoToDirect = () => { this.props.history.push('/conversations'); - } + }; handleHotkeyGoToStart = () => { this.props.history.push('/getting-started'); - } + }; handleHotkeyGoToFavourites = () => { this.props.history.push('/favourites'); - } + }; handleHotkeyGoToPinned = () => { this.props.history.push('/pinned'); - } + }; handleHotkeyGoToProfile = () => { this.props.history.push(`/@${this.props.username}`); - } + }; handleHotkeyGoToBlocked = () => { this.props.history.push('/blocks'); - } + }; handleHotkeyGoToMuted = () => { this.props.history.push('/mutes'); - } + }; handleHotkeyGoToRequests = () => { this.props.history.push('/follow_requests'); - } + }; render () { const { draggingOver } = this.state; @@ -661,7 +661,7 @@ class UI extends React.Component { @{moved.get('acct')} - )}} + ) }} /> )} diff --git a/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.js b/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.js index 8946c8252..b1c952d87 100644 --- a/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.js +++ b/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.js @@ -36,7 +36,7 @@ export class WrappedRoute extends React.Component { content: PropTypes.node, multiColumn: PropTypes.bool, componentParams: PropTypes.object, - } + }; static defaultProps = { componentParams: {}, @@ -46,7 +46,7 @@ export class WrappedRoute extends React.Component { return { hasError: true, }; - }; + } state = { hasError: false, @@ -80,17 +80,17 @@ export class WrappedRoute extends React.Component { {Component => {content}} ); - } + }; renderLoading = () => { const { multiColumn } = this.props; return ; - } + }; renderError = (props) => { return ; - } + }; render () { const { component: Component, content, ...rest } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/util/reduced_motion.js b/app/javascript/flavours/glitch/features/ui/util/reduced_motion.js index 95519042b..1123b80ed 100644 --- a/app/javascript/flavours/glitch/features/ui/util/reduced_motion.js +++ b/app/javascript/flavours/glitch/features/ui/util/reduced_motion.js @@ -17,7 +17,7 @@ class ReducedMotion extends React.Component { defaultStyle: PropTypes.object, style: PropTypes.object, children: PropTypes.func, - } + }; render() { diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js index 0daab747b..cb923bcf7 100644 --- a/app/javascript/flavours/glitch/features/video/index.js +++ b/app/javascript/flavours/glitch/features/video/index.js @@ -156,7 +156,7 @@ class Video extends React.PureComponent { if (this.player) { this._setDimensions(); } - } + }; _setDimensions () { const width = this.player.offsetWidth; @@ -178,26 +178,26 @@ class Video extends React.PureComponent { if (this.video) { this.setState({ volume: this.video.volume, muted: this.video.muted }); } - } + }; setSeekRef = c => { this.seek = c; - } + }; setVolumeRef = c => { this.volume = c; - } + }; handleClickRoot = e => e.stopPropagation(); handlePlay = () => { this.setState({ paused: false }); this._updateTime(); - } + }; handlePause = () => { this.setState({ paused: true }); - } + }; _updateTime () { requestAnimationFrame(() => { @@ -216,7 +216,7 @@ class Video extends React.PureComponent { currentTime: this.video.currentTime, duration:this.video.duration, }); - } + }; handleVolumeMouseDown = e => { document.addEventListener('mousemove', this.handleMouseVolSlide, true); @@ -228,14 +228,14 @@ class Video extends React.PureComponent { e.preventDefault(); e.stopPropagation(); - } + }; handleVolumeMouseUp = () => { document.removeEventListener('mousemove', this.handleMouseVolSlide, true); document.removeEventListener('mouseup', this.handleVolumeMouseUp, true); document.removeEventListener('touchmove', this.handleMouseVolSlide, true); document.removeEventListener('touchend', this.handleVolumeMouseUp, true); - } + }; handleMouseVolSlide = throttle(e => { const { x } = getPointerPosition(this.volume, e); @@ -259,7 +259,7 @@ class Video extends React.PureComponent { e.preventDefault(); e.stopPropagation(); - } + }; handleMouseUp = () => { document.removeEventListener('mousemove', this.handleMouseMove, true); @@ -269,7 +269,7 @@ class Video extends React.PureComponent { this.setState({ dragging: false }); this.video.play(); - } + }; handleMouseMove = throttle(e => { const { x } = getPointerPosition(this.seek, e); @@ -301,7 +301,7 @@ class Video extends React.PureComponent { e.stopPropagation(); this.togglePlay(); } - } + }; handleKeyDown = e => { const frameTime = 1 / this.getFrameRate(); @@ -355,7 +355,7 @@ class Video extends React.PureComponent { exitFullscreen(); } } - } + }; togglePlay = () => { if (this.state.paused) { @@ -363,7 +363,7 @@ class Video extends React.PureComponent { } else { this.setState({ paused: true }, () => this.video.pause()); } - } + }; toggleFullscreen = () => { if (isFullscreen()) { @@ -371,7 +371,7 @@ class Video extends React.PureComponent { } else { requestFullscreen(this.player); } - } + }; componentDidMount () { document.addEventListener('fullscreenchange', this.handleFullscreenChange, true); @@ -444,19 +444,19 @@ class Video extends React.PureComponent { this.setState({ paused: true }); } - }, 150, { trailing: true }) + }, 150, { trailing: true }); handleFullscreenChange = () => { this.setState({ fullscreen: isFullscreen() }); - } + }; handleMouseEnter = () => { this.setState({ hovered: true }); - } + }; handleMouseLeave = () => { this.setState({ hovered: false }); - } + }; toggleMute = () => { const muted = !this.video.muted; @@ -464,7 +464,7 @@ class Video extends React.PureComponent { this.setState({ muted }, () => { this.video.muted = muted; }); - } + }; toggleReveal = () => { if (this.state.revealed) { @@ -476,7 +476,7 @@ class Video extends React.PureComponent { } else { this.setState({ revealed: !this.state.revealed }); } - } + }; handleLoadedData = () => { const { currentTime, volume, muted, autoPlay } = this.props; @@ -496,7 +496,7 @@ class Video extends React.PureComponent { if (autoPlay) { this.video.play(); } - } + }; handleProgress = () => { const lastTimeRange = this.video.buffered.length - 1; @@ -504,11 +504,11 @@ class Video extends React.PureComponent { if (lastTimeRange > -1) { this.setState({ buffer: Math.ceil(this.video.buffered.end(lastTimeRange) / this.video.duration * 100) }); } - } + }; handleVolumeChange = () => { this.setState({ volume: this.video.volume, muted: this.video.muted }); - } + }; handleOpenVideo = () => { this.video.pause(); @@ -519,12 +519,12 @@ class Video extends React.PureComponent { defaultVolume: this.state.volume, componentIndex: this.props.componentIndex, }); - } + }; handleCloseVideo = () => { this.video.pause(); this.props.onCloseVideo(); - } + }; getFrameRate () { if (this.props.frameRate && isNaN(this.props.frameRate)) { @@ -553,7 +553,7 @@ class Video extends React.PureComponent { playerStyle.height = height; } else if (inline) { - return (
); + return (
); } let preload; diff --git a/app/javascript/flavours/glitch/middleware/errors.js b/app/javascript/flavours/glitch/middleware/errors.js index ade529a4e..3639a5951 100644 --- a/app/javascript/flavours/glitch/middleware/errors.js +++ b/app/javascript/flavours/glitch/middleware/errors.js @@ -14,4 +14,4 @@ export default function errorsMiddleware() { return next(action); }; -}; +} diff --git a/app/javascript/flavours/glitch/middleware/loading_bar.js b/app/javascript/flavours/glitch/middleware/loading_bar.js index a98f1bb2b..da8cc4c7d 100644 --- a/app/javascript/flavours/glitch/middleware/loading_bar.js +++ b/app/javascript/flavours/glitch/middleware/loading_bar.js @@ -22,4 +22,4 @@ export default function loadingBarMiddleware(config = {}) { return next(action); }; -}; +} diff --git a/app/javascript/flavours/glitch/middleware/sounds.js b/app/javascript/flavours/glitch/middleware/sounds.js index 9f1bc02b9..7f2388983 100644 --- a/app/javascript/flavours/glitch/middleware/sounds.js +++ b/app/javascript/flavours/glitch/middleware/sounds.js @@ -43,4 +43,4 @@ export default function soundsMiddleware() { return next(action); }; -}; +} diff --git a/app/javascript/flavours/glitch/reducers/accounts.js b/app/javascript/flavours/glitch/reducers/accounts.js index e02a5592e..07f45f98b 100644 --- a/app/javascript/flavours/glitch/reducers/accounts.js +++ b/app/javascript/flavours/glitch/reducers/accounts.js @@ -35,4 +35,4 @@ export default function accounts(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/accounts_counters.js b/app/javascript/flavours/glitch/reducers/accounts_counters.js index 9ebf72af9..4e1256d1b 100644 --- a/app/javascript/flavours/glitch/reducers/accounts_counters.js +++ b/app/javascript/flavours/glitch/reducers/accounts_counters.js @@ -35,4 +35,4 @@ export default function accountsCounters(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/accounts_map.js b/app/javascript/flavours/glitch/reducers/accounts_map.js index 444bbda19..8412ad4d0 100644 --- a/app/javascript/flavours/glitch/reducers/accounts_map.js +++ b/app/javascript/flavours/glitch/reducers/accounts_map.js @@ -17,4 +17,4 @@ export default function accountsMap(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/alerts.js b/app/javascript/flavours/glitch/reducers/alerts.js index ee3d54ab0..f0a696164 100644 --- a/app/javascript/flavours/glitch/reducers/alerts.js +++ b/app/javascript/flavours/glitch/reducers/alerts.js @@ -23,4 +23,4 @@ export default function alerts(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/announcements.js b/app/javascript/flavours/glitch/reducers/announcements.js index 34e08eac8..b53f93a4a 100644 --- a/app/javascript/flavours/glitch/reducers/announcements.js +++ b/app/javascript/flavours/glitch/reducers/announcements.js @@ -99,4 +99,4 @@ export default function announcementsReducer(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index a69c0f7f2..da38b201f 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -140,7 +140,7 @@ function statusToTextMentions(state, status) { } return set.union(status.get('mentions').filterNot(mention => mention.get('id') === me).map(mention => `@${mention.get('acct')} `)).join(''); -}; +} function apiStatusToTextMentions (state, status) { let set = ImmutableOrderedSet([]); @@ -150,16 +150,16 @@ function apiStatusToTextMentions (state, status) { } return set.union(status.mentions.filter( - mention => mention.id !== me + mention => mention.id !== me, ).map( - mention => `@${mention.acct} ` + mention => `@${mention.acct} `, )).join(''); } function apiStatusToTextHashtags (state, status) { const text = unescapeHTML(status.content); return ImmutableOrderedSet([]).union(recoverHashtags(status.tags, text).map( - (name) => `#${name} ` + (name) => `#${name} `, )).join(''); } @@ -175,7 +175,7 @@ function clearAll(state) { map.set('in_reply_to', null); map.update( 'advanced_options', - map => map.mergeWith(overwrite, state.get('default_advanced_options')) + map => map.mergeWith(overwrite, state.get('default_advanced_options')), ); map.set('privacy', state.get('default_privacy')); map.set('sensitive', state.get('default_sensitive')); @@ -184,7 +184,7 @@ function clearAll(state) { map.set('poll', null); map.set('idempotencyKey', uuid()); }); -}; +} function continueThread (state, status) { return state.withMutations(function (map) { @@ -202,7 +202,7 @@ function continueThread (state, status) { map.set('in_reply_to', status.id); map.update( 'advanced_options', - map => map.merge(new ImmutableMap({ do_not_federate: status.local_only })) + map => map.merge(new ImmutableMap({ do_not_federate: status.local_only })), ); map.set('privacy', status.visibility); map.set('sensitive', false); @@ -233,7 +233,7 @@ function appendMedia(state, media, file) { map.set('sensitive', true); } }); -}; +} function removeMedia(state, mediaId) { const prevSize = state.get('media_attachments').size; @@ -246,7 +246,7 @@ function removeMedia(state, mediaId) { map.set('sensitive', false); } }); -}; +} const insertSuggestion = (state, position, token, completion, path) => { return state.withMutations(map => { @@ -414,7 +414,7 @@ export default function compose(state = initialState, action) { map.set('privacy', privacyPreference(action.status.get('visibility'), state.get('default_privacy'))); map.update( 'advanced_options', - map => map.merge(new ImmutableMap({ do_not_federate: !!action.status.get('local_only') })) + map => map.merge(new ImmutableMap({ do_not_federate: !!action.status.get('local_only') })), ); map.set('focusDate', new Date()); map.set('caretPosition', null); @@ -453,7 +453,7 @@ export default function compose(state = initialState, action) { map.set('poll', null); map.update( 'advanced_options', - map => map.mergeWith(overwrite, state.get('default_advanced_options')) + map => map.mergeWith(overwrite, state.get('default_advanced_options')), ); map.set('idempotencyKey', uuid()); }); @@ -575,7 +575,7 @@ export default function compose(state = initialState, action) { map.set('language', action.status.get('language')); map.update( 'advanced_options', - map => map.merge(new ImmutableMap({ do_not_federate })) + map => map.merge(new ImmutableMap({ do_not_federate })), ); map.set('id', null); @@ -646,4 +646,4 @@ export default function compose(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/contexts.js b/app/javascript/flavours/glitch/reducers/contexts.js index a0fcc4158..aea77ae41 100644 --- a/app/javascript/flavours/glitch/reducers/contexts.js +++ b/app/javascript/flavours/glitch/reducers/contexts.js @@ -67,7 +67,7 @@ const deleteFromContexts = (immutableState, ids) => immutableState.withMutations const filterContexts = (state, relationship, statuses) => { const ownedStatusIds = statuses.filter(status => status.get('account') === relationship.id) - .map(status => status.get('id')); + .map(status => status.get('id')); return deleteFromContexts(state, ownedStatusIds); }; @@ -102,4 +102,4 @@ export default function replies(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/conversations.js b/app/javascript/flavours/glitch/reducers/conversations.js index 4407dcf04..48b70cc33 100644 --- a/app/javascript/flavours/glitch/reducers/conversations.js +++ b/app/javascript/flavours/glitch/reducers/conversations.js @@ -113,4 +113,4 @@ export default function conversations(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/custom_emojis.js b/app/javascript/flavours/glitch/reducers/custom_emojis.js index f490d0db1..7f71ab791 100644 --- a/app/javascript/flavours/glitch/reducers/custom_emojis.js +++ b/app/javascript/flavours/glitch/reducers/custom_emojis.js @@ -12,4 +12,4 @@ export default function custom_emojis(state = initialState, action) { } return state; -}; +} diff --git a/app/javascript/flavours/glitch/reducers/domain_lists.js b/app/javascript/flavours/glitch/reducers/domain_lists.js index eff97fbd6..6bf8cee68 100644 --- a/app/javascript/flavours/glitch/reducers/domain_lists.js +++ b/app/javascript/flavours/glitch/reducers/domain_lists.js @@ -22,4 +22,4 @@ export default function domainLists(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/filters.js b/app/javascript/flavours/glitch/reducers/filters.js index f4f97cd3a..e1f014046 100644 --- a/app/javascript/flavours/glitch/reducers/filters.js +++ b/app/javascript/flavours/glitch/reducers/filters.js @@ -41,4 +41,4 @@ export default function filters(state = ImmutableMap(), action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/height_cache.js b/app/javascript/flavours/glitch/reducers/height_cache.js index 8b05e0b19..660a2d1d7 100644 --- a/app/javascript/flavours/glitch/reducers/height_cache.js +++ b/app/javascript/flavours/glitch/reducers/height_cache.js @@ -20,4 +20,4 @@ export default function statuses(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/list_adder.js b/app/javascript/flavours/glitch/reducers/list_adder.js index b8c1b0e26..b144610a5 100644 --- a/app/javascript/flavours/glitch/reducers/list_adder.js +++ b/app/javascript/flavours/glitch/reducers/list_adder.js @@ -44,4 +44,4 @@ export default function listAdderReducer(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/list_editor.js b/app/javascript/flavours/glitch/reducers/list_editor.js index 5427ac098..6e020dbe6 100644 --- a/app/javascript/flavours/glitch/reducers/list_editor.js +++ b/app/javascript/flavours/glitch/reducers/list_editor.js @@ -54,10 +54,10 @@ export default function listEditorReducer(state = initialState, action) { }); case LIST_CREATE_REQUEST: case LIST_UPDATE_REQUEST: - return state.withMutations(map => { - map.set('isSubmitting', true); - map.set('isChanged', false); - }); + return state.withMutations(map => { + map.set('isSubmitting', true); + map.set('isChanged', false); + }); case LIST_CREATE_FAIL: case LIST_UPDATE_FAIL: return state.set('isSubmitting', false); @@ -93,4 +93,4 @@ export default function listEditorReducer(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/lists.js b/app/javascript/flavours/glitch/reducers/lists.js index f30ffbcbd..ba3e2b3cb 100644 --- a/app/javascript/flavours/glitch/reducers/lists.js +++ b/app/javascript/flavours/glitch/reducers/lists.js @@ -34,4 +34,4 @@ export default function lists(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/local_settings.js b/app/javascript/flavours/glitch/reducers/local_settings.js index 9075146f3..887e0e135 100644 --- a/app/javascript/flavours/glitch/reducers/local_settings.js +++ b/app/javascript/flavours/glitch/reducers/local_settings.js @@ -78,4 +78,4 @@ export default function localSettings(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/markers.js b/app/javascript/flavours/glitch/reducers/markers.js index fb1572ff5..e3d1b1936 100644 --- a/app/javascript/flavours/glitch/reducers/markers.js +++ b/app/javascript/flavours/glitch/reducers/markers.js @@ -22,4 +22,4 @@ export default function markers(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/media_attachments.js b/app/javascript/flavours/glitch/reducers/media_attachments.js index 6e6058576..dfd8ea42d 100644 --- a/app/javascript/flavours/glitch/reducers/media_attachments.js +++ b/app/javascript/flavours/glitch/reducers/media_attachments.js @@ -12,4 +12,4 @@ export default function meta(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/meta.js b/app/javascript/flavours/glitch/reducers/meta.js index b1482777a..9f9b89fc0 100644 --- a/app/javascript/flavours/glitch/reducers/meta.js +++ b/app/javascript/flavours/glitch/reducers/meta.js @@ -15,12 +15,12 @@ export default function meta(state = initialState, action) { case STORE_HYDRATE: return state.merge( action.state.get('meta')) - .set('permissions', action.state.getIn(['role', 'permissions'])) - .set('layout', layoutFromWindow(action.state.getIn(['local_settings', 'layout'])) + .set('permissions', action.state.getIn(['role', 'permissions'])) + .set('layout', layoutFromWindow(action.state.getIn(['local_settings', 'layout'])), ); case APP_LAYOUT_CHANGE: return state.set('layout', action.layout); default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/modal.js b/app/javascript/flavours/glitch/reducers/modal.js index 2ef0aef24..c48117181 100644 --- a/app/javascript/flavours/glitch/reducers/modal.js +++ b/app/javascript/flavours/glitch/reducers/modal.js @@ -36,4 +36,4 @@ export default function modal(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/notifications.js b/app/javascript/flavours/glitch/reducers/notifications.js index 18610e758..d5b1568e9 100644 --- a/app/javascript/flavours/glitch/reducers/notifications.js +++ b/app/javascript/flavours/glitch/reducers/notifications.js @@ -371,4 +371,4 @@ export default function notifications(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/picture_in_picture.js b/app/javascript/flavours/glitch/reducers/picture_in_picture.js index 13a3d1aa2..395c21245 100644 --- a/app/javascript/flavours/glitch/reducers/picture_in_picture.js +++ b/app/javascript/flavours/glitch/reducers/picture_in_picture.js @@ -22,4 +22,4 @@ export default function pictureInPicture(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/pinned_accounts_editor.js b/app/javascript/flavours/glitch/reducers/pinned_accounts_editor.js index 267521bb8..144418d12 100644 --- a/app/javascript/flavours/glitch/reducers/pinned_accounts_editor.js +++ b/app/javascript/flavours/glitch/reducers/pinned_accounts_editor.js @@ -54,4 +54,4 @@ export default function listEditorReducer(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/push_notifications.js b/app/javascript/flavours/glitch/reducers/push_notifications.js index 117fb5167..116c3732f 100644 --- a/app/javascript/flavours/glitch/reducers/push_notifications.js +++ b/app/javascript/flavours/glitch/reducers/push_notifications.js @@ -50,4 +50,4 @@ export default function push_subscriptions(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/relationships.js b/app/javascript/flavours/glitch/reducers/relationships.js index e4b9acea2..b53f0238c 100644 --- a/app/javascript/flavours/glitch/reducers/relationships.js +++ b/app/javascript/flavours/glitch/reducers/relationships.js @@ -82,4 +82,4 @@ export default function relationships(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/search.js b/app/javascript/flavours/glitch/reducers/search.js index 4b8913e96..bc0433d1f 100644 --- a/app/javascript/flavours/glitch/reducers/search.js +++ b/app/javascript/flavours/glitch/reducers/search.js @@ -64,4 +64,4 @@ export default function search(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/settings.js b/app/javascript/flavours/glitch/reducers/settings.js index 82927f7cd..e69eee966 100644 --- a/app/javascript/flavours/glitch/reducers/settings.js +++ b/app/javascript/flavours/glitch/reducers/settings.js @@ -176,4 +176,4 @@ export default function settings(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/status_lists.js b/app/javascript/flavours/glitch/reducers/status_lists.js index 7ac0dab47..a279d3d34 100644 --- a/app/javascript/flavours/glitch/reducers/status_lists.js +++ b/app/javascript/flavours/glitch/reducers/status_lists.js @@ -145,4 +145,4 @@ export default function statusLists(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/statuses.js b/app/javascript/flavours/glitch/reducers/statuses.js index f0c4c804b..ca220c54d 100644 --- a/app/javascript/flavours/glitch/reducers/statuses.js +++ b/app/javascript/flavours/glitch/reducers/statuses.js @@ -94,4 +94,4 @@ export default function statuses(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/suggestions.js b/app/javascript/flavours/glitch/reducers/suggestions.js index 2bc30d2c6..3c1ea3fa8 100644 --- a/app/javascript/flavours/glitch/reducers/suggestions.js +++ b/app/javascript/flavours/glitch/reducers/suggestions.js @@ -34,4 +34,4 @@ export default function suggestionsReducer(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/tags.js b/app/javascript/flavours/glitch/reducers/tags.js index 266b21177..b280bc4dd 100644 --- a/app/javascript/flavours/glitch/reducers/tags.js +++ b/app/javascript/flavours/glitch/reducers/tags.js @@ -22,4 +22,4 @@ export default function tags(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/timelines.js b/app/javascript/flavours/glitch/reducers/timelines.js index 407293c62..96a6ca961 100644 --- a/app/javascript/flavours/glitch/reducers/timelines.js +++ b/app/javascript/flavours/glitch/reducers/timelines.js @@ -229,4 +229,4 @@ export default function timelines(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/trends.js b/app/javascript/flavours/glitch/reducers/trends.js index e2bac6199..0b8e0882d 100644 --- a/app/javascript/flavours/glitch/reducers/trends.js +++ b/app/javascript/flavours/glitch/reducers/trends.js @@ -43,4 +43,4 @@ export default function trendsReducer(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/user_lists.js b/app/javascript/flavours/glitch/reducers/user_lists.js index 0a75e85c1..9e020fd91 100644 --- a/app/javascript/flavours/glitch/reducers/user_lists.js +++ b/app/javascript/flavours/glitch/reducers/user_lists.js @@ -187,4 +187,4 @@ export default function userLists(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/store/configureStore.js b/app/javascript/flavours/glitch/store/configureStore.js index e18af842f..0e0d45c66 100644 --- a/app/javascript/flavours/glitch/store/configureStore.js +++ b/app/javascript/flavours/glitch/store/configureStore.js @@ -12,4 +12,4 @@ export default function configureStore() { errorsMiddleware(), soundsMiddleware(), ), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f)); -}; +} diff --git a/app/javascript/flavours/glitch/utils/hashtag.js b/app/javascript/flavours/glitch/utils/hashtag.js index 9b663487f..2024a665c 100644 --- a/app/javascript/flavours/glitch/utils/hashtag.js +++ b/app/javascript/flavours/glitch/utils/hashtag.js @@ -1,8 +1,8 @@ export function recoverHashtags (recognizedTags, text) { return recognizedTags.map(tag => { - const re = new RegExp(`(?:^|[^\/\)\w])#(${tag.name})`, 'i'); - const matched_hashtag = text.match(re); - return matched_hashtag ? matched_hashtag[1] : null; - } + const re = new RegExp(`(?:^|[^\/\)\w])#(${tag.name})`, 'i'); + const matched_hashtag = text.match(re); + return matched_hashtag ? matched_hashtag[1] : null; + }, ).filter(x => x !== null); } diff --git a/app/javascript/flavours/glitch/utils/privacy_preference.js b/app/javascript/flavours/glitch/utils/privacy_preference.js index 7781ca7fa..51bdf072d 100644 --- a/app/javascript/flavours/glitch/utils/privacy_preference.js +++ b/app/javascript/flavours/glitch/utils/privacy_preference.js @@ -2,4 +2,4 @@ export const order = ['public', 'unlisted', 'private', 'direct']; export function privacyPreference (a, b) { return order[Math.max(order.indexOf(a), order.indexOf(b), 0)]; -}; +} diff --git a/app/javascript/flavours/glitch/utils/react_helpers.js b/app/javascript/flavours/glitch/utils/react_helpers.js index 082a58e62..ea11acdb6 100644 --- a/app/javascript/flavours/glitch/utils/react_helpers.js +++ b/app/javascript/flavours/glitch/utils/react_helpers.js @@ -7,7 +7,7 @@ export function assignHandlers (target, handlers) { // We just bind each handler to the `target`. const handle = target.handlers = {}; Object.keys(handlers).forEach( - key => handle[key] = handlers[key].bind(target) + key => handle[key] = handlers[key].bind(target), ); } diff --git a/app/javascript/flavours/glitch/uuid.js b/app/javascript/flavours/glitch/uuid.js index be1899305..0d2cfaa77 100644 --- a/app/javascript/flavours/glitch/uuid.js +++ b/app/javascript/flavours/glitch/uuid.js @@ -1,3 +1,3 @@ export default function uuid(a) { return a ? (a^Math.random() * 16 >> a / 4).toString(16) : ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, uuid); -}; +} -- cgit From 81ef21a0c802f1d905f37a2a818544a8b400793c Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Sat, 25 Feb 2023 14:34:32 +0100 Subject: [Glitch] Rename JSX files with proper `.jsx` extension Port 44a7d87cb1f5df953b6c14c16c59e2e4ead1bcb9 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/components/account.js | 186 ----- .../flavours/glitch/components/account.jsx | 186 +++++ .../flavours/glitch/components/admin/Counter.js | 117 --- .../flavours/glitch/components/admin/Counter.jsx | 117 +++ .../flavours/glitch/components/admin/Dimension.js | 93 --- .../flavours/glitch/components/admin/Dimension.jsx | 93 +++ .../components/admin/ReportReasonSelector.js | 159 ---- .../components/admin/ReportReasonSelector.jsx | 159 ++++ .../flavours/glitch/components/admin/Retention.js | 151 ---- .../flavours/glitch/components/admin/Retention.jsx | 151 ++++ .../flavours/glitch/components/admin/Trends.js | 73 -- .../flavours/glitch/components/admin/Trends.jsx | 73 ++ .../flavours/glitch/components/animated_number.js | 76 -- .../flavours/glitch/components/animated_number.jsx | 76 ++ .../flavours/glitch/components/attachment_list.js | 48 -- .../flavours/glitch/components/attachment_list.jsx | 48 ++ .../glitch/components/autosuggest_emoji.js | 42 -- .../glitch/components/autosuggest_emoji.jsx | 42 ++ .../glitch/components/autosuggest_hashtag.js | 42 -- .../glitch/components/autosuggest_hashtag.jsx | 42 ++ .../glitch/components/autosuggest_input.js | 227 ------ .../glitch/components/autosuggest_input.jsx | 227 ++++++ .../glitch/components/autosuggest_textarea.js | 235 ------ .../glitch/components/autosuggest_textarea.jsx | 235 ++++++ .../flavours/glitch/components/avatar.js | 79 -- .../flavours/glitch/components/avatar.jsx | 79 ++ .../flavours/glitch/components/avatar_composite.js | 110 --- .../glitch/components/avatar_composite.jsx | 110 +++ .../flavours/glitch/components/avatar_overlay.js | 37 - .../flavours/glitch/components/avatar_overlay.jsx | 37 + .../flavours/glitch/components/blurhash.js | 65 -- .../flavours/glitch/components/blurhash.jsx | 65 ++ .../flavours/glitch/components/button.js | 52 -- .../flavours/glitch/components/button.jsx | 52 ++ app/javascript/flavours/glitch/components/check.js | 9 - .../flavours/glitch/components/check.jsx | 9 + .../flavours/glitch/components/column.js | 64 -- .../flavours/glitch/components/column.jsx | 64 ++ .../glitch/components/column_back_button.js | 60 -- .../glitch/components/column_back_button.jsx | 60 ++ .../glitch/components/column_back_button_slim.js | 37 - .../glitch/components/column_back_button_slim.jsx | 37 + .../flavours/glitch/components/column_header.js | 220 ------ .../flavours/glitch/components/column_header.jsx | 220 ++++++ .../flavours/glitch/components/common_counter.js | 62 -- .../flavours/glitch/components/common_counter.jsx | 62 ++ .../glitch/components/dismissable_banner.js | 51 -- .../glitch/components/dismissable_banner.jsx | 51 ++ .../flavours/glitch/components/display_name.js | 102 --- .../flavours/glitch/components/display_name.jsx | 102 +++ .../flavours/glitch/components/domain.js | 42 -- .../flavours/glitch/components/domain.jsx | 42 ++ .../flavours/glitch/components/dropdown_menu.js | 335 --------- .../flavours/glitch/components/dropdown_menu.jsx | 335 +++++++++ .../glitch/components/edited_timestamp/index.js | 70 -- .../glitch/components/edited_timestamp/index.jsx | 70 ++ .../flavours/glitch/components/error_boundary.js | 134 ---- .../flavours/glitch/components/error_boundary.jsx | 134 ++++ app/javascript/flavours/glitch/components/gifv.js | 73 -- app/javascript/flavours/glitch/components/gifv.jsx | 73 ++ .../flavours/glitch/components/hashtag.js | 115 --- .../flavours/glitch/components/hashtag.jsx | 115 +++ app/javascript/flavours/glitch/components/icon.js | 21 - app/javascript/flavours/glitch/components/icon.jsx | 21 + .../flavours/glitch/components/icon_button.js | 177 ----- .../flavours/glitch/components/icon_button.jsx | 177 +++++ .../flavours/glitch/components/icon_with_badge.js | 22 - .../flavours/glitch/components/icon_with_badge.jsx | 22 + app/javascript/flavours/glitch/components/image.js | 33 - .../flavours/glitch/components/image.jsx | 33 + .../flavours/glitch/components/inline_account.js | 34 - .../flavours/glitch/components/inline_account.jsx | 34 + .../components/intersection_observer_article.js | 131 ---- .../components/intersection_observer_article.jsx | 131 ++++ app/javascript/flavours/glitch/components/link.js | 97 --- app/javascript/flavours/glitch/components/link.jsx | 97 +++ .../flavours/glitch/components/load_gap.js | 34 - .../flavours/glitch/components/load_gap.jsx | 34 + .../flavours/glitch/components/load_more.js | 27 - .../flavours/glitch/components/load_more.jsx | 27 + .../flavours/glitch/components/load_pending.js | 22 - .../flavours/glitch/components/load_pending.jsx | 22 + .../glitch/components/loading_indicator.js | 32 - .../glitch/components/loading_indicator.jsx | 32 + app/javascript/flavours/glitch/components/logo.js | 10 - app/javascript/flavours/glitch/components/logo.jsx | 10 + .../glitch/components/media_attachments.js | 119 --- .../glitch/components/media_attachments.jsx | 119 +++ .../flavours/glitch/components/media_gallery.js | 404 ---------- .../flavours/glitch/components/media_gallery.jsx | 404 ++++++++++ .../glitch/components/missing_indicator.js | 29 - .../glitch/components/missing_indicator.jsx | 29 + .../flavours/glitch/components/modal_root.js | 161 ---- .../flavours/glitch/components/modal_root.jsx | 161 ++++ .../glitch/components/navigation_portal.js | 35 - .../glitch/components/navigation_portal.jsx | 35 + .../glitch/components/not_signed_in_indicator.js | 12 - .../glitch/components/not_signed_in_indicator.jsx | 12 + .../components/notification_purge_buttons.js | 59 -- .../components/notification_purge_buttons.jsx | 59 ++ .../flavours/glitch/components/permalink.js | 51 -- .../flavours/glitch/components/permalink.jsx | 51 ++ .../components/picture_in_picture_placeholder.js | 69 -- .../components/picture_in_picture_placeholder.jsx | 69 ++ app/javascript/flavours/glitch/components/poll.js | 233 ------ app/javascript/flavours/glitch/components/poll.jsx | 233 ++++++ .../flavours/glitch/components/radio_button.js | 35 - .../flavours/glitch/components/radio_button.jsx | 35 + .../glitch/components/regeneration_indicator.js | 18 - .../glitch/components/regeneration_indicator.jsx | 18 + .../glitch/components/relative_timestamp.js | 199 ----- .../glitch/components/relative_timestamp.jsx | 199 +++++ .../flavours/glitch/components/scrollable_list.js | 354 --------- .../flavours/glitch/components/scrollable_list.jsx | 354 +++++++++ .../flavours/glitch/components/server_banner.js | 93 --- .../flavours/glitch/components/server_banner.jsx | 93 +++ .../flavours/glitch/components/setting_text.js | 34 - .../flavours/glitch/components/setting_text.jsx | 34 + .../flavours/glitch/components/short_number.js | 117 --- .../flavours/glitch/components/short_number.jsx | 117 +++ .../flavours/glitch/components/skeleton.js | 11 - .../flavours/glitch/components/skeleton.jsx | 11 + .../flavours/glitch/components/spoilers.js | 52 -- .../flavours/glitch/components/spoilers.jsx | 52 ++ .../flavours/glitch/components/status.js | 829 --------------------- .../flavours/glitch/components/status.jsx | 829 +++++++++++++++++++++ .../glitch/components/status_action_bar.js | 341 --------- .../glitch/components/status_action_bar.jsx | 341 +++++++++ .../flavours/glitch/components/status_content.js | 461 ------------ .../flavours/glitch/components/status_content.jsx | 461 ++++++++++++ .../flavours/glitch/components/status_header.js | 71 -- .../flavours/glitch/components/status_header.jsx | 71 ++ .../flavours/glitch/components/status_icons.js | 145 ---- .../flavours/glitch/components/status_icons.jsx | 145 ++++ .../flavours/glitch/components/status_list.js | 131 ---- .../flavours/glitch/components/status_list.jsx | 131 ++++ .../flavours/glitch/components/status_prepend.js | 144 ---- .../flavours/glitch/components/status_prepend.jsx | 144 ++++ .../glitch/components/status_visibility_icon.js | 51 -- .../glitch/components/status_visibility_icon.jsx | 51 ++ .../flavours/glitch/components/timeline_hint.js | 18 - .../flavours/glitch/components/timeline_hint.jsx | 18 + .../glitch/containers/account_container.js | 72 -- .../glitch/containers/account_container.jsx | 72 ++ .../flavours/glitch/containers/admin_component.js | 26 - .../flavours/glitch/containers/admin_component.jsx | 26 + .../glitch/containers/compose_container.js | 41 - .../glitch/containers/compose_container.jsx | 41 + .../flavours/glitch/containers/domain_container.js | 33 - .../glitch/containers/domain_container.jsx | 33 + .../flavours/glitch/containers/mastodon.js | 102 --- .../flavours/glitch/containers/mastodon.jsx | 102 +++ .../flavours/glitch/containers/media_container.js | 121 --- .../flavours/glitch/containers/media_container.jsx | 121 +++ .../flavours/glitch/features/about/index.js | 220 ------ .../flavours/glitch/features/about/index.jsx | 220 ++++++ .../features/account/components/account_note.js | 104 --- .../features/account/components/account_note.jsx | 104 +++ .../features/account/components/action_bar.js | 85 --- .../features/account/components/action_bar.jsx | 85 +++ .../features/account/components/featured_tags.js | 53 -- .../features/account/components/featured_tags.jsx | 53 ++ .../account/components/follow_request_note.js | 37 - .../account/components/follow_request_note.jsx | 37 + .../glitch/features/account/components/header.js | 405 ---------- .../glitch/features/account/components/header.jsx | 405 ++++++++++ .../account/components/profile_column_header.js | 33 - .../account/components/profile_column_header.jsx | 33 + .../flavours/glitch/features/account/navigation.js | 52 -- .../glitch/features/account/navigation.jsx | 52 ++ .../account_gallery/components/media_item.js | 146 ---- .../account_gallery/components/media_item.jsx | 146 ++++ .../glitch/features/account_gallery/index.js | 225 ------ .../glitch/features/account_gallery/index.jsx | 225 ++++++ .../features/account_timeline/components/header.js | 158 ---- .../account_timeline/components/header.jsx | 158 ++++ .../components/limited_account_hint.js | 36 - .../components/limited_account_hint.jsx | 36 + .../account_timeline/components/moved_note.js | 51 -- .../account_timeline/components/moved_note.jsx | 51 ++ .../containers/header_container.js | 173 ----- .../containers/header_container.jsx | 173 +++++ .../glitch/features/account_timeline/index.js | 209 ------ .../glitch/features/account_timeline/index.jsx | 209 ++++++ .../flavours/glitch/features/audio/index.js | 575 -------------- .../flavours/glitch/features/audio/index.jsx | 575 ++++++++++++++ .../flavours/glitch/features/blocks/index.js | 79 -- .../flavours/glitch/features/blocks/index.jsx | 79 ++ .../glitch/features/bookmarked_statuses/index.js | 108 --- .../glitch/features/bookmarked_statuses/index.jsx | 108 +++ .../features/closed_registrations_modal/index.js | 75 -- .../features/closed_registrations_modal/index.jsx | 75 ++ .../components/column_settings.js | 41 - .../components/column_settings.jsx | 41 + .../glitch/features/community_timeline/index.js | 164 ---- .../glitch/features/community_timeline/index.jsx | 164 ++++ .../features/compose/components/action_bar.js | 68 -- .../features/compose/components/action_bar.jsx | 68 ++ .../compose/components/autosuggest_account.js | 24 - .../compose/components/autosuggest_account.jsx | 24 + .../compose/components/character_counter.js | 25 - .../compose/components/character_counter.jsx | 25 + .../features/compose/components/compose_form.js | 391 ---------- .../features/compose/components/compose_form.jsx | 391 ++++++++++ .../glitch/features/compose/components/dropdown.js | 243 ------ .../features/compose/components/dropdown.jsx | 243 ++++++ .../features/compose/components/dropdown_menu.js | 199 ----- .../features/compose/components/dropdown_menu.jsx | 199 +++++ .../compose/components/emoji_picker_dropdown.js | 413 ---------- .../compose/components/emoji_picker_dropdown.jsx | 413 ++++++++++ .../glitch/features/compose/components/header.js | 136 ---- .../glitch/features/compose/components/header.jsx | 136 ++++ .../compose/components/language_dropdown.js | 327 -------- .../compose/components/language_dropdown.jsx | 327 ++++++++ .../features/compose/components/navigation_bar.js | 46 -- .../features/compose/components/navigation_bar.jsx | 46 ++ .../glitch/features/compose/components/options.js | 317 -------- .../glitch/features/compose/components/options.jsx | 317 ++++++++ .../features/compose/components/poll_form.js | 170 ----- .../features/compose/components/poll_form.jsx | 170 +++++ .../compose/components/privacy_dropdown.js | 88 --- .../compose/components/privacy_dropdown.jsx | 88 +++ .../features/compose/components/publisher.js | 99 --- .../features/compose/components/publisher.jsx | 99 +++ .../features/compose/components/reply_indicator.js | 82 -- .../compose/components/reply_indicator.jsx | 82 ++ .../glitch/features/compose/components/search.js | 168 ----- .../glitch/features/compose/components/search.jsx | 168 +++++ .../features/compose/components/search_results.js | 141 ---- .../features/compose/components/search_results.jsx | 141 ++++ .../compose/components/text_icon_button.js | 38 - .../compose/components/text_icon_button.jsx | 38 + .../features/compose/components/textarea_icons.js | 60 -- .../features/compose/components/textarea_icons.jsx | 60 ++ .../glitch/features/compose/components/upload.js | 67 -- .../glitch/features/compose/components/upload.jsx | 67 ++ .../features/compose/components/upload_form.js | 34 - .../features/compose/components/upload_form.jsx | 34 + .../features/compose/components/upload_progress.js | 52 -- .../compose/components/upload_progress.jsx | 52 ++ .../glitch/features/compose/components/warning.js | 26 - .../glitch/features/compose/components/warning.jsx | 26 + .../containers/sensitive_button_container.js | 75 -- .../containers/sensitive_button_container.jsx | 75 ++ .../compose/containers/warning_container.js | 68 -- .../compose/containers/warning_container.jsx | 68 ++ .../flavours/glitch/features/compose/index.js | 116 --- .../flavours/glitch/features/compose/index.jsx | 116 +++ .../direct_timeline/components/column_settings.js | 42 -- .../direct_timeline/components/column_settings.jsx | 42 ++ .../direct_timeline/components/conversation.js | 232 ------ .../direct_timeline/components/conversation.jsx | 232 ++++++ .../components/conversations_list.js | 75 -- .../components/conversations_list.jsx | 75 ++ .../glitch/features/direct_timeline/index.js | 156 ---- .../glitch/features/direct_timeline/index.jsx | 156 ++++ .../features/directory/components/account_card.js | 248 ------ .../features/directory/components/account_card.jsx | 248 ++++++ .../flavours/glitch/features/directory/index.js | 178 ----- .../flavours/glitch/features/directory/index.jsx | 178 +++++ .../glitch/features/domain_blocks/index.js | 83 --- .../glitch/features/domain_blocks/index.jsx | 83 +++ .../glitch/features/explore/components/story.js | 51 -- .../glitch/features/explore/components/story.jsx | 51 ++ .../flavours/glitch/features/explore/index.js | 107 --- .../flavours/glitch/features/explore/index.jsx | 107 +++ .../flavours/glitch/features/explore/links.js | 70 -- .../flavours/glitch/features/explore/links.jsx | 70 ++ .../flavours/glitch/features/explore/results.js | 126 ---- .../flavours/glitch/features/explore/results.jsx | 126 ++++ .../flavours/glitch/features/explore/statuses.js | 64 -- .../flavours/glitch/features/explore/statuses.jsx | 64 ++ .../glitch/features/explore/suggestions.js | 56 -- .../glitch/features/explore/suggestions.jsx | 56 ++ .../flavours/glitch/features/explore/tags.js | 62 -- .../flavours/glitch/features/explore/tags.jsx | 62 ++ .../glitch/features/favourited_statuses/index.js | 108 --- .../glitch/features/favourited_statuses/index.jsx | 108 +++ .../flavours/glitch/features/favourites/index.js | 103 --- .../flavours/glitch/features/favourites/index.jsx | 103 +++ .../glitch/features/filters/added_to_filter.js | 102 --- .../glitch/features/filters/added_to_filter.jsx | 102 +++ .../glitch/features/filters/select_filter.js | 192 ----- .../glitch/features/filters/select_filter.jsx | 192 +++++ .../follow_recommendations/components/account.js | 85 --- .../follow_recommendations/components/account.jsx | 85 +++ .../features/follow_recommendations/index.js | 116 --- .../features/follow_recommendations/index.jsx | 116 +++ .../components/account_authorize.js | 49 -- .../components/account_authorize.jsx | 49 ++ .../glitch/features/follow_requests/index.js | 92 --- .../glitch/features/follow_requests/index.jsx | 92 +++ .../glitch/features/followed_tags/index.js | 89 --- .../glitch/features/followed_tags/index.jsx | 89 +++ .../flavours/glitch/features/followers/index.js | 174 ----- .../flavours/glitch/features/followers/index.jsx | 174 +++++ .../flavours/glitch/features/following/index.js | 174 ----- .../flavours/glitch/features/following/index.jsx | 174 +++++ .../glitch/features/generic_not_found/index.js | 11 - .../glitch/features/generic_not_found/index.jsx | 11 + .../getting_started/components/announcements.js | 449 ----------- .../getting_started/components/announcements.jsx | 449 +++++++++++ .../features/getting_started/components/trends.js | 51 -- .../features/getting_started/components/trends.jsx | 51 ++ .../glitch/features/getting_started/index.js | 204 ----- .../glitch/features/getting_started/index.jsx | 204 +++++ .../glitch/features/getting_started_misc/index.js | 69 -- .../glitch/features/getting_started_misc/index.jsx | 69 ++ .../hashtag_timeline/components/column_settings.js | 133 ---- .../components/column_settings.jsx | 133 ++++ .../glitch/features/hashtag_timeline/index.js | 237 ------ .../glitch/features/hashtag_timeline/index.jsx | 237 ++++++ .../home_timeline/components/column_settings.js | 50 -- .../home_timeline/components/column_settings.jsx | 50 ++ .../glitch/features/home_timeline/index.js | 178 ----- .../glitch/features/home_timeline/index.jsx | 178 +++++ .../glitch/features/interaction_modal/index.js | 161 ---- .../glitch/features/interaction_modal/index.jsx | 161 ++++ .../glitch/features/keyboard_shortcuts/index.js | 149 ---- .../glitch/features/keyboard_shortcuts/index.jsx | 149 ++++ .../features/list_adder/components/account.js | 43 -- .../features/list_adder/components/account.jsx | 43 ++ .../glitch/features/list_adder/components/list.js | 69 -- .../glitch/features/list_adder/components/list.jsx | 69 ++ .../flavours/glitch/features/list_adder/index.js | 73 -- .../flavours/glitch/features/list_adder/index.jsx | 73 ++ .../features/list_editor/components/account.js | 56 -- .../features/list_editor/components/account.jsx | 56 ++ .../list_editor/components/edit_list_form.js | 70 -- .../list_editor/components/edit_list_form.jsx | 70 ++ .../features/list_editor/components/search.js | 62 -- .../features/list_editor/components/search.jsx | 62 ++ .../flavours/glitch/features/list_editor/index.js | 79 -- .../flavours/glitch/features/list_editor/index.jsx | 79 ++ .../glitch/features/list_timeline/index.js | 224 ------ .../glitch/features/list_timeline/index.jsx | 224 ++++++ .../features/lists/components/new_list_form.js | 78 -- .../features/lists/components/new_list_form.jsx | 78 ++ .../flavours/glitch/features/lists/index.js | 89 --- .../flavours/glitch/features/lists/index.jsx | 89 +++ .../glitch/features/local_settings/index.js | 65 -- .../glitch/features/local_settings/index.jsx | 65 ++ .../features/local_settings/navigation/index.js | 92 --- .../features/local_settings/navigation/index.jsx | 92 +++ .../local_settings/navigation/item/index.js | 74 -- .../local_settings/navigation/item/index.jsx | 74 ++ .../local_settings/page/deprecated_item/index.js | 83 --- .../local_settings/page/deprecated_item/index.jsx | 83 +++ .../glitch/features/local_settings/page/index.js | 515 ------------- .../glitch/features/local_settings/page/index.jsx | 515 +++++++++++++ .../features/local_settings/page/item/index.js | 119 --- .../features/local_settings/page/item/index.jsx | 119 +++ .../flavours/glitch/features/mutes/index.js | 84 --- .../flavours/glitch/features/mutes/index.jsx | 84 +++ .../notifications/components/admin_report.js | 112 --- .../notifications/components/admin_report.jsx | 112 +++ .../notifications/components/admin_signup.js | 101 --- .../notifications/components/admin_signup.jsx | 101 +++ .../components/clear_column_button.js | 18 - .../components/clear_column_button.jsx | 18 + .../notifications/components/column_settings.js | 203 ----- .../notifications/components/column_settings.jsx | 203 +++++ .../notifications/components/filter_bar.js | 110 --- .../notifications/components/filter_bar.jsx | 110 +++ .../features/notifications/components/follow.js | 101 --- .../features/notifications/components/follow.jsx | 101 +++ .../notifications/components/follow_request.js | 132 ---- .../notifications/components/follow_request.jsx | 132 ++++ .../components/grant_permission_button.js | 19 - .../components/grant_permission_button.jsx | 19 + .../notifications/components/notification.js | 234 ------ .../notifications/components/notification.jsx | 234 ++++++ .../components/notifications_permission_banner.js | 48 -- .../components/notifications_permission_banner.jsx | 48 ++ .../features/notifications/components/overlay.js | 58 -- .../features/notifications/components/overlay.jsx | 58 ++ .../notifications/components/pill_bar_button.js | 41 - .../notifications/components/pill_bar_button.jsx | 41 + .../features/notifications/components/report.js | 62 -- .../features/notifications/components/report.jsx | 62 ++ .../notifications/components/setting_toggle.js | 36 - .../notifications/components/setting_toggle.jsx | 36 + .../glitch/features/notifications/index.js | 382 ---------- .../glitch/features/notifications/index.jsx | 382 ++++++++++ .../picture_in_picture/components/footer.js | 217 ------ .../picture_in_picture/components/footer.jsx | 217 ++++++ .../picture_in_picture/components/header.js | 47 -- .../picture_in_picture/components/header.jsx | 47 ++ .../glitch/features/picture_in_picture/index.js | 88 --- .../glitch/features/picture_in_picture/index.jsx | 88 +++ .../features/pinned_accounts_editor/index.js | 78 -- .../features/pinned_accounts_editor/index.jsx | 78 ++ .../glitch/features/pinned_statuses/index.js | 65 -- .../glitch/features/pinned_statuses/index.jsx | 65 ++ .../glitch/features/privacy_policy/index.js | 61 -- .../glitch/features/privacy_policy/index.jsx | 61 ++ .../public_timeline/components/column_settings.js | 42 -- .../public_timeline/components/column_settings.jsx | 42 ++ .../glitch/features/public_timeline/index.js | 168 ----- .../glitch/features/public_timeline/index.jsx | 168 +++++ .../flavours/glitch/features/reblogs/index.js | 104 --- .../flavours/glitch/features/reblogs/index.jsx | 104 +++ .../flavours/glitch/features/report/category.js | 104 --- .../flavours/glitch/features/report/category.jsx | 104 +++ .../flavours/glitch/features/report/comment.js | 83 --- .../flavours/glitch/features/report/comment.jsx | 83 +++ .../glitch/features/report/components/option.js | 60 -- .../glitch/features/report/components/option.jsx | 60 ++ .../features/report/components/status_check_box.js | 60 -- .../report/components/status_check_box.jsx | 60 ++ .../flavours/glitch/features/report/rules.js | 64 -- .../flavours/glitch/features/report/rules.jsx | 64 ++ .../flavours/glitch/features/report/statuses.js | 61 -- .../flavours/glitch/features/report/statuses.jsx | 61 ++ .../flavours/glitch/features/report/thanks.js | 84 --- .../flavours/glitch/features/report/thanks.jsx | 84 +++ .../glitch/features/standalone/compose/index.js | 20 - .../glitch/features/standalone/compose/index.jsx | 20 + .../features/status/components/action_bar.js | 230 ------ .../features/status/components/action_bar.jsx | 230 ++++++ .../glitch/features/status/components/card.js | 281 ------- .../glitch/features/status/components/card.jsx | 281 +++++++ .../features/status/components/detailed_status.js | 335 --------- .../features/status/components/detailed_status.jsx | 335 +++++++++ .../flavours/glitch/features/status/index.js | 726 ------------------ .../flavours/glitch/features/status/index.jsx | 726 ++++++++++++++++++ .../features/subscribed_languages_modal/index.js | 125 ---- .../features/subscribed_languages_modal/index.jsx | 125 ++++ .../glitch/features/ui/components/actions_modal.js | 91 --- .../features/ui/components/actions_modal.jsx | 91 +++ .../glitch/features/ui/components/audio_modal.js | 58 -- .../glitch/features/ui/components/audio_modal.jsx | 58 ++ .../glitch/features/ui/components/block_modal.js | 103 --- .../glitch/features/ui/components/block_modal.jsx | 103 +++ .../glitch/features/ui/components/boost_modal.js | 139 ---- .../glitch/features/ui/components/boost_modal.jsx | 139 ++++ .../glitch/features/ui/components/bundle.js | 107 --- .../glitch/features/ui/components/bundle.jsx | 107 +++ .../features/ui/components/bundle_column_error.js | 162 ---- .../features/ui/components/bundle_column_error.jsx | 162 ++++ .../features/ui/components/bundle_modal_error.js | 53 -- .../features/ui/components/bundle_modal_error.jsx | 53 ++ .../glitch/features/ui/components/column.js | 75 -- .../glitch/features/ui/components/column.jsx | 75 ++ .../glitch/features/ui/components/column_header.js | 38 - .../features/ui/components/column_header.jsx | 38 + .../glitch/features/ui/components/column_link.js | 55 -- .../glitch/features/ui/components/column_link.jsx | 55 ++ .../features/ui/components/column_loading.js | 32 - .../features/ui/components/column_loading.jsx | 32 + .../features/ui/components/column_subheading.js | 16 - .../features/ui/components/column_subheading.jsx | 16 + .../glitch/features/ui/components/columns_area.js | 183 ----- .../glitch/features/ui/components/columns_area.jsx | 183 +++++ .../ui/components/compare_history_modal.js | 99 --- .../ui/components/compare_history_modal.jsx | 99 +++ .../glitch/features/ui/components/compose_panel.js | 58 -- .../features/ui/components/compose_panel.jsx | 58 ++ .../features/ui/components/confirmation_modal.js | 88 --- .../features/ui/components/confirmation_modal.jsx | 88 +++ .../ui/components/deprecated_settings_modal.js | 86 --- .../ui/components/deprecated_settings_modal.jsx | 86 +++ .../ui/components/disabled_account_banner.js | 92 --- .../ui/components/disabled_account_banner.jsx | 92 +++ .../glitch/features/ui/components/doodle_modal.js | 614 --------------- .../glitch/features/ui/components/doodle_modal.jsx | 614 +++++++++++++++ .../features/ui/components/drawer_loading.js | 11 - .../features/ui/components/drawer_loading.jsx | 11 + .../glitch/features/ui/components/embed_modal.js | 97 --- .../glitch/features/ui/components/embed_modal.jsx | 97 +++ .../features/ui/components/favourite_modal.js | 101 --- .../features/ui/components/favourite_modal.jsx | 101 +++ .../glitch/features/ui/components/filter_modal.js | 134 ---- .../glitch/features/ui/components/filter_modal.jsx | 134 ++++ .../features/ui/components/focal_point_modal.js | 418 ----------- .../features/ui/components/focal_point_modal.jsx | 418 +++++++++++ .../ui/components/follow_requests_column_link.js | 51 -- .../ui/components/follow_requests_column_link.jsx | 51 ++ .../glitch/features/ui/components/header.js | 88 --- .../glitch/features/ui/components/header.jsx | 88 +++ .../glitch/features/ui/components/image_loader.js | 168 ----- .../glitch/features/ui/components/image_loader.jsx | 168 +++++ .../glitch/features/ui/components/image_modal.js | 59 -- .../glitch/features/ui/components/image_modal.jsx | 59 ++ .../glitch/features/ui/components/link_footer.js | 102 --- .../glitch/features/ui/components/link_footer.jsx | 102 +++ .../glitch/features/ui/components/list_panel.js | 55 -- .../glitch/features/ui/components/list_panel.jsx | 55 ++ .../glitch/features/ui/components/media_modal.js | 252 ------- .../glitch/features/ui/components/media_modal.jsx | 252 +++++++ .../glitch/features/ui/components/modal_loading.js | 20 - .../features/ui/components/modal_loading.jsx | 20 + .../glitch/features/ui/components/modal_root.js | 144 ---- .../glitch/features/ui/components/modal_root.jsx | 144 ++++ .../glitch/features/ui/components/mute_modal.js | 140 ---- .../glitch/features/ui/components/mute_modal.jsx | 140 ++++ .../features/ui/components/navigation_panel.js | 104 --- .../features/ui/components/navigation_panel.jsx | 104 +++ .../features/ui/components/onboarding_modal.js | 321 -------- .../features/ui/components/onboarding_modal.jsx | 321 ++++++++ .../glitch/features/ui/components/report_modal.js | 221 ------ .../glitch/features/ui/components/report_modal.jsx | 221 ++++++ .../features/ui/components/sign_in_banner.js | 40 - .../features/ui/components/sign_in_banner.jsx | 40 + .../glitch/features/ui/components/upload_area.js | 52 -- .../glitch/features/ui/components/upload_area.jsx | 52 ++ .../glitch/features/ui/components/video_modal.js | 66 -- .../glitch/features/ui/components/video_modal.jsx | 66 ++ .../features/ui/components/zoomable_image.js | 450 ----------- .../features/ui/components/zoomable_image.jsx | 450 +++++++++++ .../flavours/glitch/features/ui/index.js | 684 ----------------- .../flavours/glitch/features/ui/index.jsx | 684 +++++++++++++++++ .../features/ui/util/react_router_helpers.js | 101 --- .../features/ui/util/react_router_helpers.jsx | 101 +++ .../glitch/features/ui/util/reduced_motion.js | 44 -- .../glitch/features/ui/util/reduced_motion.jsx | 44 ++ .../flavours/glitch/features/video/index.js | 673 ----------------- .../flavours/glitch/features/video/index.jsx | 673 +++++++++++++++++ app/javascript/flavours/glitch/main.js | 46 -- app/javascript/flavours/glitch/main.jsx | 46 ++ app/javascript/flavours/glitch/packs/admin.js | 24 - app/javascript/flavours/glitch/packs/admin.jsx | 24 + app/javascript/flavours/glitch/packs/public.js | 224 ------ app/javascript/flavours/glitch/packs/public.jsx | 224 ++++++ app/javascript/flavours/glitch/packs/share.js | 23 - app/javascript/flavours/glitch/packs/share.jsx | 23 + app/javascript/flavours/glitch/theme.yml | 12 +- app/javascript/flavours/glitch/utils/icons.js | 15 - app/javascript/flavours/glitch/utils/icons.jsx | 15 + 529 files changed, 33223 insertions(+), 33223 deletions(-) delete mode 100644 app/javascript/flavours/glitch/components/account.js create mode 100644 app/javascript/flavours/glitch/components/account.jsx delete mode 100644 app/javascript/flavours/glitch/components/admin/Counter.js create mode 100644 app/javascript/flavours/glitch/components/admin/Counter.jsx delete mode 100644 app/javascript/flavours/glitch/components/admin/Dimension.js create mode 100644 app/javascript/flavours/glitch/components/admin/Dimension.jsx delete mode 100644 app/javascript/flavours/glitch/components/admin/ReportReasonSelector.js create mode 100644 app/javascript/flavours/glitch/components/admin/ReportReasonSelector.jsx delete mode 100644 app/javascript/flavours/glitch/components/admin/Retention.js create mode 100644 app/javascript/flavours/glitch/components/admin/Retention.jsx delete mode 100644 app/javascript/flavours/glitch/components/admin/Trends.js create mode 100644 app/javascript/flavours/glitch/components/admin/Trends.jsx delete mode 100644 app/javascript/flavours/glitch/components/animated_number.js create mode 100644 app/javascript/flavours/glitch/components/animated_number.jsx delete mode 100644 app/javascript/flavours/glitch/components/attachment_list.js create mode 100644 app/javascript/flavours/glitch/components/attachment_list.jsx delete mode 100644 app/javascript/flavours/glitch/components/autosuggest_emoji.js create mode 100644 app/javascript/flavours/glitch/components/autosuggest_emoji.jsx delete mode 100644 app/javascript/flavours/glitch/components/autosuggest_hashtag.js create mode 100644 app/javascript/flavours/glitch/components/autosuggest_hashtag.jsx delete mode 100644 app/javascript/flavours/glitch/components/autosuggest_input.js create mode 100644 app/javascript/flavours/glitch/components/autosuggest_input.jsx delete mode 100644 app/javascript/flavours/glitch/components/autosuggest_textarea.js create mode 100644 app/javascript/flavours/glitch/components/autosuggest_textarea.jsx delete mode 100644 app/javascript/flavours/glitch/components/avatar.js create mode 100644 app/javascript/flavours/glitch/components/avatar.jsx delete mode 100644 app/javascript/flavours/glitch/components/avatar_composite.js create mode 100644 app/javascript/flavours/glitch/components/avatar_composite.jsx delete mode 100644 app/javascript/flavours/glitch/components/avatar_overlay.js create mode 100644 app/javascript/flavours/glitch/components/avatar_overlay.jsx delete mode 100644 app/javascript/flavours/glitch/components/blurhash.js create mode 100644 app/javascript/flavours/glitch/components/blurhash.jsx delete mode 100644 app/javascript/flavours/glitch/components/button.js create mode 100644 app/javascript/flavours/glitch/components/button.jsx delete mode 100644 app/javascript/flavours/glitch/components/check.js create mode 100644 app/javascript/flavours/glitch/components/check.jsx delete mode 100644 app/javascript/flavours/glitch/components/column.js create mode 100644 app/javascript/flavours/glitch/components/column.jsx delete mode 100644 app/javascript/flavours/glitch/components/column_back_button.js create mode 100644 app/javascript/flavours/glitch/components/column_back_button.jsx delete mode 100644 app/javascript/flavours/glitch/components/column_back_button_slim.js create mode 100644 app/javascript/flavours/glitch/components/column_back_button_slim.jsx delete mode 100644 app/javascript/flavours/glitch/components/column_header.js create mode 100644 app/javascript/flavours/glitch/components/column_header.jsx delete mode 100644 app/javascript/flavours/glitch/components/common_counter.js create mode 100644 app/javascript/flavours/glitch/components/common_counter.jsx delete mode 100644 app/javascript/flavours/glitch/components/dismissable_banner.js create mode 100644 app/javascript/flavours/glitch/components/dismissable_banner.jsx delete mode 100644 app/javascript/flavours/glitch/components/display_name.js create mode 100644 app/javascript/flavours/glitch/components/display_name.jsx delete mode 100644 app/javascript/flavours/glitch/components/domain.js create mode 100644 app/javascript/flavours/glitch/components/domain.jsx delete mode 100644 app/javascript/flavours/glitch/components/dropdown_menu.js create mode 100644 app/javascript/flavours/glitch/components/dropdown_menu.jsx delete mode 100644 app/javascript/flavours/glitch/components/edited_timestamp/index.js create mode 100644 app/javascript/flavours/glitch/components/edited_timestamp/index.jsx delete mode 100644 app/javascript/flavours/glitch/components/error_boundary.js create mode 100644 app/javascript/flavours/glitch/components/error_boundary.jsx delete mode 100644 app/javascript/flavours/glitch/components/gifv.js create mode 100644 app/javascript/flavours/glitch/components/gifv.jsx delete mode 100644 app/javascript/flavours/glitch/components/hashtag.js create mode 100644 app/javascript/flavours/glitch/components/hashtag.jsx delete mode 100644 app/javascript/flavours/glitch/components/icon.js create mode 100644 app/javascript/flavours/glitch/components/icon.jsx delete mode 100644 app/javascript/flavours/glitch/components/icon_button.js create mode 100644 app/javascript/flavours/glitch/components/icon_button.jsx delete mode 100644 app/javascript/flavours/glitch/components/icon_with_badge.js create mode 100644 app/javascript/flavours/glitch/components/icon_with_badge.jsx delete mode 100644 app/javascript/flavours/glitch/components/image.js create mode 100644 app/javascript/flavours/glitch/components/image.jsx delete mode 100644 app/javascript/flavours/glitch/components/inline_account.js create mode 100644 app/javascript/flavours/glitch/components/inline_account.jsx delete mode 100644 app/javascript/flavours/glitch/components/intersection_observer_article.js create mode 100644 app/javascript/flavours/glitch/components/intersection_observer_article.jsx delete mode 100644 app/javascript/flavours/glitch/components/link.js create mode 100644 app/javascript/flavours/glitch/components/link.jsx delete mode 100644 app/javascript/flavours/glitch/components/load_gap.js create mode 100644 app/javascript/flavours/glitch/components/load_gap.jsx delete mode 100644 app/javascript/flavours/glitch/components/load_more.js create mode 100644 app/javascript/flavours/glitch/components/load_more.jsx delete mode 100644 app/javascript/flavours/glitch/components/load_pending.js create mode 100644 app/javascript/flavours/glitch/components/load_pending.jsx delete mode 100644 app/javascript/flavours/glitch/components/loading_indicator.js create mode 100644 app/javascript/flavours/glitch/components/loading_indicator.jsx delete mode 100644 app/javascript/flavours/glitch/components/logo.js create mode 100644 app/javascript/flavours/glitch/components/logo.jsx delete mode 100644 app/javascript/flavours/glitch/components/media_attachments.js create mode 100644 app/javascript/flavours/glitch/components/media_attachments.jsx delete mode 100644 app/javascript/flavours/glitch/components/media_gallery.js create mode 100644 app/javascript/flavours/glitch/components/media_gallery.jsx delete mode 100644 app/javascript/flavours/glitch/components/missing_indicator.js create mode 100644 app/javascript/flavours/glitch/components/missing_indicator.jsx delete mode 100644 app/javascript/flavours/glitch/components/modal_root.js create mode 100644 app/javascript/flavours/glitch/components/modal_root.jsx delete mode 100644 app/javascript/flavours/glitch/components/navigation_portal.js create mode 100644 app/javascript/flavours/glitch/components/navigation_portal.jsx delete mode 100644 app/javascript/flavours/glitch/components/not_signed_in_indicator.js create mode 100644 app/javascript/flavours/glitch/components/not_signed_in_indicator.jsx delete mode 100644 app/javascript/flavours/glitch/components/notification_purge_buttons.js create mode 100644 app/javascript/flavours/glitch/components/notification_purge_buttons.jsx delete mode 100644 app/javascript/flavours/glitch/components/permalink.js create mode 100644 app/javascript/flavours/glitch/components/permalink.jsx delete mode 100644 app/javascript/flavours/glitch/components/picture_in_picture_placeholder.js create mode 100644 app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx delete mode 100644 app/javascript/flavours/glitch/components/poll.js create mode 100644 app/javascript/flavours/glitch/components/poll.jsx delete mode 100644 app/javascript/flavours/glitch/components/radio_button.js create mode 100644 app/javascript/flavours/glitch/components/radio_button.jsx delete mode 100644 app/javascript/flavours/glitch/components/regeneration_indicator.js create mode 100644 app/javascript/flavours/glitch/components/regeneration_indicator.jsx delete mode 100644 app/javascript/flavours/glitch/components/relative_timestamp.js create mode 100644 app/javascript/flavours/glitch/components/relative_timestamp.jsx delete mode 100644 app/javascript/flavours/glitch/components/scrollable_list.js create mode 100644 app/javascript/flavours/glitch/components/scrollable_list.jsx delete mode 100644 app/javascript/flavours/glitch/components/server_banner.js create mode 100644 app/javascript/flavours/glitch/components/server_banner.jsx delete mode 100644 app/javascript/flavours/glitch/components/setting_text.js create mode 100644 app/javascript/flavours/glitch/components/setting_text.jsx delete mode 100644 app/javascript/flavours/glitch/components/short_number.js create mode 100644 app/javascript/flavours/glitch/components/short_number.jsx delete mode 100644 app/javascript/flavours/glitch/components/skeleton.js create mode 100644 app/javascript/flavours/glitch/components/skeleton.jsx delete mode 100644 app/javascript/flavours/glitch/components/spoilers.js create mode 100644 app/javascript/flavours/glitch/components/spoilers.jsx delete mode 100644 app/javascript/flavours/glitch/components/status.js create mode 100644 app/javascript/flavours/glitch/components/status.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_action_bar.js create mode 100644 app/javascript/flavours/glitch/components/status_action_bar.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_content.js create mode 100644 app/javascript/flavours/glitch/components/status_content.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_header.js create mode 100644 app/javascript/flavours/glitch/components/status_header.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_icons.js create mode 100644 app/javascript/flavours/glitch/components/status_icons.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_list.js create mode 100644 app/javascript/flavours/glitch/components/status_list.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_prepend.js create mode 100644 app/javascript/flavours/glitch/components/status_prepend.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_visibility_icon.js create mode 100644 app/javascript/flavours/glitch/components/status_visibility_icon.jsx delete mode 100644 app/javascript/flavours/glitch/components/timeline_hint.js create mode 100644 app/javascript/flavours/glitch/components/timeline_hint.jsx delete mode 100644 app/javascript/flavours/glitch/containers/account_container.js create mode 100644 app/javascript/flavours/glitch/containers/account_container.jsx delete mode 100644 app/javascript/flavours/glitch/containers/admin_component.js create mode 100644 app/javascript/flavours/glitch/containers/admin_component.jsx delete mode 100644 app/javascript/flavours/glitch/containers/compose_container.js create mode 100644 app/javascript/flavours/glitch/containers/compose_container.jsx delete mode 100644 app/javascript/flavours/glitch/containers/domain_container.js create mode 100644 app/javascript/flavours/glitch/containers/domain_container.jsx delete mode 100644 app/javascript/flavours/glitch/containers/mastodon.js create mode 100644 app/javascript/flavours/glitch/containers/mastodon.jsx delete mode 100644 app/javascript/flavours/glitch/containers/media_container.js create mode 100644 app/javascript/flavours/glitch/containers/media_container.jsx delete mode 100644 app/javascript/flavours/glitch/features/about/index.js create mode 100644 app/javascript/flavours/glitch/features/about/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/components/account_note.js create mode 100644 app/javascript/flavours/glitch/features/account/components/account_note.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/components/action_bar.js create mode 100644 app/javascript/flavours/glitch/features/account/components/action_bar.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/components/featured_tags.js create mode 100644 app/javascript/flavours/glitch/features/account/components/featured_tags.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/components/follow_request_note.js create mode 100644 app/javascript/flavours/glitch/features/account/components/follow_request_note.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/components/header.js create mode 100644 app/javascript/flavours/glitch/features/account/components/header.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/components/profile_column_header.js create mode 100644 app/javascript/flavours/glitch/features/account/components/profile_column_header.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/navigation.js create mode 100644 app/javascript/flavours/glitch/features/account/navigation.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_gallery/components/media_item.js create mode 100644 app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_gallery/index.js create mode 100644 app/javascript/flavours/glitch/features/account_gallery/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/header.js create mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/header.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.js create mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/moved_note.js create mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/moved_note.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js create mode 100644 app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/account_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/audio/index.js create mode 100644 app/javascript/flavours/glitch/features/audio/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/blocks/index.js create mode 100644 app/javascript/flavours/glitch/features/blocks/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/bookmarked_statuses/index.js create mode 100644 app/javascript/flavours/glitch/features/bookmarked_statuses/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/closed_registrations_modal/index.js create mode 100644 app/javascript/flavours/glitch/features/closed_registrations_modal/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/community_timeline/components/column_settings.js create mode 100644 app/javascript/flavours/glitch/features/community_timeline/components/column_settings.jsx delete mode 100644 app/javascript/flavours/glitch/features/community_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/community_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/action_bar.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/action_bar.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/autosuggest_account.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/character_counter.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/character_counter.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/compose_form.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/compose_form.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/dropdown.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/dropdown.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/dropdown_menu.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/dropdown_menu.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/header.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/header.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/language_dropdown.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/language_dropdown.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/navigation_bar.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/options.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/options.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/poll_form.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/poll_form.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/publisher.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/publisher.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/reply_indicator.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/search.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/search.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/search_results.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/search_results.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/text_icon_button.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/text_icon_button.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/textarea_icons.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/textarea_icons.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/upload.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/upload.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/upload_form.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/upload_form.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/upload_progress.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/upload_progress.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/warning.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/warning.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.js create mode 100644 app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/containers/warning_container.js create mode 100644 app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/index.js create mode 100644 app/javascript/flavours/glitch/features/compose/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.js create mode 100644 app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.jsx delete mode 100644 app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js create mode 100644 app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx delete mode 100644 app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.js create mode 100644 app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.jsx delete mode 100644 app/javascript/flavours/glitch/features/direct_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/direct_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/directory/components/account_card.js create mode 100644 app/javascript/flavours/glitch/features/directory/components/account_card.jsx delete mode 100644 app/javascript/flavours/glitch/features/directory/index.js create mode 100644 app/javascript/flavours/glitch/features/directory/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/domain_blocks/index.js create mode 100644 app/javascript/flavours/glitch/features/domain_blocks/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/components/story.js create mode 100644 app/javascript/flavours/glitch/features/explore/components/story.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/index.js create mode 100644 app/javascript/flavours/glitch/features/explore/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/links.js create mode 100644 app/javascript/flavours/glitch/features/explore/links.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/results.js create mode 100644 app/javascript/flavours/glitch/features/explore/results.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/statuses.js create mode 100644 app/javascript/flavours/glitch/features/explore/statuses.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/suggestions.js create mode 100644 app/javascript/flavours/glitch/features/explore/suggestions.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/tags.js create mode 100644 app/javascript/flavours/glitch/features/explore/tags.jsx delete mode 100644 app/javascript/flavours/glitch/features/favourited_statuses/index.js create mode 100644 app/javascript/flavours/glitch/features/favourited_statuses/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/favourites/index.js create mode 100644 app/javascript/flavours/glitch/features/favourites/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/filters/added_to_filter.js create mode 100644 app/javascript/flavours/glitch/features/filters/added_to_filter.jsx delete mode 100644 app/javascript/flavours/glitch/features/filters/select_filter.js create mode 100644 app/javascript/flavours/glitch/features/filters/select_filter.jsx delete mode 100644 app/javascript/flavours/glitch/features/follow_recommendations/components/account.js create mode 100644 app/javascript/flavours/glitch/features/follow_recommendations/components/account.jsx delete mode 100644 app/javascript/flavours/glitch/features/follow_recommendations/index.js create mode 100644 app/javascript/flavours/glitch/features/follow_recommendations/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.js create mode 100644 app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx delete mode 100644 app/javascript/flavours/glitch/features/follow_requests/index.js create mode 100644 app/javascript/flavours/glitch/features/follow_requests/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/followed_tags/index.js create mode 100644 app/javascript/flavours/glitch/features/followed_tags/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/followers/index.js create mode 100644 app/javascript/flavours/glitch/features/followers/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/following/index.js create mode 100644 app/javascript/flavours/glitch/features/following/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/generic_not_found/index.js create mode 100644 app/javascript/flavours/glitch/features/generic_not_found/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/getting_started/components/announcements.js create mode 100644 app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx delete mode 100644 app/javascript/flavours/glitch/features/getting_started/components/trends.js create mode 100644 app/javascript/flavours/glitch/features/getting_started/components/trends.jsx delete mode 100644 app/javascript/flavours/glitch/features/getting_started/index.js create mode 100644 app/javascript/flavours/glitch/features/getting_started/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/getting_started_misc/index.js create mode 100644 app/javascript/flavours/glitch/features/getting_started_misc/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.js create mode 100644 app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.jsx delete mode 100644 app/javascript/flavours/glitch/features/hashtag_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/hashtag_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/home_timeline/components/column_settings.js create mode 100644 app/javascript/flavours/glitch/features/home_timeline/components/column_settings.jsx delete mode 100644 app/javascript/flavours/glitch/features/home_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/home_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/interaction_modal/index.js create mode 100644 app/javascript/flavours/glitch/features/interaction_modal/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js create mode 100644 app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_adder/components/account.js create mode 100644 app/javascript/flavours/glitch/features/list_adder/components/account.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_adder/components/list.js create mode 100644 app/javascript/flavours/glitch/features/list_adder/components/list.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_adder/index.js create mode 100644 app/javascript/flavours/glitch/features/list_adder/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_editor/components/account.js create mode 100644 app/javascript/flavours/glitch/features/list_editor/components/account.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.js create mode 100644 app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_editor/components/search.js create mode 100644 app/javascript/flavours/glitch/features/list_editor/components/search.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_editor/index.js create mode 100644 app/javascript/flavours/glitch/features/list_editor/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/list_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/lists/components/new_list_form.js create mode 100644 app/javascript/flavours/glitch/features/lists/components/new_list_form.jsx delete mode 100644 app/javascript/flavours/glitch/features/lists/index.js create mode 100644 app/javascript/flavours/glitch/features/lists/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/local_settings/index.js create mode 100644 app/javascript/flavours/glitch/features/local_settings/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/local_settings/navigation/index.js create mode 100644 app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/local_settings/navigation/item/index.js create mode 100644 app/javascript/flavours/glitch/features/local_settings/navigation/item/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/local_settings/page/deprecated_item/index.js create mode 100644 app/javascript/flavours/glitch/features/local_settings/page/deprecated_item/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/local_settings/page/index.js create mode 100644 app/javascript/flavours/glitch/features/local_settings/page/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/local_settings/page/item/index.js create mode 100644 app/javascript/flavours/glitch/features/local_settings/page/item/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/mutes/index.js create mode 100644 app/javascript/flavours/glitch/features/mutes/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/admin_report.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/admin_signup.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/admin_signup.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/clear_column_button.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/column_settings.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/column_settings.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/filter_bar.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/follow.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/follow.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/follow_request.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/follow_request.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/grant_permission_button.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/grant_permission_button.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/notification.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/notification.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/overlay.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/overlay.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/report.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/report.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/setting_toggle.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/index.js create mode 100644 app/javascript/flavours/glitch/features/notifications/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js create mode 100644 app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx delete mode 100644 app/javascript/flavours/glitch/features/picture_in_picture/components/header.js create mode 100644 app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx delete mode 100644 app/javascript/flavours/glitch/features/picture_in_picture/index.js create mode 100644 app/javascript/flavours/glitch/features/picture_in_picture/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/pinned_accounts_editor/index.js create mode 100644 app/javascript/flavours/glitch/features/pinned_accounts_editor/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/pinned_statuses/index.js create mode 100644 app/javascript/flavours/glitch/features/pinned_statuses/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/privacy_policy/index.js create mode 100644 app/javascript/flavours/glitch/features/privacy_policy/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/public_timeline/components/column_settings.js create mode 100644 app/javascript/flavours/glitch/features/public_timeline/components/column_settings.jsx delete mode 100644 app/javascript/flavours/glitch/features/public_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/public_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/reblogs/index.js create mode 100644 app/javascript/flavours/glitch/features/reblogs/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/category.js create mode 100644 app/javascript/flavours/glitch/features/report/category.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/comment.js create mode 100644 app/javascript/flavours/glitch/features/report/comment.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/components/option.js create mode 100644 app/javascript/flavours/glitch/features/report/components/option.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/components/status_check_box.js create mode 100644 app/javascript/flavours/glitch/features/report/components/status_check_box.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/rules.js create mode 100644 app/javascript/flavours/glitch/features/report/rules.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/statuses.js create mode 100644 app/javascript/flavours/glitch/features/report/statuses.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/thanks.js create mode 100644 app/javascript/flavours/glitch/features/report/thanks.jsx delete mode 100644 app/javascript/flavours/glitch/features/standalone/compose/index.js create mode 100644 app/javascript/flavours/glitch/features/standalone/compose/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/status/components/action_bar.js create mode 100644 app/javascript/flavours/glitch/features/status/components/action_bar.jsx delete mode 100644 app/javascript/flavours/glitch/features/status/components/card.js create mode 100644 app/javascript/flavours/glitch/features/status/components/card.jsx delete mode 100644 app/javascript/flavours/glitch/features/status/components/detailed_status.js create mode 100644 app/javascript/flavours/glitch/features/status/components/detailed_status.jsx delete mode 100644 app/javascript/flavours/glitch/features/status/index.js create mode 100644 app/javascript/flavours/glitch/features/status/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js create mode 100644 app/javascript/flavours/glitch/features/subscribed_languages_modal/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/actions_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/actions_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/audio_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/audio_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/block_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/block_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/boost_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/boost_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/bundle.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/bundle.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/bundle_column_error.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/bundle_column_error.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/column.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/column.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/column_header.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/column_header.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/column_link.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/column_link.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/column_loading.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/column_loading.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/column_subheading.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/column_subheading.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/columns_area.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/columns_area.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/compare_history_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/compare_history_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/compose_panel.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/compose_panel.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/confirmation_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/disabled_account_banner.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/disabled_account_banner.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/doodle_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/doodle_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/drawer_loading.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/drawer_loading.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/embed_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/embed_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/favourite_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/favourite_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/filter_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/filter_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/follow_requests_column_link.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/follow_requests_column_link.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/header.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/header.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/image_loader.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/image_loader.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/image_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/image_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/link_footer.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/link_footer.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/list_panel.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/list_panel.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/media_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/media_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/modal_loading.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/modal_loading.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/modal_root.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/modal_root.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/mute_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/mute_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/navigation_panel.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/onboarding_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/report_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/report_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/sign_in_banner.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/sign_in_banner.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/upload_area.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/upload_area.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/video_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/video_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/zoomable_image.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/zoomable_image.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/index.js create mode 100644 app/javascript/flavours/glitch/features/ui/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/util/react_router_helpers.js create mode 100644 app/javascript/flavours/glitch/features/ui/util/react_router_helpers.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/util/reduced_motion.js create mode 100644 app/javascript/flavours/glitch/features/ui/util/reduced_motion.jsx delete mode 100644 app/javascript/flavours/glitch/features/video/index.js create mode 100644 app/javascript/flavours/glitch/features/video/index.jsx delete mode 100644 app/javascript/flavours/glitch/main.js create mode 100644 app/javascript/flavours/glitch/main.jsx delete mode 100644 app/javascript/flavours/glitch/packs/admin.js create mode 100644 app/javascript/flavours/glitch/packs/admin.jsx delete mode 100644 app/javascript/flavours/glitch/packs/public.js create mode 100644 app/javascript/flavours/glitch/packs/public.jsx delete mode 100644 app/javascript/flavours/glitch/packs/share.js create mode 100644 app/javascript/flavours/glitch/packs/share.jsx delete mode 100644 app/javascript/flavours/glitch/utils/icons.js create mode 100644 app/javascript/flavours/glitch/utils/icons.jsx (limited to 'app/javascript/flavours/glitch/features/ui/util') diff --git a/app/javascript/flavours/glitch/components/account.js b/app/javascript/flavours/glitch/components/account.js deleted file mode 100644 index 7ce4b65aa..000000000 --- a/app/javascript/flavours/glitch/components/account.js +++ /dev/null @@ -1,186 +0,0 @@ -import React, { Fragment } from 'react'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import PropTypes from 'prop-types'; -import Avatar from './avatar'; -import DisplayName from './display_name'; -import Permalink from './permalink'; -import IconButton from './icon_button'; -import { defineMessages, injectIntl } from 'react-intl'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { me } from 'flavours/glitch/initial_state'; -import RelativeTimestamp from './relative_timestamp'; -import Skeleton from 'flavours/glitch/components/skeleton'; - -const messages = defineMessages({ - follow: { id: 'account.follow', defaultMessage: 'Follow' }, - unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, - requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' }, - unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' }, - unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' }, - mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' }, - unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'Unmute notifications from @{name}' }, - mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' }, - block: { id: 'account.block', defaultMessage: 'Block @{name}' }, -}); - -export default @injectIntl -class Account extends ImmutablePureComponent { - - static propTypes = { - size: PropTypes.number, - account: ImmutablePropTypes.map, - onFollow: PropTypes.func.isRequired, - onBlock: PropTypes.func.isRequired, - onMute: PropTypes.func.isRequired, - onMuteNotifications: PropTypes.func.isRequired, - intl: PropTypes.object.isRequired, - hidden: PropTypes.bool, - small: PropTypes.bool, - actionIcon: PropTypes.string, - actionTitle: PropTypes.string, - defaultAction: PropTypes.string, - onActionClick: PropTypes.func, - }; - - static defaultProps = { - size: 36, - }; - - handleFollow = () => { - this.props.onFollow(this.props.account); - }; - - handleBlock = () => { - this.props.onBlock(this.props.account); - }; - - handleMute = () => { - this.props.onMute(this.props.account); - }; - - handleMuteNotifications = () => { - this.props.onMuteNotifications(this.props.account, true); - }; - - handleUnmuteNotifications = () => { - this.props.onMuteNotifications(this.props.account, false); - }; - - handleAction = () => { - this.props.onActionClick(this.props.account); - }; - - render () { - const { - account, - hidden, - intl, - small, - onActionClick, - actionIcon, - actionTitle, - defaultAction, - size, - } = this.props; - - if (!account) { - return ( -
-
-
-
- -
-
-
- ); - } - - if (hidden) { - return ( - - {account.get('display_name')} - {account.get('username')} - - ); - } - - let buttons; - - if (onActionClick) { - if (actionIcon) { - buttons = ; - } - } else if (account.get('id') !== me && !small && account.get('relationship', null) !== null) { - const following = account.getIn(['relationship', 'following']); - const requested = account.getIn(['relationship', 'requested']); - const blocking = account.getIn(['relationship', 'blocking']); - const muting = account.getIn(['relationship', 'muting']); - - if (requested) { - buttons = ; - } else if (blocking) { - buttons = ; - } else if (muting) { - let hidingNotificationsButton; - if (account.getIn(['relationship', 'muting_notifications'])) { - hidingNotificationsButton = ; - } else { - hidingNotificationsButton = ; - } - buttons = ( - - - {hidingNotificationsButton} - - ); - } else if (defaultAction === 'mute') { - buttons = ; - } else if (defaultAction === 'block') { - buttons = ; - } else if (!account.get('moved') || following) { - buttons = ; - } - } - - let mute_expires_at; - if (account.get('mute_expires_at')) { - mute_expires_at =
; - } - - return small ? ( - -
- -
- -
- ) : ( -
-
- -
- {mute_expires_at} - -
- {buttons ? -
- {buttons} -
- : null} -
-
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/account.jsx b/app/javascript/flavours/glitch/components/account.jsx new file mode 100644 index 000000000..7ce4b65aa --- /dev/null +++ b/app/javascript/flavours/glitch/components/account.jsx @@ -0,0 +1,186 @@ +import React, { Fragment } from 'react'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import PropTypes from 'prop-types'; +import Avatar from './avatar'; +import DisplayName from './display_name'; +import Permalink from './permalink'; +import IconButton from './icon_button'; +import { defineMessages, injectIntl } from 'react-intl'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import { me } from 'flavours/glitch/initial_state'; +import RelativeTimestamp from './relative_timestamp'; +import Skeleton from 'flavours/glitch/components/skeleton'; + +const messages = defineMessages({ + follow: { id: 'account.follow', defaultMessage: 'Follow' }, + unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, + requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' }, + unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' }, + unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' }, + mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' }, + unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'Unmute notifications from @{name}' }, + mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' }, + block: { id: 'account.block', defaultMessage: 'Block @{name}' }, +}); + +export default @injectIntl +class Account extends ImmutablePureComponent { + + static propTypes = { + size: PropTypes.number, + account: ImmutablePropTypes.map, + onFollow: PropTypes.func.isRequired, + onBlock: PropTypes.func.isRequired, + onMute: PropTypes.func.isRequired, + onMuteNotifications: PropTypes.func.isRequired, + intl: PropTypes.object.isRequired, + hidden: PropTypes.bool, + small: PropTypes.bool, + actionIcon: PropTypes.string, + actionTitle: PropTypes.string, + defaultAction: PropTypes.string, + onActionClick: PropTypes.func, + }; + + static defaultProps = { + size: 36, + }; + + handleFollow = () => { + this.props.onFollow(this.props.account); + }; + + handleBlock = () => { + this.props.onBlock(this.props.account); + }; + + handleMute = () => { + this.props.onMute(this.props.account); + }; + + handleMuteNotifications = () => { + this.props.onMuteNotifications(this.props.account, true); + }; + + handleUnmuteNotifications = () => { + this.props.onMuteNotifications(this.props.account, false); + }; + + handleAction = () => { + this.props.onActionClick(this.props.account); + }; + + render () { + const { + account, + hidden, + intl, + small, + onActionClick, + actionIcon, + actionTitle, + defaultAction, + size, + } = this.props; + + if (!account) { + return ( +
+
+
+
+ +
+
+
+ ); + } + + if (hidden) { + return ( + + {account.get('display_name')} + {account.get('username')} + + ); + } + + let buttons; + + if (onActionClick) { + if (actionIcon) { + buttons = ; + } + } else if (account.get('id') !== me && !small && account.get('relationship', null) !== null) { + const following = account.getIn(['relationship', 'following']); + const requested = account.getIn(['relationship', 'requested']); + const blocking = account.getIn(['relationship', 'blocking']); + const muting = account.getIn(['relationship', 'muting']); + + if (requested) { + buttons = ; + } else if (blocking) { + buttons = ; + } else if (muting) { + let hidingNotificationsButton; + if (account.getIn(['relationship', 'muting_notifications'])) { + hidingNotificationsButton = ; + } else { + hidingNotificationsButton = ; + } + buttons = ( + + + {hidingNotificationsButton} + + ); + } else if (defaultAction === 'mute') { + buttons = ; + } else if (defaultAction === 'block') { + buttons = ; + } else if (!account.get('moved') || following) { + buttons = ; + } + } + + let mute_expires_at; + if (account.get('mute_expires_at')) { + mute_expires_at =
; + } + + return small ? ( + +
+ +
+ +
+ ) : ( +
+
+ +
+ {mute_expires_at} + +
+ {buttons ? +
+ {buttons} +
+ : null} +
+
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/admin/Counter.js b/app/javascript/flavours/glitch/components/admin/Counter.js deleted file mode 100644 index 5b6a19f8d..000000000 --- a/app/javascript/flavours/glitch/components/admin/Counter.js +++ /dev/null @@ -1,117 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import api from 'flavours/glitch/api'; -import { FormattedNumber } from 'react-intl'; -import { Sparklines, SparklinesCurve } from 'react-sparklines'; -import classNames from 'classnames'; -import Skeleton from 'flavours/glitch/components/skeleton'; - -const percIncrease = (a, b) => { - let percent; - - if (b !== 0) { - if (a !== 0) { - percent = (b - a) / a; - } else { - percent = 1; - } - } else if (b === 0 && a === 0) { - percent = 0; - } else { - percent = - 1; - } - - return percent; -}; - -export default class Counter extends React.PureComponent { - - static propTypes = { - measure: PropTypes.string.isRequired, - start_at: PropTypes.string.isRequired, - end_at: PropTypes.string.isRequired, - label: PropTypes.string.isRequired, - href: PropTypes.string, - params: PropTypes.object, - target: PropTypes.string, - }; - - state = { - loading: true, - data: null, - }; - - componentDidMount () { - const { measure, start_at, end_at, params } = this.props; - - api().post('/api/v1/admin/measures', { keys: [measure], start_at, end_at, [measure]: params }).then(res => { - this.setState({ - loading: false, - data: res.data, - }); - }).catch(err => { - console.error(err); - }); - } - - render () { - const { label, href, target } = this.props; - const { loading, data } = this.state; - - let content; - - 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} -
- -
- {label} -
- -
- {!loading && ( - x.value * 1)}> - - - )} -
-
- ); - - if (href) { - return ( -
- {inner} - - ); - } else { - return ( -
- {inner} -
- ); - } - } - -} diff --git a/app/javascript/flavours/glitch/components/admin/Counter.jsx b/app/javascript/flavours/glitch/components/admin/Counter.jsx new file mode 100644 index 000000000..5b6a19f8d --- /dev/null +++ b/app/javascript/flavours/glitch/components/admin/Counter.jsx @@ -0,0 +1,117 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import api from 'flavours/glitch/api'; +import { FormattedNumber } from 'react-intl'; +import { Sparklines, SparklinesCurve } from 'react-sparklines'; +import classNames from 'classnames'; +import Skeleton from 'flavours/glitch/components/skeleton'; + +const percIncrease = (a, b) => { + let percent; + + if (b !== 0) { + if (a !== 0) { + percent = (b - a) / a; + } else { + percent = 1; + } + } else if (b === 0 && a === 0) { + percent = 0; + } else { + percent = - 1; + } + + return percent; +}; + +export default class Counter extends React.PureComponent { + + static propTypes = { + measure: PropTypes.string.isRequired, + start_at: PropTypes.string.isRequired, + end_at: PropTypes.string.isRequired, + label: PropTypes.string.isRequired, + href: PropTypes.string, + params: PropTypes.object, + target: PropTypes.string, + }; + + state = { + loading: true, + data: null, + }; + + componentDidMount () { + const { measure, start_at, end_at, params } = this.props; + + api().post('/api/v1/admin/measures', { keys: [measure], start_at, end_at, [measure]: params }).then(res => { + this.setState({ + loading: false, + data: res.data, + }); + }).catch(err => { + console.error(err); + }); + } + + render () { + const { label, href, target } = this.props; + const { loading, data } = this.state; + + let content; + + 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} +
+ +
+ {label} +
+ +
+ {!loading && ( + x.value * 1)}> + + + )} +
+
+ ); + + if (href) { + return ( + + {inner} + + ); + } else { + return ( +
+ {inner} +
+ ); + } + } + +} diff --git a/app/javascript/flavours/glitch/components/admin/Dimension.js b/app/javascript/flavours/glitch/components/admin/Dimension.js deleted file mode 100644 index 3dac8c6c2..000000000 --- a/app/javascript/flavours/glitch/components/admin/Dimension.js +++ /dev/null @@ -1,93 +0,0 @@ -import React 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 { - - static propTypes = { - dimension: PropTypes.string.isRequired, - start_at: PropTypes.string.isRequired, - end_at: PropTypes.string.isRequired, - limit: PropTypes.number.isRequired, - label: PropTypes.string.isRequired, - params: PropTypes.object, - }; - - state = { - loading: true, - data: null, - }; - - componentDidMount () { - const { start_at, end_at, dimension, limit, params } = this.props; - - api().post('/api/v1/admin/dimensions', { keys: [dimension], start_at, end_at, limit, [dimension]: params }).then(res => { - this.setState({ - loading: false, - data: res.data, - }); - }).catch(err => { - console.error(err); - }); - } - - render () { - const { label, limit } = this.props; - const { loading, data } = this.state; - - let content; - - if (loading) { - content = ( - - - {Array.from(Array(limit)).map((_, i) => ( - - - - - - ))} - -
- - - -
- ); - } else { - const sum = data[0].data.reduce((sum, cur) => sum + (cur.value * 1), 0); - - content = ( - - - {data[0].data.map(item => ( - - - - - - ))} - -
- - {item.human_key} - - {typeof item.human_value !== 'undefined' ? item.human_value : } -
- ); - } - - return ( -
-

{label}

- - {content} -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/admin/Dimension.jsx b/app/javascript/flavours/glitch/components/admin/Dimension.jsx new file mode 100644 index 000000000..3dac8c6c2 --- /dev/null +++ b/app/javascript/flavours/glitch/components/admin/Dimension.jsx @@ -0,0 +1,93 @@ +import React 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 { + + static propTypes = { + dimension: PropTypes.string.isRequired, + start_at: PropTypes.string.isRequired, + end_at: PropTypes.string.isRequired, + limit: PropTypes.number.isRequired, + label: PropTypes.string.isRequired, + params: PropTypes.object, + }; + + state = { + loading: true, + data: null, + }; + + componentDidMount () { + const { start_at, end_at, dimension, limit, params } = this.props; + + api().post('/api/v1/admin/dimensions', { keys: [dimension], start_at, end_at, limit, [dimension]: params }).then(res => { + this.setState({ + loading: false, + data: res.data, + }); + }).catch(err => { + console.error(err); + }); + } + + render () { + const { label, limit } = this.props; + const { loading, data } = this.state; + + let content; + + if (loading) { + content = ( + + + {Array.from(Array(limit)).map((_, i) => ( + + + + + + ))} + +
+ + + +
+ ); + } else { + const sum = data[0].data.reduce((sum, cur) => sum + (cur.value * 1), 0); + + content = ( + + + {data[0].data.map(item => ( + + + + + + ))} + +
+ + {item.human_key} + + {typeof item.human_value !== 'undefined' ? item.human_value : } +
+ ); + } + + return ( +
+

{label}

+ + {content} +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.js b/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.js deleted file mode 100644 index 771dbb452..000000000 --- a/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.js +++ /dev/null @@ -1,159 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import api from 'flavours/glitch/api'; -import { injectIntl, defineMessages } from 'react-intl'; -import classNames from 'classnames'; - -const messages = defineMessages({ - other: { id: 'report.categories.other', defaultMessage: 'Other' }, - spam: { id: 'report.categories.spam', defaultMessage: 'Spam' }, - violation: { id: 'report.categories.violation', defaultMessage: 'Content violates one or more server rules' }, -}); - -class Category extends React.PureComponent { - - static propTypes = { - id: PropTypes.string.isRequired, - text: PropTypes.string.isRequired, - selected: PropTypes.bool, - disabled: PropTypes.bool, - onSelect: PropTypes.func, - children: PropTypes.node, - }; - - handleClick = () => { - const { id, disabled, onSelect } = this.props; - - if (!disabled) { - onSelect(id); - } - }; - - render () { - const { id, text, disabled, selected, children } = this.props; - - return ( -
- {selected && } - -
- - {text} -
- - {(selected && children) && ( -
- {children} -
- )} -
- ); - } - -} - -class Rule extends React.PureComponent { - - static propTypes = { - id: PropTypes.string.isRequired, - text: PropTypes.string.isRequired, - selected: PropTypes.bool, - disabled: PropTypes.bool, - onToggle: PropTypes.func, - }; - - handleClick = () => { - const { id, disabled, onToggle } = this.props; - - if (!disabled) { - onToggle(id); - } - }; - - render () { - const { id, text, disabled, selected } = this.props; - - return ( -
- - {selected && } - {text} -
- ); - } - -} - -export default @injectIntl -class ReportReasonSelector extends React.PureComponent { - - static propTypes = { - id: PropTypes.string.isRequired, - category: PropTypes.string.isRequired, - rule_ids: PropTypes.arrayOf(PropTypes.string), - disabled: PropTypes.bool, - intl: PropTypes.object.isRequired, - }; - - state = { - category: this.props.category, - rule_ids: this.props.rule_ids || [], - rules: [], - }; - - componentDidMount() { - api().get('/api/v1/instance').then(res => { - this.setState({ - rules: res.data.rules, - }); - }).catch(err => { - console.error(err); - }); - } - - _save = () => { - const { id, disabled } = this.props; - const { category, rule_ids } = this.state; - - if (disabled) { - return; - } - - api().put(`/api/v1/admin/reports/${id}`, { - category, - rule_ids, - }).catch(err => { - console.error(err); - }); - }; - - handleSelect = id => { - this.setState({ category: id }, () => this._save()); - }; - - handleToggle = id => { - const { rule_ids } = this.state; - - if (rule_ids.includes(id)) { - this.setState({ rule_ids: rule_ids.filter(x => x !== id ) }, () => this._save()); - } else { - this.setState({ rule_ids: [...rule_ids, id] }, () => this._save()); - } - }; - - render () { - const { disabled, intl } = this.props; - const { rules, category, rule_ids } = this.state; - - return ( -
- - - - {rules.map(rule => )} - -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.jsx b/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.jsx new file mode 100644 index 000000000..771dbb452 --- /dev/null +++ b/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.jsx @@ -0,0 +1,159 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import api from 'flavours/glitch/api'; +import { injectIntl, defineMessages } from 'react-intl'; +import classNames from 'classnames'; + +const messages = defineMessages({ + other: { id: 'report.categories.other', defaultMessage: 'Other' }, + spam: { id: 'report.categories.spam', defaultMessage: 'Spam' }, + violation: { id: 'report.categories.violation', defaultMessage: 'Content violates one or more server rules' }, +}); + +class Category extends React.PureComponent { + + static propTypes = { + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + selected: PropTypes.bool, + disabled: PropTypes.bool, + onSelect: PropTypes.func, + children: PropTypes.node, + }; + + handleClick = () => { + const { id, disabled, onSelect } = this.props; + + if (!disabled) { + onSelect(id); + } + }; + + render () { + const { id, text, disabled, selected, children } = this.props; + + return ( +
+ {selected && } + +
+ + {text} +
+ + {(selected && children) && ( +
+ {children} +
+ )} +
+ ); + } + +} + +class Rule extends React.PureComponent { + + static propTypes = { + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + selected: PropTypes.bool, + disabled: PropTypes.bool, + onToggle: PropTypes.func, + }; + + handleClick = () => { + const { id, disabled, onToggle } = this.props; + + if (!disabled) { + onToggle(id); + } + }; + + render () { + const { id, text, disabled, selected } = this.props; + + return ( +
+ + {selected && } + {text} +
+ ); + } + +} + +export default @injectIntl +class ReportReasonSelector extends React.PureComponent { + + static propTypes = { + id: PropTypes.string.isRequired, + category: PropTypes.string.isRequired, + rule_ids: PropTypes.arrayOf(PropTypes.string), + disabled: PropTypes.bool, + intl: PropTypes.object.isRequired, + }; + + state = { + category: this.props.category, + rule_ids: this.props.rule_ids || [], + rules: [], + }; + + componentDidMount() { + api().get('/api/v1/instance').then(res => { + this.setState({ + rules: res.data.rules, + }); + }).catch(err => { + console.error(err); + }); + } + + _save = () => { + const { id, disabled } = this.props; + const { category, rule_ids } = this.state; + + if (disabled) { + return; + } + + api().put(`/api/v1/admin/reports/${id}`, { + category, + rule_ids, + }).catch(err => { + console.error(err); + }); + }; + + handleSelect = id => { + this.setState({ category: id }, () => this._save()); + }; + + handleToggle = id => { + const { rule_ids } = this.state; + + if (rule_ids.includes(id)) { + this.setState({ rule_ids: rule_ids.filter(x => x !== id ) }, () => this._save()); + } else { + this.setState({ rule_ids: [...rule_ids, id] }, () => this._save()); + } + }; + + render () { + const { disabled, intl } = this.props; + const { rules, category, rule_ids } = this.state; + + return ( +
+ + + + {rules.map(rule => )} + +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/admin/Retention.js b/app/javascript/flavours/glitch/components/admin/Retention.js deleted file mode 100644 index e1ba3f6c9..000000000 --- a/app/javascript/flavours/glitch/components/admin/Retention.js +++ /dev/null @@ -1,151 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import api from 'flavours/glitch/api'; -import { FormattedMessage, FormattedNumber, FormattedDate } from 'react-intl'; -import classNames from 'classnames'; -import { roundTo10 } from 'flavours/glitch/utils/numbers'; - -const dateForCohort = cohort => { - switch(cohort.frequency) { - case 'day': - return ; - default: - return ; - } -}; - -export default class Retention extends React.PureComponent { - - static propTypes = { - start_at: PropTypes.string, - end_at: PropTypes.string, - frequency: PropTypes.string, - }; - - state = { - loading: true, - data: null, - }; - - componentDidMount () { - const { start_at, end_at, frequency } = this.props; - - api().post('/api/v1/admin/retention', { start_at, end_at, frequency }).then(res => { - this.setState({ - loading: false, - data: res.data, - }); - }).catch(err => { - console.error(err); - }); - } - - render () { - const { loading, data } = this.state; - const { frequency } = this.props; - - let content; - - if (loading) { - content = ; - } else { - content = ( - - - - - - - - {data[0].data.slice(1).map((retention, i) => ( - - ))} - - - - - - - - {data[0].data.slice(1).map((retention, i) => { - const average = data.reduce((sum, cohort, k) => cohort.data[i + 1] ? sum + (cohort.data[i + 1].rate - sum)/(k + 1) : sum, 0); - - return ( - - ); - })} - - - - - {data.slice(0, -1).map(cohort => ( - - - - - - {cohort.data.slice(1).map(retention => ( - - ))} - - ))} - -
-
- -
-
-
- -
-
-
- {i + 1} -
-
-
- -
-
-
- sum + ((cohort.data[0].value * 1) - sum) / (i + 1), 0)} maximumFractionDigits={0} /> -
-
-
- -
-
-
- {dateForCohort(cohort)} -
-
-
- -
-
-
- -
-
- ); - } - - let title = null; - switch(frequency) { - case 'day': - title = ; - break; - default: - title = ; - } - - return ( -
-

{title}

- - {content} -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/admin/Retention.jsx b/app/javascript/flavours/glitch/components/admin/Retention.jsx new file mode 100644 index 000000000..e1ba3f6c9 --- /dev/null +++ b/app/javascript/flavours/glitch/components/admin/Retention.jsx @@ -0,0 +1,151 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import api from 'flavours/glitch/api'; +import { FormattedMessage, FormattedNumber, FormattedDate } from 'react-intl'; +import classNames from 'classnames'; +import { roundTo10 } from 'flavours/glitch/utils/numbers'; + +const dateForCohort = cohort => { + switch(cohort.frequency) { + case 'day': + return ; + default: + return ; + } +}; + +export default class Retention extends React.PureComponent { + + static propTypes = { + start_at: PropTypes.string, + end_at: PropTypes.string, + frequency: PropTypes.string, + }; + + state = { + loading: true, + data: null, + }; + + componentDidMount () { + const { start_at, end_at, frequency } = this.props; + + api().post('/api/v1/admin/retention', { start_at, end_at, frequency }).then(res => { + this.setState({ + loading: false, + data: res.data, + }); + }).catch(err => { + console.error(err); + }); + } + + render () { + const { loading, data } = this.state; + const { frequency } = this.props; + + let content; + + if (loading) { + content = ; + } else { + content = ( + + + + + + + + {data[0].data.slice(1).map((retention, i) => ( + + ))} + + + + + + + + {data[0].data.slice(1).map((retention, i) => { + const average = data.reduce((sum, cohort, k) => cohort.data[i + 1] ? sum + (cohort.data[i + 1].rate - sum)/(k + 1) : sum, 0); + + return ( + + ); + })} + + + + + {data.slice(0, -1).map(cohort => ( + + + + + + {cohort.data.slice(1).map(retention => ( + + ))} + + ))} + +
+
+ +
+
+
+ +
+
+
+ {i + 1} +
+
+
+ +
+
+
+ sum + ((cohort.data[0].value * 1) - sum) / (i + 1), 0)} maximumFractionDigits={0} /> +
+
+
+ +
+
+
+ {dateForCohort(cohort)} +
+
+
+ +
+
+
+ +
+
+ ); + } + + let title = null; + switch(frequency) { + case 'day': + title = ; + break; + default: + title = ; + } + + return ( +
+

{title}

+ + {content} +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/admin/Trends.js b/app/javascript/flavours/glitch/components/admin/Trends.js deleted file mode 100644 index 774bf36e6..000000000 --- a/app/javascript/flavours/glitch/components/admin/Trends.js +++ /dev/null @@ -1,73 +0,0 @@ -import React 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 { - - static propTypes = { - limit: PropTypes.number.isRequired, - }; - - state = { - loading: true, - data: null, - }; - - componentDidMount () { - const { limit } = this.props; - - api().get('/api/v1/admin/trends/tags', { params: { limit } }).then(res => { - this.setState({ - loading: false, - data: res.data, - }); - }).catch(err => { - console.error(err); - }); - } - - render () { - const { limit } = this.props; - const { loading, data } = this.state; - - let content; - - if (loading) { - content = ( -
- {Array.from(Array(limit)).map((_, i) => ( - - ))} -
- ); - } else { - content = ( -
- {data.map(hashtag => ( - day.uses)} - className={classNames(hashtag.requires_review && 'trends__item--requires-review', !hashtag.trendable && !hashtag.requires_review && 'trends__item--disabled')} - /> - ))} -
- ); - } - - return ( -
-

- - {content} -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/admin/Trends.jsx b/app/javascript/flavours/glitch/components/admin/Trends.jsx new file mode 100644 index 000000000..774bf36e6 --- /dev/null +++ b/app/javascript/flavours/glitch/components/admin/Trends.jsx @@ -0,0 +1,73 @@ +import React 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 { + + static propTypes = { + limit: PropTypes.number.isRequired, + }; + + state = { + loading: true, + data: null, + }; + + componentDidMount () { + const { limit } = this.props; + + api().get('/api/v1/admin/trends/tags', { params: { limit } }).then(res => { + this.setState({ + loading: false, + data: res.data, + }); + }).catch(err => { + console.error(err); + }); + } + + render () { + const { limit } = this.props; + const { loading, data } = this.state; + + let content; + + if (loading) { + content = ( +
+ {Array.from(Array(limit)).map((_, i) => ( + + ))} +
+ ); + } else { + content = ( +
+ {data.map(hashtag => ( + day.uses)} + className={classNames(hashtag.requires_review && 'trends__item--requires-review', !hashtag.trendable && !hashtag.requires_review && 'trends__item--disabled')} + /> + ))} +
+ ); + } + + return ( +
+

+ + {content} +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/animated_number.js b/app/javascript/flavours/glitch/components/animated_number.js deleted file mode 100644 index dd21d97f0..000000000 --- a/app/javascript/flavours/glitch/components/animated_number.js +++ /dev/null @@ -1,76 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import ShortNumber from 'mastodon/components/short_number'; -import TransitionMotion from 'react-motion/lib/TransitionMotion'; -import spring from 'react-motion/lib/spring'; -import { reduceMotion } from 'flavours/glitch/initial_state'; - -const obfuscatedCount = count => { - if (count < 0) { - return 0; - } else if (count <= 1) { - return count; - } else { - return '1+'; - } -}; - -export default class AnimatedNumber extends React.PureComponent { - - static propTypes = { - value: PropTypes.number.isRequired, - obfuscate: PropTypes.bool, - }; - - state = { - direction: 1, - }; - - componentWillReceiveProps (nextProps) { - if (nextProps.value > this.props.value) { - this.setState({ direction: 1 }); - } else if (nextProps.value < this.props.value) { - this.setState({ direction: -1 }); - } - } - - willEnter = () => { - const { direction } = this.state; - - return { y: -1 * direction }; - }; - - willLeave = () => { - const { direction } = this.state; - - return { y: spring(1 * direction, { damping: 35, stiffness: 400 }) }; - }; - - render () { - const { value, obfuscate } = this.props; - const { direction } = this.state; - - if (reduceMotion) { - return obfuscate ? obfuscatedCount(value) : ; - } - - const styles = [{ - key: `${value}`, - data: value, - style: { y: spring(0, { damping: 35, stiffness: 400 }) }, - }]; - - return ( - - {items => ( - - {items.map(({ key, data, style }) => ( - 0 ? 'absolute' : 'static', transform: `translateY(${style.y * 100}%)` }}>{obfuscate ? obfuscatedCount(data) : } - ))} - - )} - - ); - } - -} diff --git a/app/javascript/flavours/glitch/components/animated_number.jsx b/app/javascript/flavours/glitch/components/animated_number.jsx new file mode 100644 index 000000000..dd21d97f0 --- /dev/null +++ b/app/javascript/flavours/glitch/components/animated_number.jsx @@ -0,0 +1,76 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import ShortNumber from 'mastodon/components/short_number'; +import TransitionMotion from 'react-motion/lib/TransitionMotion'; +import spring from 'react-motion/lib/spring'; +import { reduceMotion } from 'flavours/glitch/initial_state'; + +const obfuscatedCount = count => { + if (count < 0) { + return 0; + } else if (count <= 1) { + return count; + } else { + return '1+'; + } +}; + +export default class AnimatedNumber extends React.PureComponent { + + static propTypes = { + value: PropTypes.number.isRequired, + obfuscate: PropTypes.bool, + }; + + state = { + direction: 1, + }; + + componentWillReceiveProps (nextProps) { + if (nextProps.value > this.props.value) { + this.setState({ direction: 1 }); + } else if (nextProps.value < this.props.value) { + this.setState({ direction: -1 }); + } + } + + willEnter = () => { + const { direction } = this.state; + + return { y: -1 * direction }; + }; + + willLeave = () => { + const { direction } = this.state; + + return { y: spring(1 * direction, { damping: 35, stiffness: 400 }) }; + }; + + render () { + const { value, obfuscate } = this.props; + const { direction } = this.state; + + if (reduceMotion) { + return obfuscate ? obfuscatedCount(value) : ; + } + + const styles = [{ + key: `${value}`, + data: value, + style: { y: spring(0, { damping: 35, stiffness: 400 }) }, + }]; + + return ( + + {items => ( + + {items.map(({ key, data, style }) => ( + 0 ? 'absolute' : 'static', transform: `translateY(${style.y * 100}%)` }}>{obfuscate ? obfuscatedCount(data) : } + ))} + + )} + + ); + } + +} diff --git a/app/javascript/flavours/glitch/components/attachment_list.js b/app/javascript/flavours/glitch/components/attachment_list.js deleted file mode 100644 index 68b80b19f..000000000 --- a/app/javascript/flavours/glitch/components/attachment_list.js +++ /dev/null @@ -1,48 +0,0 @@ -import React from 'react'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import PropTypes from 'prop-types'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { FormattedMessage } from 'react-intl'; -import classNames from 'classnames'; -import Icon from 'flavours/glitch/components/icon'; - -const filename = url => url.split('/').pop().split('#')[0].split('?')[0]; - -export default class AttachmentList extends ImmutablePureComponent { - - static propTypes = { - media: ImmutablePropTypes.list.isRequired, - compact: PropTypes.bool, - }; - - render () { - const { media, compact } = this.props; - - return ( -
- {!compact && ( -
- -
- )} - - -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/attachment_list.jsx b/app/javascript/flavours/glitch/components/attachment_list.jsx new file mode 100644 index 000000000..68b80b19f --- /dev/null +++ b/app/javascript/flavours/glitch/components/attachment_list.jsx @@ -0,0 +1,48 @@ +import React from 'react'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import PropTypes from 'prop-types'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import { FormattedMessage } from 'react-intl'; +import classNames from 'classnames'; +import Icon from 'flavours/glitch/components/icon'; + +const filename = url => url.split('/').pop().split('#')[0].split('?')[0]; + +export default class AttachmentList extends ImmutablePureComponent { + + static propTypes = { + media: ImmutablePropTypes.list.isRequired, + compact: PropTypes.bool, + }; + + render () { + const { media, compact } = this.props; + + return ( +
+ {!compact && ( +
+ +
+ )} + + +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/autosuggest_emoji.js b/app/javascript/flavours/glitch/components/autosuggest_emoji.js deleted file mode 100644 index 83fafbd10..000000000 --- a/app/javascript/flavours/glitch/components/autosuggest_emoji.js +++ /dev/null @@ -1,42 +0,0 @@ -import React 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 { - - static propTypes = { - emoji: PropTypes.object.isRequired, - }; - - render () { - const { emoji } = this.props; - let url; - - if (emoji.custom) { - url = emoji.imageUrl; - } else { - const mapping = unicodeMapping[emoji.native] || unicodeMapping[emoji.native.replace(/\uFE0F$/, '')]; - - if (!mapping) { - return null; - } - - url = `${assetHost}/emoji/${mapping.filename}.svg`; - } - - return ( -
- {emoji.native - - {emoji.colons} -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx b/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx new file mode 100644 index 000000000..83fafbd10 --- /dev/null +++ b/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx @@ -0,0 +1,42 @@ +import React 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 { + + static propTypes = { + emoji: PropTypes.object.isRequired, + }; + + render () { + const { emoji } = this.props; + let url; + + if (emoji.custom) { + url = emoji.imageUrl; + } else { + const mapping = unicodeMapping[emoji.native] || unicodeMapping[emoji.native.replace(/\uFE0F$/, '')]; + + if (!mapping) { + return null; + } + + url = `${assetHost}/emoji/${mapping.filename}.svg`; + } + + return ( +
+ {emoji.native + + {emoji.colons} +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/autosuggest_hashtag.js b/app/javascript/flavours/glitch/components/autosuggest_hashtag.js deleted file mode 100644 index d787ed07a..000000000 --- a/app/javascript/flavours/glitch/components/autosuggest_hashtag.js +++ /dev/null @@ -1,42 +0,0 @@ -import React 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 { - - static propTypes = { - tag: PropTypes.shape({ - name: PropTypes.string.isRequired, - url: PropTypes.string, - history: PropTypes.array, - }).isRequired, - }; - - render() { - const { tag } = this.props; - const weeklyUses = tag.history && ( - total + day.uses * 1, 0)} - /> - ); - - return ( -
-
- #{tag.name} -
- {tag.history !== undefined && ( -
- -
- )} -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/autosuggest_hashtag.jsx b/app/javascript/flavours/glitch/components/autosuggest_hashtag.jsx new file mode 100644 index 000000000..d787ed07a --- /dev/null +++ b/app/javascript/flavours/glitch/components/autosuggest_hashtag.jsx @@ -0,0 +1,42 @@ +import React 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 { + + static propTypes = { + tag: PropTypes.shape({ + name: PropTypes.string.isRequired, + url: PropTypes.string, + history: PropTypes.array, + }).isRequired, + }; + + render() { + const { tag } = this.props; + const weeklyUses = tag.history && ( + total + day.uses * 1, 0)} + /> + ); + + return ( +
+
+ #{tag.name} +
+ {tag.history !== undefined && ( +
+ +
+ )} +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/autosuggest_input.js b/app/javascript/flavours/glitch/components/autosuggest_input.js deleted file mode 100644 index 90ff298c0..000000000 --- a/app/javascript/flavours/glitch/components/autosuggest_input.js +++ /dev/null @@ -1,227 +0,0 @@ -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'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import PropTypes from 'prop-types'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import classNames from 'classnames'; - -const textAtCursorMatchesToken = (str, caretPosition, searchTokens) => { - let word; - - let left = str.slice(0, caretPosition).search(/[^\s\u200B]+$/); - let right = str.slice(caretPosition).search(/[\s\u200B]/); - - if (right < 0) { - word = str.slice(left); - } else { - word = str.slice(left, right + caretPosition); - } - - if (!word || word.trim().length < 3 || searchTokens.indexOf(word[0]) === -1) { - return [null, null]; - } - - word = word.trim().toLowerCase(); - - if (word.length > 0) { - return [left, word]; - } else { - return [null, null]; - } -}; - -export default class AutosuggestInput extends ImmutablePureComponent { - - static propTypes = { - value: PropTypes.string, - suggestions: ImmutablePropTypes.list, - disabled: PropTypes.bool, - placeholder: PropTypes.string, - onSuggestionSelected: PropTypes.func.isRequired, - onSuggestionsClearRequested: PropTypes.func.isRequired, - onSuggestionsFetchRequested: PropTypes.func.isRequired, - onChange: PropTypes.func.isRequired, - onKeyUp: PropTypes.func, - onKeyDown: PropTypes.func, - autoFocus: PropTypes.bool, - className: PropTypes.string, - id: PropTypes.string, - searchTokens: PropTypes.arrayOf(PropTypes.string), - maxLength: PropTypes.number, - lang: PropTypes.string, - spellCheck: PropTypes.bool, - }; - - static defaultProps = { - autoFocus: true, - searchTokens: ['@', ':', '#'], - }; - - state = { - suggestionsHidden: true, - focused: false, - selectedSuggestion: 0, - lastToken: null, - tokenStart: 0, - }; - - onChange = (e) => { - const [ tokenStart, token ] = textAtCursorMatchesToken(e.target.value, e.target.selectionStart, this.props.searchTokens); - - if (token !== null && this.state.lastToken !== token) { - this.setState({ lastToken: token, selectedSuggestion: 0, tokenStart }); - this.props.onSuggestionsFetchRequested(token); - } else if (token === null) { - this.setState({ lastToken: null }); - this.props.onSuggestionsClearRequested(); - } - - this.props.onChange(e); - }; - - onKeyDown = (e) => { - const { suggestions, disabled } = this.props; - const { selectedSuggestion, suggestionsHidden } = this.state; - - if (disabled) { - e.preventDefault(); - return; - } - - if (e.which === 229 || e.isComposing) { - // Ignore key events during text composition - // e.key may be a name of the physical key even in this case (e.x. Safari / Chrome on Mac) - return; - } - - switch(e.key) { - case 'Escape': - if (suggestions.size === 0 || suggestionsHidden) { - document.querySelector('.ui').parentElement.focus(); - } else { - e.preventDefault(); - this.setState({ suggestionsHidden: true }); - } - - break; - case 'ArrowDown': - if (suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) }); - } - - break; - case 'ArrowUp': - if (suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) }); - } - - break; - case 'Enter': - case 'Tab': - // Select suggestion - if (this.state.lastToken !== null && suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - e.stopPropagation(); - this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestions.get(selectedSuggestion)); - } - - break; - } - - if (e.defaultPrevented || !this.props.onKeyDown) { - return; - } - - this.props.onKeyDown(e); - }; - - onBlur = () => { - this.setState({ suggestionsHidden: true, focused: false }); - }; - - onFocus = () => { - this.setState({ focused: true }); - }; - - onSuggestionClick = (e) => { - const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index')); - e.preventDefault(); - this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion); - this.input.focus(); - }; - - componentWillReceiveProps (nextProps) { - if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { - this.setState({ suggestionsHidden: false }); - } - } - - setInput = (c) => { - this.input = c; - }; - - renderSuggestion = (suggestion, i) => { - const { selectedSuggestion } = this.state; - let inner, key; - - if (suggestion.type === 'emoji') { - inner = ; - key = suggestion.id; - } else if (suggestion.type ==='hashtag') { - inner = ; - key = suggestion.name; - } else if (suggestion.type === 'account') { - inner = ; - key = suggestion.id; - } - - return ( -
- {inner} -
- ); - }; - - render () { - const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength, lang, spellCheck } = this.props; - const { suggestionsHidden } = this.state; - - return ( -
- - -
- {suggestions.map(this.renderSuggestion)} -
-
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/autosuggest_input.jsx b/app/javascript/flavours/glitch/components/autosuggest_input.jsx new file mode 100644 index 000000000..90ff298c0 --- /dev/null +++ b/app/javascript/flavours/glitch/components/autosuggest_input.jsx @@ -0,0 +1,227 @@ +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'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import PropTypes from 'prop-types'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import classNames from 'classnames'; + +const textAtCursorMatchesToken = (str, caretPosition, searchTokens) => { + let word; + + let left = str.slice(0, caretPosition).search(/[^\s\u200B]+$/); + let right = str.slice(caretPosition).search(/[\s\u200B]/); + + if (right < 0) { + word = str.slice(left); + } else { + word = str.slice(left, right + caretPosition); + } + + if (!word || word.trim().length < 3 || searchTokens.indexOf(word[0]) === -1) { + return [null, null]; + } + + word = word.trim().toLowerCase(); + + if (word.length > 0) { + return [left, word]; + } else { + return [null, null]; + } +}; + +export default class AutosuggestInput extends ImmutablePureComponent { + + static propTypes = { + value: PropTypes.string, + suggestions: ImmutablePropTypes.list, + disabled: PropTypes.bool, + placeholder: PropTypes.string, + onSuggestionSelected: PropTypes.func.isRequired, + onSuggestionsClearRequested: PropTypes.func.isRequired, + onSuggestionsFetchRequested: PropTypes.func.isRequired, + onChange: PropTypes.func.isRequired, + onKeyUp: PropTypes.func, + onKeyDown: PropTypes.func, + autoFocus: PropTypes.bool, + className: PropTypes.string, + id: PropTypes.string, + searchTokens: PropTypes.arrayOf(PropTypes.string), + maxLength: PropTypes.number, + lang: PropTypes.string, + spellCheck: PropTypes.bool, + }; + + static defaultProps = { + autoFocus: true, + searchTokens: ['@', ':', '#'], + }; + + state = { + suggestionsHidden: true, + focused: false, + selectedSuggestion: 0, + lastToken: null, + tokenStart: 0, + }; + + onChange = (e) => { + const [ tokenStart, token ] = textAtCursorMatchesToken(e.target.value, e.target.selectionStart, this.props.searchTokens); + + if (token !== null && this.state.lastToken !== token) { + this.setState({ lastToken: token, selectedSuggestion: 0, tokenStart }); + this.props.onSuggestionsFetchRequested(token); + } else if (token === null) { + this.setState({ lastToken: null }); + this.props.onSuggestionsClearRequested(); + } + + this.props.onChange(e); + }; + + onKeyDown = (e) => { + const { suggestions, disabled } = this.props; + const { selectedSuggestion, suggestionsHidden } = this.state; + + if (disabled) { + e.preventDefault(); + return; + } + + if (e.which === 229 || e.isComposing) { + // Ignore key events during text composition + // e.key may be a name of the physical key even in this case (e.x. Safari / Chrome on Mac) + return; + } + + switch(e.key) { + case 'Escape': + if (suggestions.size === 0 || suggestionsHidden) { + document.querySelector('.ui').parentElement.focus(); + } else { + e.preventDefault(); + this.setState({ suggestionsHidden: true }); + } + + break; + case 'ArrowDown': + if (suggestions.size > 0 && !suggestionsHidden) { + e.preventDefault(); + this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) }); + } + + break; + case 'ArrowUp': + if (suggestions.size > 0 && !suggestionsHidden) { + e.preventDefault(); + this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) }); + } + + break; + case 'Enter': + case 'Tab': + // Select suggestion + if (this.state.lastToken !== null && suggestions.size > 0 && !suggestionsHidden) { + e.preventDefault(); + e.stopPropagation(); + this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestions.get(selectedSuggestion)); + } + + break; + } + + if (e.defaultPrevented || !this.props.onKeyDown) { + return; + } + + this.props.onKeyDown(e); + }; + + onBlur = () => { + this.setState({ suggestionsHidden: true, focused: false }); + }; + + onFocus = () => { + this.setState({ focused: true }); + }; + + onSuggestionClick = (e) => { + const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index')); + e.preventDefault(); + this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion); + this.input.focus(); + }; + + componentWillReceiveProps (nextProps) { + if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { + this.setState({ suggestionsHidden: false }); + } + } + + setInput = (c) => { + this.input = c; + }; + + renderSuggestion = (suggestion, i) => { + const { selectedSuggestion } = this.state; + let inner, key; + + if (suggestion.type === 'emoji') { + inner = ; + key = suggestion.id; + } else if (suggestion.type ==='hashtag') { + inner = ; + key = suggestion.name; + } else if (suggestion.type === 'account') { + inner = ; + key = suggestion.id; + } + + return ( +
+ {inner} +
+ ); + }; + + render () { + const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength, lang, spellCheck } = this.props; + const { suggestionsHidden } = this.state; + + return ( +
+ + +
+ {suggestions.map(this.renderSuggestion)} +
+
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/autosuggest_textarea.js b/app/javascript/flavours/glitch/components/autosuggest_textarea.js deleted file mode 100644 index 6e6e567b9..000000000 --- a/app/javascript/flavours/glitch/components/autosuggest_textarea.js +++ /dev/null @@ -1,235 +0,0 @@ -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'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import PropTypes from 'prop-types'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import Textarea from 'react-textarea-autosize'; -import classNames from 'classnames'; - -const textAtCursorMatchesToken = (str, caretPosition) => { - let word; - - let left = str.slice(0, caretPosition).search(/[^\s\u200B]+$/); - let right = str.slice(caretPosition).search(/[\s\u200B]/); - - if (right < 0) { - word = str.slice(left); - } else { - word = str.slice(left, right + caretPosition); - } - - if (!word || word.trim().length < 3 || ['@', ':', '#'].indexOf(word[0]) === -1) { - return [null, null]; - } - - word = word.trim().toLowerCase(); - - if (word.length > 0) { - return [left, word]; - } else { - return [null, null]; - } -}; - -export default class AutosuggestTextarea extends ImmutablePureComponent { - - static propTypes = { - value: PropTypes.string, - suggestions: ImmutablePropTypes.list, - disabled: PropTypes.bool, - placeholder: PropTypes.string, - onSuggestionSelected: PropTypes.func.isRequired, - onSuggestionsClearRequested: PropTypes.func.isRequired, - onSuggestionsFetchRequested: PropTypes.func.isRequired, - onChange: PropTypes.func.isRequired, - onKeyUp: PropTypes.func, - onKeyDown: PropTypes.func, - onPaste: PropTypes.func.isRequired, - autoFocus: PropTypes.bool, - lang: PropTypes.string, - }; - - static defaultProps = { - autoFocus: true, - }; - - state = { - suggestionsHidden: true, - focused: false, - selectedSuggestion: 0, - lastToken: null, - tokenStart: 0, - }; - - onChange = (e) => { - const [ tokenStart, token ] = textAtCursorMatchesToken(e.target.value, e.target.selectionStart); - - if (token !== null && this.state.lastToken !== token) { - this.setState({ lastToken: token, selectedSuggestion: 0, tokenStart }); - this.props.onSuggestionsFetchRequested(token); - } else if (token === null) { - this.setState({ lastToken: null }); - this.props.onSuggestionsClearRequested(); - } - - this.props.onChange(e); - }; - - onKeyDown = (e) => { - const { suggestions, disabled } = this.props; - const { selectedSuggestion, suggestionsHidden } = this.state; - - if (disabled) { - e.preventDefault(); - return; - } - - if (e.which === 229 || e.isComposing) { - // Ignore key events during text composition - // e.key may be a name of the physical key even in this case (e.x. Safari / Chrome on Mac) - return; - } - - switch(e.key) { - case 'Escape': - if (suggestions.size === 0 || suggestionsHidden) { - document.querySelector('.ui').parentElement.focus(); - } else { - e.preventDefault(); - this.setState({ suggestionsHidden: true }); - } - - break; - case 'ArrowDown': - if (suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) }); - } - - break; - case 'ArrowUp': - if (suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) }); - } - - break; - case 'Enter': - case 'Tab': - // Select suggestion - if (this.state.lastToken !== null && suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - e.stopPropagation(); - this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestions.get(selectedSuggestion)); - } - - break; - } - - if (e.defaultPrevented || !this.props.onKeyDown) { - return; - } - - this.props.onKeyDown(e); - }; - - onBlur = () => { - this.setState({ suggestionsHidden: true, focused: false }); - }; - - onFocus = (e) => { - this.setState({ focused: true }); - if (this.props.onFocus) { - this.props.onFocus(e); - } - }; - - onSuggestionClick = (e) => { - const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index')); - e.preventDefault(); - this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion); - this.textarea.focus(); - }; - - componentWillReceiveProps (nextProps) { - if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { - this.setState({ suggestionsHidden: false }); - } - } - - setTextarea = (c) => { - this.textarea = c; - }; - - onPaste = (e) => { - if (e.clipboardData && e.clipboardData.files.length === 1) { - this.props.onPaste(e.clipboardData.files); - e.preventDefault(); - } - }; - - renderSuggestion = (suggestion, i) => { - const { selectedSuggestion } = this.state; - let inner, key; - - if (suggestion.type === 'emoji') { - inner = ; - key = suggestion.id; - } else if (suggestion.type === 'hashtag') { - inner = ; - key = suggestion.name; - } else if (suggestion.type === 'account') { - inner = ; - key = suggestion.id; - } - - return ( -
- {inner} -
- ); - }; - - render () { - const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, lang, children } = this.props; - const { suggestionsHidden } = this.state; - - return [ -
-
-