diff --git a/app/application.ts b/app/application.ts index 38dc089935..9610b4f9a5 100644 --- a/app/application.ts +++ b/app/application.ts @@ -1,10 +1,10 @@ -import loadPolyfills from './soapbox/load_polyfills'; +import loadPolyfills from './soapbox/load-polyfills'; // Load iframe event listener require('./soapbox/iframe'); // @ts-ignore -require.context('./images/', true); +require.context('./assets/images/', true); // Load stylesheet require('react-datepicker/dist/react-datepicker.css'); diff --git a/app/fonts/OpenDyslexic/LICENSE b/app/assets/fonts/OpenDyslexic/LICENSE similarity index 100% rename from app/fonts/OpenDyslexic/LICENSE rename to app/assets/fonts/OpenDyslexic/LICENSE diff --git a/app/fonts/OpenDyslexic/OpenDyslexic-Bold-Italic.woff2 b/app/assets/fonts/OpenDyslexic/OpenDyslexic-Bold-Italic.woff2 similarity index 100% rename from app/fonts/OpenDyslexic/OpenDyslexic-Bold-Italic.woff2 rename to app/assets/fonts/OpenDyslexic/OpenDyslexic-Bold-Italic.woff2 diff --git a/app/fonts/OpenDyslexic/OpenDyslexic-Bold.woff2 b/app/assets/fonts/OpenDyslexic/OpenDyslexic-Bold.woff2 similarity index 100% rename from app/fonts/OpenDyslexic/OpenDyslexic-Bold.woff2 rename to app/assets/fonts/OpenDyslexic/OpenDyslexic-Bold.woff2 diff --git a/app/fonts/OpenDyslexic/OpenDyslexic-Italic.woff2 b/app/assets/fonts/OpenDyslexic/OpenDyslexic-Italic.woff2 similarity index 100% rename from app/fonts/OpenDyslexic/OpenDyslexic-Italic.woff2 rename to app/assets/fonts/OpenDyslexic/OpenDyslexic-Italic.woff2 diff --git a/app/fonts/OpenDyslexic/OpenDyslexic-Regular.woff2 b/app/assets/fonts/OpenDyslexic/OpenDyslexic-Regular.woff2 similarity index 100% rename from app/fonts/OpenDyslexic/OpenDyslexic-Regular.woff2 rename to app/assets/fonts/OpenDyslexic/OpenDyslexic-Regular.woff2 diff --git a/app/fonts/soapbox/soapbox.eot b/app/assets/fonts/soapbox/soapbox.eot similarity index 100% rename from app/fonts/soapbox/soapbox.eot rename to app/assets/fonts/soapbox/soapbox.eot diff --git a/app/fonts/soapbox/soapbox.svg b/app/assets/fonts/soapbox/soapbox.svg similarity index 100% rename from app/fonts/soapbox/soapbox.svg rename to app/assets/fonts/soapbox/soapbox.svg diff --git a/app/fonts/soapbox/soapbox.ttf b/app/assets/fonts/soapbox/soapbox.ttf similarity index 100% rename from app/fonts/soapbox/soapbox.ttf rename to app/assets/fonts/soapbox/soapbox.ttf diff --git a/app/fonts/soapbox/soapbox.woff b/app/assets/fonts/soapbox/soapbox.woff similarity index 100% rename from app/fonts/soapbox/soapbox.woff rename to app/assets/fonts/soapbox/soapbox.woff diff --git a/app/icons/COPYING.md b/app/assets/icons/COPYING.md similarity index 100% rename from app/icons/COPYING.md rename to app/assets/icons/COPYING.md diff --git a/app/icons/airplane.svg b/app/assets/icons/airplane.svg similarity index 100% rename from app/icons/airplane.svg rename to app/assets/icons/airplane.svg diff --git a/app/icons/fediverse.svg b/app/assets/icons/fediverse.svg similarity index 100% rename from app/icons/fediverse.svg rename to app/assets/icons/fediverse.svg diff --git a/app/icons/verified.svg b/app/assets/icons/verified.svg similarity index 100% rename from app/icons/verified.svg rename to app/assets/icons/verified.svg diff --git a/app/images/audio-placeholder.png b/app/assets/images/audio-placeholder.png similarity index 100% rename from app/images/audio-placeholder.png rename to app/assets/images/audio-placeholder.png diff --git a/app/images/avatar-missing.png b/app/assets/images/avatar-missing.png similarity index 100% rename from app/images/avatar-missing.png rename to app/assets/images/avatar-missing.png diff --git a/app/images/avatar-missing.svg b/app/assets/images/avatar-missing.svg similarity index 100% rename from app/images/avatar-missing.svg rename to app/assets/images/avatar-missing.svg diff --git a/app/images/header-missing.png b/app/assets/images/header-missing.png similarity index 100% rename from app/images/header-missing.png rename to app/assets/images/header-missing.png diff --git a/app/images/soapbox-logo-white.svg b/app/assets/images/soapbox-logo-white.svg similarity index 100% rename from app/images/soapbox-logo-white.svg rename to app/assets/images/soapbox-logo-white.svg diff --git a/app/images/soapbox-logo.svg b/app/assets/images/soapbox-logo.svg similarity index 100% rename from app/images/soapbox-logo.svg rename to app/assets/images/soapbox-logo.svg diff --git a/app/images/video-placeholder.png b/app/assets/images/video-placeholder.png similarity index 100% rename from app/images/video-placeholder.png rename to app/assets/images/video-placeholder.png diff --git a/app/images/void.png b/app/assets/images/void.png similarity index 100% rename from app/images/void.png rename to app/assets/images/void.png diff --git a/app/images/web-push/web-push-icon_expand.png b/app/assets/images/web-push/web-push-icon_expand.png similarity index 100% rename from app/images/web-push/web-push-icon_expand.png rename to app/assets/images/web-push/web-push-icon_expand.png diff --git a/app/images/web-push/web-push-icon_favourite.png b/app/assets/images/web-push/web-push-icon_favourite.png similarity index 100% rename from app/images/web-push/web-push-icon_favourite.png rename to app/assets/images/web-push/web-push-icon_favourite.png diff --git a/app/images/web-push/web-push-icon_reblog.png b/app/assets/images/web-push/web-push-icon_reblog.png similarity index 100% rename from app/images/web-push/web-push-icon_reblog.png rename to app/assets/images/web-push/web-push-icon_reblog.png diff --git a/app/sounds/boop.mp3 b/app/assets/sounds/boop.mp3 similarity index 100% rename from app/sounds/boop.mp3 rename to app/assets/sounds/boop.mp3 diff --git a/app/sounds/boop.ogg b/app/assets/sounds/boop.ogg similarity index 100% rename from app/sounds/boop.ogg rename to app/assets/sounds/boop.ogg diff --git a/app/sounds/chat.mp3 b/app/assets/sounds/chat.mp3 similarity index 100% rename from app/sounds/chat.mp3 rename to app/assets/sounds/chat.mp3 diff --git a/app/sounds/chat.oga b/app/assets/sounds/chat.oga similarity index 100% rename from app/sounds/chat.oga rename to app/assets/sounds/chat.oga diff --git a/app/icons/bell-filled.svg b/app/icons/bell-filled.svg deleted file mode 100644 index 5f040218e0..0000000000 --- a/app/icons/bell-filled.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/images/halloween/clouds.png b/app/images/halloween/clouds.png deleted file mode 100644 index 29962c1048..0000000000 Binary files a/app/images/halloween/clouds.png and /dev/null differ diff --git a/app/images/halloween/halloween-emblem.svg b/app/images/halloween/halloween-emblem.svg deleted file mode 100644 index ad23be14c9..0000000000 --- a/app/images/halloween/halloween-emblem.svg +++ /dev/null @@ -1,311 +0,0 @@ - - - - Flying Witch during Full Moon - - - - - image/svg+xml - - Flying Witch during Full Moon - 2017-10-10 - - - Urs Roesch - - - - - - OpenClipart - - - - - remix+287475 - remix+288242 - remix+170669 - yellow - moon - yellow moon - full moon - moon - witch - cat - silhouette - bat - bats - flying bat - flying witch - black - dark - night - halloween - walpurgis night - walpurgis - - - Flying witch with cat flying during full moon. - - - gnokii - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/images/halloween/spider.svg b/app/images/halloween/spider.svg deleted file mode 100644 index 077b60d65a..0000000000 --- a/app/images/halloween/spider.svg +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/app/images/halloween/spiderweb.svg b/app/images/halloween/spiderweb.svg deleted file mode 100644 index 16ae81984a..0000000000 --- a/app/images/halloween/spiderweb.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - - - Realistic spider web - - - - - - - image/svg+xml - - - - - Openclipart - - - Realistic spider web - - - - - - - - - diff --git a/app/images/halloween/starfield.png b/app/images/halloween/starfield.png deleted file mode 100644 index 1e79958955..0000000000 Binary files a/app/images/halloween/starfield.png and /dev/null differ diff --git a/app/images/halloween/twinkle.svg b/app/images/halloween/twinkle.svg deleted file mode 100644 index 9869cb094e..0000000000 --- a/app/images/halloween/twinkle.svg +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/app/images/sprite-post-functions.png b/app/images/sprite-post-functions.png deleted file mode 100644 index aea7f57ba9..0000000000 Binary files a/app/images/sprite-post-functions.png and /dev/null differ diff --git a/app/soapbox/__fixtures__/intlMessages.json b/app/soapbox/__fixtures__/intlMessages.json index 54c919e6ad..eb2a35806a 100644 --- a/app/soapbox/__fixtures__/intlMessages.json +++ b/app/soapbox/__fixtures__/intlMessages.json @@ -319,6 +319,7 @@ "poll_button.add_poll": "Add a poll", "poll_button.remove_poll": "Remove poll", "preferences.fields.auto_play_gif_label": "Auto-play animated GIFs", + "preferences.fields.auto_play_video_label": "Auto-play videos", "preferences.fields.boost_modal_label": "Show confirmation dialog before reposting", "preferences.fields.delete_modal_label": "Show confirmation dialog before deleting a post", "preferences.fields.demetricator_label": "Use Demetricator", diff --git a/app/soapbox/actions/__tests__/account-notes.test.ts b/app/soapbox/actions/__tests__/account-notes.test.ts index 61e0c20b09..8b85eecc5e 100644 --- a/app/soapbox/actions/__tests__/account-notes.test.ts +++ b/app/soapbox/actions/__tests__/account-notes.test.ts @@ -2,7 +2,7 @@ import { Map as ImmutableMap } from 'immutable'; import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; -import { ReducerRecord, EditRecord } from 'soapbox/reducers/account_notes'; +import { ReducerRecord, EditRecord } from 'soapbox/reducers/account-notes'; import { normalizeAccount, normalizeRelationship } from '../../normalizers'; import { changeAccountNoteComment, initAccountNoteModal, submitAccountNote } from '../account-notes'; diff --git a/app/soapbox/actions/__tests__/accounts.test.ts b/app/soapbox/actions/__tests__/accounts.test.ts index 0793e36f7b..d9faa02134 100644 --- a/app/soapbox/actions/__tests__/accounts.test.ts +++ b/app/soapbox/actions/__tests__/accounts.test.ts @@ -2,7 +2,7 @@ import { Map as ImmutableMap } from 'immutable'; import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; -import { ListRecord, ReducerRecord } from 'soapbox/reducers/user_lists'; +import { ListRecord, ReducerRecord } from 'soapbox/reducers/user-lists'; import { normalizeAccount, normalizeInstance, normalizeRelationship } from '../../normalizers'; import { diff --git a/app/soapbox/actions/__tests__/blocks.test.ts b/app/soapbox/actions/__tests__/blocks.test.ts index 8b4c040b3e..49f649ab66 100644 --- a/app/soapbox/actions/__tests__/blocks.test.ts +++ b/app/soapbox/actions/__tests__/blocks.test.ts @@ -1,6 +1,6 @@ import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; -import { ListRecord, ReducerRecord as UserListsRecord } from 'soapbox/reducers/user_lists'; +import { ListRecord, ReducerRecord as UserListsRecord } from 'soapbox/reducers/user-lists'; import { expandBlocks, fetchBlocks } from '../blocks'; diff --git a/app/soapbox/actions/__tests__/me.test.ts b/app/soapbox/actions/__tests__/me.test.ts index 6d37fc68c2..c75d128f0c 100644 --- a/app/soapbox/actions/__tests__/me.test.ts +++ b/app/soapbox/actions/__tests__/me.test.ts @@ -7,7 +7,7 @@ import { fetchMe, patchMe, } from '../me'; -jest.mock('../../storage/kv_store', () => ({ +jest.mock('../../storage/kv-store', () => ({ __esModule: true, default: { getItemOrError: jest.fn().mockReturnValue(Promise.resolve({})), diff --git a/app/soapbox/actions/auth.ts b/app/soapbox/actions/auth.ts index d592d9cc3b..5539fd96f1 100644 --- a/app/soapbox/actions/auth.ts +++ b/app/soapbox/actions/auth.ts @@ -16,7 +16,7 @@ import { obtainOAuthToken, revokeOAuthToken } from 'soapbox/actions/oauth'; import { startOnboarding } from 'soapbox/actions/onboarding'; import snackbar from 'soapbox/actions/snackbar'; import { custom } from 'soapbox/custom'; -import KVStore from 'soapbox/storage/kv_store'; +import KVStore from 'soapbox/storage/kv-store'; import { getLoggedInAccount, parseBaseURL } from 'soapbox/utils/auth'; import sourceCode from 'soapbox/utils/code'; import { getFeatures } from 'soapbox/utils/features'; diff --git a/app/soapbox/actions/compose.ts b/app/soapbox/actions/compose.ts index 57e7909a16..3010ae3fdf 100644 --- a/app/soapbox/actions/compose.ts +++ b/app/soapbox/actions/compose.ts @@ -5,12 +5,12 @@ import { defineMessages, IntlShape } from 'react-intl'; import snackbar from 'soapbox/actions/snackbar'; import api from 'soapbox/api'; -import { search as emojiSearch } from 'soapbox/features/emoji/emoji_mart_search_light'; +import { search as emojiSearch } from 'soapbox/features/emoji/emoji-mart-search-light'; import { tagHistory } from 'soapbox/settings'; import { isLoggedIn } from 'soapbox/utils/auth'; import { getFeatures, parseVersion } from 'soapbox/utils/features'; import { formatBytes, getVideoDuration } from 'soapbox/utils/media'; -import resizeImage from 'soapbox/utils/resize_image'; +import resizeImage from 'soapbox/utils/resize-image'; import { showAlert, showAlertForError } from './alerts'; import { useEmoji } from './emojis'; @@ -21,8 +21,8 @@ import { getSettings } from './settings'; import { createStatus } from './statuses'; import type { History } from 'history'; -import type { Emoji } from 'soapbox/components/autosuggest_emoji'; -import type { AutoSuggestion } from 'soapbox/components/autosuggest_input'; +import type { Emoji } from 'soapbox/components/autosuggest-emoji'; +import type { AutoSuggestion } from 'soapbox/components/autosuggest-input'; import type { AppDispatch, RootState } from 'soapbox/store'; import type { Account, APIEntity, Status, Tag } from 'soapbox/types/entities'; diff --git a/app/soapbox/actions/consumer-auth.ts b/app/soapbox/actions/consumer-auth.ts index b669c63931..1719415771 100644 --- a/app/soapbox/actions/consumer-auth.ts +++ b/app/soapbox/actions/consumer-auth.ts @@ -1,6 +1,6 @@ import axios from 'axios'; -import * as BuildConfig from 'soapbox/build_config'; +import * as BuildConfig from 'soapbox/build-config'; import { isURL } from 'soapbox/utils/auth'; import sourceCode from 'soapbox/utils/code'; import { getFeatures } from 'soapbox/utils/features'; diff --git a/app/soapbox/actions/custom_emojis.ts b/app/soapbox/actions/custom-emojis.ts similarity index 100% rename from app/soapbox/actions/custom_emojis.ts rename to app/soapbox/actions/custom-emojis.ts diff --git a/app/soapbox/actions/domain_blocks.ts b/app/soapbox/actions/domain-blocks.ts similarity index 100% rename from app/soapbox/actions/domain_blocks.ts rename to app/soapbox/actions/domain-blocks.ts diff --git a/app/soapbox/actions/dropdown_menu.ts b/app/soapbox/actions/dropdown-menu.ts similarity index 97% rename from app/soapbox/actions/dropdown_menu.ts rename to app/soapbox/actions/dropdown-menu.ts index 2c19735a10..0c6fc85363 100644 --- a/app/soapbox/actions/dropdown_menu.ts +++ b/app/soapbox/actions/dropdown-menu.ts @@ -1,4 +1,4 @@ -import type { DropdownPlacement } from 'soapbox/components/dropdown_menu'; +import type { DropdownPlacement } from 'soapbox/components/dropdown-menu'; const DROPDOWN_MENU_OPEN = 'DROPDOWN_MENU_OPEN'; const DROPDOWN_MENU_CLOSE = 'DROPDOWN_MENU_CLOSE'; diff --git a/app/soapbox/actions/email_list.ts b/app/soapbox/actions/email-list.ts similarity index 100% rename from app/soapbox/actions/email_list.ts rename to app/soapbox/actions/email-list.ts diff --git a/app/soapbox/actions/emoji_reacts.ts b/app/soapbox/actions/emoji-reacts.ts similarity index 100% rename from app/soapbox/actions/emoji_reacts.ts rename to app/soapbox/actions/emoji-reacts.ts diff --git a/app/soapbox/actions/emojis.ts b/app/soapbox/actions/emojis.ts index 04bda6c899..46f591b060 100644 --- a/app/soapbox/actions/emojis.ts +++ b/app/soapbox/actions/emojis.ts @@ -1,6 +1,6 @@ import { saveSettings } from './settings'; -import type { Emoji } from 'soapbox/components/autosuggest_emoji'; +import type { Emoji } from 'soapbox/components/autosuggest-emoji'; import type { AppDispatch } from 'soapbox/store'; const EMOJI_USE = 'EMOJI_USE'; diff --git a/app/soapbox/actions/export_data.ts b/app/soapbox/actions/export-data.ts similarity index 100% rename from app/soapbox/actions/export_data.ts rename to app/soapbox/actions/export-data.ts diff --git a/app/soapbox/actions/external_auth.ts b/app/soapbox/actions/external-auth.ts similarity index 100% rename from app/soapbox/actions/external_auth.ts rename to app/soapbox/actions/external-auth.ts diff --git a/app/soapbox/actions/familiar_followers.ts b/app/soapbox/actions/familiar-followers.ts similarity index 100% rename from app/soapbox/actions/familiar_followers.ts rename to app/soapbox/actions/familiar-followers.ts diff --git a/app/soapbox/actions/import_data.ts b/app/soapbox/actions/import-data.ts similarity index 100% rename from app/soapbox/actions/import_data.ts rename to app/soapbox/actions/import-data.ts diff --git a/app/soapbox/actions/instance.ts b/app/soapbox/actions/instance.ts index 151ad3672c..ca1fc3ef5e 100644 --- a/app/soapbox/actions/instance.ts +++ b/app/soapbox/actions/instance.ts @@ -1,7 +1,7 @@ import { createAsyncThunk } from '@reduxjs/toolkit'; import get from 'lodash/get'; -import KVStore from 'soapbox/storage/kv_store'; +import KVStore from 'soapbox/storage/kv-store'; import { RootState } from 'soapbox/store'; import { getAuthUserUrl } from 'soapbox/utils/auth'; import { parseVersion } from 'soapbox/utils/features'; diff --git a/app/soapbox/actions/me.ts b/app/soapbox/actions/me.ts index e76399d21c..17beae21d8 100644 --- a/app/soapbox/actions/me.ts +++ b/app/soapbox/actions/me.ts @@ -1,4 +1,4 @@ -import KVStore from 'soapbox/storage/kv_store'; +import KVStore from 'soapbox/storage/kv-store'; import { getAuthUserId, getAuthUserUrl } from 'soapbox/utils/auth'; import api from '../api'; diff --git a/app/soapbox/actions/modals.ts b/app/soapbox/actions/modals.ts index 00d4fd01a4..83b52cb3e2 100644 --- a/app/soapbox/actions/modals.ts +++ b/app/soapbox/actions/modals.ts @@ -1,4 +1,4 @@ -import type { ModalType } from 'soapbox/features/ui/components/modal_root'; +import type { ModalType } from 'soapbox/features/ui/components/modal-root'; export const MODAL_OPEN = 'MODAL_OPEN'; export const MODAL_CLOSE = 'MODAL_CLOSE'; diff --git a/app/soapbox/actions/moderation.tsx b/app/soapbox/actions/moderation.tsx index bf0ccf3327..1791500b5d 100644 --- a/app/soapbox/actions/moderation.tsx +++ b/app/soapbox/actions/moderation.tsx @@ -7,7 +7,7 @@ import { openModal } from 'soapbox/actions/modals'; import snackbar from 'soapbox/actions/snackbar'; import OutlineBox from 'soapbox/components/outline-box'; import { Stack, Text } from 'soapbox/components/ui'; -import AccountContainer from 'soapbox/containers/account_container'; +import AccountContainer from 'soapbox/containers/account-container'; import { isLocal } from 'soapbox/utils/accounts'; import type { AppDispatch, RootState } from 'soapbox/store'; diff --git a/app/soapbox/actions/mrf.ts b/app/soapbox/actions/mrf.ts index e2cef5938f..1b9cbad931 100644 --- a/app/soapbox/actions/mrf.ts +++ b/app/soapbox/actions/mrf.ts @@ -1,11 +1,11 @@ import { Map as ImmutableMap, Set as ImmutableSet } from 'immutable'; -import ConfigDB from 'soapbox/utils/config_db'; +import ConfigDB from 'soapbox/utils/config-db'; import { fetchConfig, updateConfig } from './admin'; import type { AppDispatch, RootState } from 'soapbox/store'; -import type { Policy } from 'soapbox/utils/config_db'; +import type { Policy } from 'soapbox/utils/config-db'; const simplePolicyMerge = (simplePolicy: Policy, host: string, restrictions: ImmutableMap) => { return simplePolicy.map((hosts, key) => { diff --git a/app/soapbox/actions/notifications.ts b/app/soapbox/actions/notifications.ts index eef4dc21d6..93908f7bb4 100644 --- a/app/soapbox/actions/notifications.ts +++ b/app/soapbox/actions/notifications.ts @@ -3,9 +3,9 @@ import 'intl-pluralrules'; import { defineMessages } from 'react-intl'; import api, { getLinks } from 'soapbox/api'; -import compareId from 'soapbox/compare_id'; import { getFilters, regexFromFilters } from 'soapbox/selectors'; import { isLoggedIn } from 'soapbox/utils/auth'; +import { compareId } from 'soapbox/utils/comparators'; import { getFeatures, parseVersion, PLEROMA } from 'soapbox/utils/features'; import { unescapeHTML } from 'soapbox/utils/html'; import { EXCLUDE_TYPES, NOTIFICATION_TYPES } from 'soapbox/utils/notification'; diff --git a/app/soapbox/actions/pin_statuses.ts b/app/soapbox/actions/pin-statuses.ts similarity index 100% rename from app/soapbox/actions/pin_statuses.ts rename to app/soapbox/actions/pin-statuses.ts diff --git a/app/soapbox/actions/profile_hover_card.ts b/app/soapbox/actions/profile-hover-card.ts similarity index 100% rename from app/soapbox/actions/profile_hover_card.ts rename to app/soapbox/actions/profile-hover-card.ts diff --git a/app/soapbox/actions/push_notifications/index.ts b/app/soapbox/actions/push-notifications/index.ts similarity index 100% rename from app/soapbox/actions/push_notifications/index.ts rename to app/soapbox/actions/push-notifications/index.ts diff --git a/app/soapbox/actions/push_notifications/registerer.ts b/app/soapbox/actions/push-notifications/registerer.ts similarity index 99% rename from app/soapbox/actions/push_notifications/registerer.ts rename to app/soapbox/actions/push-notifications/registerer.ts index e66e3a01ac..3a9d4fb9e6 100644 --- a/app/soapbox/actions/push_notifications/registerer.ts +++ b/app/soapbox/actions/push-notifications/registerer.ts @@ -1,4 +1,4 @@ -import { createPushSubscription, updatePushSubscription } from 'soapbox/actions/push_subscriptions'; +import { createPushSubscription, updatePushSubscription } from 'soapbox/actions/push-subscriptions'; import { pushNotificationsSetting } from 'soapbox/settings'; import { getVapidKey } from 'soapbox/utils/auth'; import { decode as decodeBase64 } from 'soapbox/utils/base64'; diff --git a/app/soapbox/actions/push_notifications/setter.ts b/app/soapbox/actions/push-notifications/setter.ts similarity index 100% rename from app/soapbox/actions/push_notifications/setter.ts rename to app/soapbox/actions/push-notifications/setter.ts diff --git a/app/soapbox/actions/push_subscriptions.ts b/app/soapbox/actions/push-subscriptions.ts similarity index 100% rename from app/soapbox/actions/push_subscriptions.ts rename to app/soapbox/actions/push-subscriptions.ts diff --git a/app/soapbox/actions/remote_timeline.ts b/app/soapbox/actions/remote-timeline.ts similarity index 100% rename from app/soapbox/actions/remote_timeline.ts rename to app/soapbox/actions/remote-timeline.ts diff --git a/app/soapbox/actions/scheduled_statuses.ts b/app/soapbox/actions/scheduled-statuses.ts similarity index 100% rename from app/soapbox/actions/scheduled_statuses.ts rename to app/soapbox/actions/scheduled-statuses.ts diff --git a/app/soapbox/actions/soapbox.ts b/app/soapbox/actions/soapbox.ts index 89d3080d83..725ff1ae31 100644 --- a/app/soapbox/actions/soapbox.ts +++ b/app/soapbox/actions/soapbox.ts @@ -2,7 +2,7 @@ import { createSelector } from 'reselect'; import { getHost } from 'soapbox/actions/instance'; import { normalizeSoapboxConfig } from 'soapbox/normalizers'; -import KVStore from 'soapbox/storage/kv_store'; +import KVStore from 'soapbox/storage/kv-store'; import { removeVS16s } from 'soapbox/utils/emoji'; import { getFeatures } from 'soapbox/utils/features'; diff --git a/app/soapbox/actions/trending_statuses.ts b/app/soapbox/actions/trending-statuses.ts similarity index 100% rename from app/soapbox/actions/trending_statuses.ts rename to app/soapbox/actions/trending-statuses.ts diff --git a/app/soapbox/__mocks__/api.ts b/app/soapbox/api/__mocks__/index.ts similarity index 93% rename from app/soapbox/__mocks__/api.ts rename to app/soapbox/api/__mocks__/index.ts index 6e9c753154..92175d076b 100644 --- a/app/soapbox/__mocks__/api.ts +++ b/app/soapbox/api/__mocks__/index.ts @@ -4,7 +4,7 @@ import LinkHeader from 'http-link-header'; import type { AxiosInstance, AxiosResponse } from 'axios'; -const api = jest.requireActual('../api') as Record; +const api = jest.requireActual('../index') as Record; let mocks: Array = []; export const __stub = (func: (mock: MockAdapter) => void) => mocks.push(func); diff --git a/app/soapbox/api.ts b/app/soapbox/api/index.ts similarity index 75% rename from app/soapbox/api.ts rename to app/soapbox/api/index.ts index bdcaf53d80..97d7d25d71 100644 --- a/app/soapbox/api.ts +++ b/app/soapbox/api/index.ts @@ -9,18 +9,18 @@ import axios, { AxiosInstance, AxiosResponse } from 'axios'; import LinkHeader from 'http-link-header'; import { createSelector } from 'reselect'; -import * as BuildConfig from 'soapbox/build_config'; +import * as BuildConfig from 'soapbox/build-config'; import { RootState } from 'soapbox/store'; import { getAccessToken, getAppToken, isURL, parseBaseURL } from 'soapbox/utils/auth'; import type MockAdapter from 'axios-mock-adapter'; /** - Parse Link headers, mostly for pagination. - @see {@link https://www.npmjs.com/package/http-link-header} - @param {object} response - Axios response object - @returns {object} Link object - */ + Parse Link headers, mostly for pagination. + @see {@link https://www.npmjs.com/package/http-link-header} + @param {object} response - Axios response object + @returns {object} Link object + */ export const getLinks = (response: AxiosResponse): LinkHeader => { return new LinkHeader(response.headers?.link); }; @@ -50,11 +50,11 @@ const getAuthBaseURL = createSelector([ }); /** - * Base client for HTTP requests. - * @param {string} accessToken - * @param {string} baseURL - * @returns {object} Axios instance - */ + * Base client for HTTP requests. + * @param {string} accessToken + * @param {string} baseURL + * @returns {object} Axios instance + */ export const baseClient = (accessToken?: string | null, baseURL: string = ''): AxiosInstance => { return axios.create({ // When BACKEND_URL is set, always use it. @@ -68,22 +68,22 @@ export const baseClient = (accessToken?: string | null, baseURL: string = ''): A }; /** - * Dumb client for grabbing static files. - * It uses FE_SUBDIRECTORY and parses JSON if possible. - * No authorization is needed. - */ + * Dumb client for grabbing static files. + * It uses FE_SUBDIRECTORY and parses JSON if possible. + * No authorization is needed. + */ export const staticClient = axios.create({ baseURL: BuildConfig.FE_SUBDIRECTORY, transformResponse: [maybeParseJSON], }); /** - * Stateful API client. - * Uses credentials from the Redux store if available. - * @param {function} getState - Must return the Redux state - * @param {string} authType - Either 'user' or 'app' - * @returns {object} Axios instance - */ + * Stateful API client. + * Uses credentials from the Redux store if available. + * @param {function} getState - Must return the Redux state + * @param {string} authType - Either 'user' or 'app' + * @returns {object} Axios instance + */ export default (getState: () => RootState, authType: string = 'user'): AxiosInstance => { const state = getState(); const accessToken = getToken(state, authType); diff --git a/app/soapbox/base_polyfills.ts b/app/soapbox/base-polyfills.ts similarity index 100% rename from app/soapbox/base_polyfills.ts rename to app/soapbox/base-polyfills.ts diff --git a/app/soapbox/build_config.js b/app/soapbox/build-config.js similarity index 96% rename from app/soapbox/build_config.js rename to app/soapbox/build-config.js index 04b48bf781..a11faa0e89 100644 Binary files a/app/soapbox/build_config.js and b/app/soapbox/build-config.js differ diff --git a/app/soapbox/components/__tests__/autosuggest_emoji.test.tsx b/app/soapbox/components/__tests__/autosuggest-emoji.test.tsx similarity index 94% rename from app/soapbox/components/__tests__/autosuggest_emoji.test.tsx rename to app/soapbox/components/__tests__/autosuggest-emoji.test.tsx index 8fab0ef8b0..e2f059ff7b 100644 --- a/app/soapbox/components/__tests__/autosuggest_emoji.test.tsx +++ b/app/soapbox/components/__tests__/autosuggest-emoji.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { render, screen } from '../../jest/test-helpers'; -import AutosuggestEmoji from '../autosuggest_emoji'; +import AutosuggestEmoji from '../autosuggest-emoji'; describe('', () => { it('renders native emoji', () => { diff --git a/app/soapbox/components/__tests__/avatar_overlay.test.tsx b/app/soapbox/components/__tests__/avatar-overlay.test.tsx similarity index 94% rename from app/soapbox/components/__tests__/avatar_overlay.test.tsx rename to app/soapbox/components/__tests__/avatar-overlay.test.tsx index 1058285565..4e83dd0715 100644 --- a/app/soapbox/components/__tests__/avatar_overlay.test.tsx +++ b/app/soapbox/components/__tests__/avatar-overlay.test.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { normalizeAccount } from 'soapbox/normalizers'; import { render, screen } from '../../jest/test-helpers'; -import AvatarOverlay from '../avatar_overlay'; +import AvatarOverlay from '../avatar-overlay'; import type { ReducerAccount } from 'soapbox/reducers/accounts'; diff --git a/app/soapbox/components/__tests__/display_name.test.tsx b/app/soapbox/components/__tests__/display-name.test.tsx similarity index 100% rename from app/soapbox/components/__tests__/display_name.test.tsx rename to app/soapbox/components/__tests__/display-name.test.tsx diff --git a/app/soapbox/components/__tests__/emoji_selector.test.tsx b/app/soapbox/components/__tests__/emoji-selector.test.tsx similarity index 88% rename from app/soapbox/components/__tests__/emoji_selector.test.tsx rename to app/soapbox/components/__tests__/emoji-selector.test.tsx index c680d156e8..b382a4b94b 100644 --- a/app/soapbox/components/__tests__/emoji_selector.test.tsx +++ b/app/soapbox/components/__tests__/emoji-selector.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { render, screen } from '../../jest/test-helpers'; -import EmojiSelector from '../emoji_selector'; +import EmojiSelector from '../emoji-selector'; describe('', () => { it('renders correctly', () => { diff --git a/app/soapbox/components/account_search.tsx b/app/soapbox/components/account-search.tsx similarity index 99% rename from app/soapbox/components/account_search.tsx rename to app/soapbox/components/account-search.tsx index dad699f0db..8b3f50b207 100644 --- a/app/soapbox/components/account_search.tsx +++ b/app/soapbox/components/account-search.tsx @@ -2,7 +2,7 @@ import classNames from 'clsx'; import React, { useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import AutosuggestAccountInput from 'soapbox/components/autosuggest_account_input'; +import AutosuggestAccountInput from 'soapbox/components/autosuggest-account-input'; import SvgIcon from './ui/icon/svg-icon'; import { InputThemes } from './ui/input/input'; diff --git a/app/soapbox/components/account.tsx b/app/soapbox/components/account.tsx index e981e66aee..006584e8d1 100644 --- a/app/soapbox/components/account.tsx +++ b/app/soapbox/components/account.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { Link, useHistory } from 'react-router-dom'; -import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper'; -import VerificationBadge from 'soapbox/components/verification_badge'; +import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper'; +import VerificationBadge from 'soapbox/components/verification-badge'; import ActionButton from 'soapbox/features/ui/components/action-button'; import { useAppSelector, useOnScreen } from 'soapbox/hooks'; import { getAcct } from 'soapbox/utils/accounts'; diff --git a/app/soapbox/components/announcements/emoji.tsx b/app/soapbox/components/announcements/emoji.tsx index eb9683f082..64266639d5 100644 --- a/app/soapbox/components/announcements/emoji.tsx +++ b/app/soapbox/components/announcements/emoji.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import unicodeMapping from 'soapbox/features/emoji/emoji_unicode_mapping_light'; +import unicodeMapping from 'soapbox/features/emoji/emoji-unicode-mapping-light'; import { useSettings } from 'soapbox/hooks'; import { joinPublicPath } from 'soapbox/utils/static'; diff --git a/app/soapbox/components/announcements/reaction.tsx b/app/soapbox/components/announcements/reaction.tsx index 8e2391aec7..2306137019 100644 --- a/app/soapbox/components/announcements/reaction.tsx +++ b/app/soapbox/components/announcements/reaction.tsx @@ -2,7 +2,7 @@ import classNames from 'clsx'; import React, { useState } from 'react'; import AnimatedNumber from 'soapbox/components/animated-number'; -import unicodeMapping from 'soapbox/features/emoji/emoji_unicode_mapping_light'; +import unicodeMapping from 'soapbox/features/emoji/emoji-unicode-mapping-light'; import Emoji from './emoji'; diff --git a/app/soapbox/components/announcements/reactions-bar.tsx b/app/soapbox/components/announcements/reactions-bar.tsx index 130db2d994..f9569fb903 100644 --- a/app/soapbox/components/announcements/reactions-bar.tsx +++ b/app/soapbox/components/announcements/reactions-bar.tsx @@ -9,7 +9,7 @@ import { useSettings } from 'soapbox/hooks'; import Reaction from './reaction'; import type { List as ImmutableList, Map as ImmutableMap } from 'immutable'; -import type { Emoji } from 'soapbox/components/autosuggest_emoji'; +import type { Emoji } from 'soapbox/components/autosuggest-emoji'; import type { AnnouncementReaction } from 'soapbox/types/entities'; interface IReactionsBar { diff --git a/app/soapbox/components/attachment_list.tsx b/app/soapbox/components/attachment_list.tsx deleted file mode 100644 index 94c496819e..0000000000 --- a/app/soapbox/components/attachment_list.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import React from 'react'; - -import Icon from 'soapbox/components/icon'; - -import type { Attachment as AttachmentEntity } from 'soapbox/types/entities'; - -const filename = (url: string) => url.split('/').pop()!.split('#')[0].split('?')[0]; - -interface IAttachmentList { - media: AttachmentEntity[], - compact?: boolean, -} - -const AttachmentList: React.FC = ({ media, compact }) => { - if (compact) { - return ( -
-
    - {media.map(attachment => { - const displayUrl = attachment.get('remote_url') || attachment.get('url'); - - return ( -
  • - {filename(displayUrl)} -
  • - ); - })} -
-
- ); - } - - return ( -
-
- -
- -
    - {media.map(attachment => { - const displayUrl = attachment.get('remote_url') || attachment.get('url'); - - return ( -
  • - {filename(displayUrl)} -
  • - ); - })} -
-
- ); -}; - -export default AttachmentList; diff --git a/app/soapbox/components/autosuggest_account_input.tsx b/app/soapbox/components/autosuggest-account-input.tsx similarity index 96% rename from app/soapbox/components/autosuggest_account_input.tsx rename to app/soapbox/components/autosuggest-account-input.tsx index a69b449c7d..9aebe9f6f8 100644 --- a/app/soapbox/components/autosuggest_account_input.tsx +++ b/app/soapbox/components/autosuggest-account-input.tsx @@ -3,10 +3,10 @@ import throttle from 'lodash/throttle'; import React, { useState, useRef, useCallback, useEffect } from 'react'; import { accountSearch } from 'soapbox/actions/accounts'; -import AutosuggestInput, { AutoSuggestion } from 'soapbox/components/autosuggest_input'; +import AutosuggestInput, { AutoSuggestion } from 'soapbox/components/autosuggest-input'; import { useAppDispatch } from 'soapbox/hooks'; -import type { Menu } from 'soapbox/components/dropdown_menu'; +import type { Menu } from 'soapbox/components/dropdown-menu'; import type { InputThemes } from 'soapbox/components/ui/input/input'; const noOp = () => { }; diff --git a/app/soapbox/components/autosuggest_emoji.tsx b/app/soapbox/components/autosuggest-emoji.tsx similarity index 92% rename from app/soapbox/components/autosuggest_emoji.tsx rename to app/soapbox/components/autosuggest-emoji.tsx index 22979d4542..7074605a2e 100644 --- a/app/soapbox/components/autosuggest_emoji.tsx +++ b/app/soapbox/components/autosuggest-emoji.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import unicodeMapping from 'soapbox/features/emoji/emoji_unicode_mapping_light'; +import unicodeMapping from 'soapbox/features/emoji/emoji-unicode-mapping-light'; import { joinPublicPath } from 'soapbox/utils/static'; export type Emoji = { diff --git a/app/soapbox/components/autosuggest_input.tsx b/app/soapbox/components/autosuggest-input.tsx similarity index 99% rename from app/soapbox/components/autosuggest_input.tsx rename to app/soapbox/components/autosuggest-input.tsx index 531c3c0337..dc5912a012 100644 --- a/app/soapbox/components/autosuggest_input.tsx +++ b/app/soapbox/components/autosuggest-input.tsx @@ -4,13 +4,13 @@ import { List as ImmutableList } from 'immutable'; import React from 'react'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import AutosuggestEmoji, { Emoji } from 'soapbox/components/autosuggest_emoji'; +import AutosuggestEmoji, { Emoji } from 'soapbox/components/autosuggest-emoji'; import Icon from 'soapbox/components/icon'; import { Input } from 'soapbox/components/ui'; -import AutosuggestAccount from 'soapbox/features/compose/components/autosuggest_account'; +import AutosuggestAccount from 'soapbox/features/compose/components/autosuggest-account'; import { isRtl } from 'soapbox/rtl'; -import type { Menu, MenuItem } from 'soapbox/components/dropdown_menu'; +import type { Menu, MenuItem } from 'soapbox/components/dropdown-menu'; import type { InputThemes } from 'soapbox/components/ui/input/input'; type CursorMatch = [ diff --git a/app/soapbox/components/autosuggest_textarea.tsx b/app/soapbox/components/autosuggest-textarea.tsx similarity index 99% rename from app/soapbox/components/autosuggest_textarea.tsx rename to app/soapbox/components/autosuggest-textarea.tsx index 4f80d0b3bc..8e877021f4 100644 --- a/app/soapbox/components/autosuggest_textarea.tsx +++ b/app/soapbox/components/autosuggest-textarea.tsx @@ -4,10 +4,10 @@ import React from 'react'; import ImmutablePureComponent from 'react-immutable-pure-component'; import Textarea from 'react-textarea-autosize'; -import AutosuggestAccount from '../features/compose/components/autosuggest_account'; +import AutosuggestAccount from '../features/compose/components/autosuggest-account'; import { isRtl } from '../rtl'; -import AutosuggestEmoji, { Emoji } from './autosuggest_emoji'; +import AutosuggestEmoji, { Emoji } from './autosuggest-emoji'; import type { List as ImmutableList } from 'immutable'; diff --git a/app/soapbox/components/avatar_overlay.tsx b/app/soapbox/components/avatar-overlay.tsx similarity index 89% rename from app/soapbox/components/avatar_overlay.tsx rename to app/soapbox/components/avatar-overlay.tsx index ae38b5e4c8..a463b35ce4 100644 --- a/app/soapbox/components/avatar_overlay.tsx +++ b/app/soapbox/components/avatar-overlay.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import StillImage from 'soapbox/components/still_image'; +import StillImage from 'soapbox/components/still-image'; import type { Account as AccountEntity } from 'soapbox/types/entities'; diff --git a/app/soapbox/components/avatar.tsx b/app/soapbox/components/avatar.tsx index 4f40d46bb0..4bc5c07748 100644 --- a/app/soapbox/components/avatar.tsx +++ b/app/soapbox/components/avatar.tsx @@ -1,7 +1,7 @@ import classNames from 'clsx'; import React from 'react'; -import StillImage from 'soapbox/components/still_image'; +import StillImage from 'soapbox/components/still-image'; import type { Account } from 'soapbox/types/entities'; diff --git a/app/soapbox/components/birthday_input.tsx b/app/soapbox/components/birthday-input.tsx similarity index 98% rename from app/soapbox/components/birthday_input.tsx rename to app/soapbox/components/birthday-input.tsx index fc9521ca04..21a10a1e59 100644 --- a/app/soapbox/components/birthday_input.tsx +++ b/app/soapbox/components/birthday-input.tsx @@ -1,8 +1,8 @@ import React, { useMemo } from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import IconButton from 'soapbox/components/icon_button'; -import BundleContainer from 'soapbox/features/ui/containers/bundle_container'; +import IconButton from 'soapbox/components/icon-button'; +import BundleContainer from 'soapbox/features/ui/containers/bundle-container'; import { DatePicker } from 'soapbox/features/ui/util/async-components'; import { useAppSelector, useFeatures } from 'soapbox/hooks'; diff --git a/app/soapbox/components/birthday-panel.tsx b/app/soapbox/components/birthday-panel.tsx index 8381203b95..059b8678b3 100644 --- a/app/soapbox/components/birthday-panel.tsx +++ b/app/soapbox/components/birthday-panel.tsx @@ -4,7 +4,7 @@ import { FormattedMessage } from 'react-intl'; import { fetchBirthdayReminders } from 'soapbox/actions/accounts'; import { Widget } from 'soapbox/components/ui'; -import AccountContainer from 'soapbox/containers/account_container'; +import AccountContainer from 'soapbox/containers/account-container'; import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; const timeToMidnight = () => { diff --git a/app/soapbox/components/column_header.js b/app/soapbox/components/column-header.js similarity index 98% rename from app/soapbox/components/column_header.js rename to app/soapbox/components/column-header.js index 83a61b7ea2..2d915c9f81 100644 Binary files a/app/soapbox/components/column_header.js and b/app/soapbox/components/column-header.js differ diff --git a/app/soapbox/components/display-name.tsx b/app/soapbox/components/display-name.tsx index 63028ccfef..8fd2bfa539 100644 --- a/app/soapbox/components/display-name.tsx +++ b/app/soapbox/components/display-name.tsx @@ -1,13 +1,13 @@ import * as React from 'react'; -import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper'; +import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper'; import { useSoapboxConfig } from 'soapbox/hooks'; import { getAcct } from '../utils/accounts'; import Icon from './icon'; import RelativeTimestamp from './relative-timestamp'; -import VerificationBadge from './verification_badge'; +import VerificationBadge from './verification-badge'; import type { Account } from 'soapbox/types/entities'; diff --git a/app/soapbox/components/domain.tsx b/app/soapbox/components/domain.tsx index 22c8272de2..a8096523bd 100644 --- a/app/soapbox/components/domain.tsx +++ b/app/soapbox/components/domain.tsx @@ -2,9 +2,9 @@ import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { useDispatch } from 'react-redux'; -import { unblockDomain } from 'soapbox/actions/domain_blocks'; +import { unblockDomain } from 'soapbox/actions/domain-blocks'; -import IconButton from './icon_button'; +import IconButton from './icon-button'; const messages = defineMessages({ blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' }, diff --git a/app/soapbox/components/dropdown_menu.tsx b/app/soapbox/components/dropdown-menu.tsx similarity index 99% rename from app/soapbox/components/dropdown_menu.tsx rename to app/soapbox/components/dropdown-menu.tsx index 5bf0612c7a..1e54bc4f64 100644 --- a/app/soapbox/components/dropdown_menu.tsx +++ b/app/soapbox/components/dropdown-menu.tsx @@ -8,7 +8,7 @@ import { withRouter, RouteComponentProps } from 'react-router-dom'; import { IconButton, Counter } from 'soapbox/components/ui'; import SvgIcon from 'soapbox/components/ui/icon/svg-icon'; -import Motion from 'soapbox/features/ui/util/optional_motion'; +import Motion from 'soapbox/features/ui/util/optional-motion'; import type { Status } from 'soapbox/types/entities'; diff --git a/app/soapbox/components/emoji-button-wrapper.tsx b/app/soapbox/components/emoji-button-wrapper.tsx index d85d22627f..23a165fcbc 100644 --- a/app/soapbox/components/emoji-button-wrapper.tsx +++ b/app/soapbox/components/emoji-button-wrapper.tsx @@ -3,12 +3,12 @@ import React, { useState, useEffect, useRef } from 'react'; import { usePopper } from 'react-popper'; import { useDispatch } from 'react-redux'; -import { simpleEmojiReact } from 'soapbox/actions/emoji_reacts'; +import { simpleEmojiReact } from 'soapbox/actions/emoji-reacts'; import { openModal } from 'soapbox/actions/modals'; import EmojiSelector from 'soapbox/components/ui/emoji-selector/emoji-selector'; import { useAppSelector, useOwnAccount, useSoapboxConfig } from 'soapbox/hooks'; -import { isUserTouching } from 'soapbox/is_mobile'; -import { getReactForStatus } from 'soapbox/utils/emoji_reacts'; +import { isUserTouching } from 'soapbox/is-mobile'; +import { getReactForStatus } from 'soapbox/utils/emoji-reacts'; interface IEmojiButtonWrapper { statusId: string, diff --git a/app/soapbox/components/emoji_selector.tsx b/app/soapbox/components/emoji-selector.tsx similarity index 100% rename from app/soapbox/components/emoji_selector.tsx rename to app/soapbox/components/emoji-selector.tsx diff --git a/app/soapbox/components/error_boundary.tsx b/app/soapbox/components/error-boundary.tsx similarity index 98% rename from app/soapbox/components/error_boundary.tsx rename to app/soapbox/components/error-boundary.tsx index 76adf97284..830f3e679e 100644 --- a/app/soapbox/components/error_boundary.tsx +++ b/app/soapbox/components/error-boundary.tsx @@ -3,10 +3,10 @@ import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import { getSoapboxConfig } from 'soapbox/actions/soapbox'; -import * as BuildConfig from 'soapbox/build_config'; +import * as BuildConfig from 'soapbox/build-config'; import { Text, Stack } from 'soapbox/components/ui'; import { captureException } from 'soapbox/monitoring'; -import KVStore from 'soapbox/storage/kv_store'; +import KVStore from 'soapbox/storage/kv-store'; import sourceCode from 'soapbox/utils/code'; import { unregisterSw } from 'soapbox/utils/sw'; diff --git a/app/soapbox/components/extended_video_player.tsx b/app/soapbox/components/extended-video-player.tsx similarity index 97% rename from app/soapbox/components/extended_video_player.tsx rename to app/soapbox/components/extended-video-player.tsx index 99a0af01c4..ec7e7f3f46 100644 --- a/app/soapbox/components/extended_video_player.tsx +++ b/app/soapbox/components/extended-video-player.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef } from 'react'; -import { isIOS } from 'soapbox/is_mobile'; +import { isIOS } from 'soapbox/is-mobile'; interface IExtendedVideoPlayer { src: string, diff --git a/app/soapbox/components/fork_awesome_icon.tsx b/app/soapbox/components/fork-awesome-icon.tsx similarity index 100% rename from app/soapbox/components/fork_awesome_icon.tsx rename to app/soapbox/components/fork-awesome-icon.tsx diff --git a/app/soapbox/components/helmet.tsx b/app/soapbox/components/helmet.tsx index cd13dd30a4..ba4a82fd32 100644 --- a/app/soapbox/components/helmet.tsx +++ b/app/soapbox/components/helmet.tsx @@ -3,7 +3,7 @@ import { Helmet as ReactHelmet } from 'react-helmet'; import { useAppSelector, useSettings } from 'soapbox/hooks'; import { RootState } from 'soapbox/store'; -import FaviconService from 'soapbox/utils/favicon_service'; +import FaviconService from 'soapbox/utils/favicon-service'; FaviconService.initFaviconService(); diff --git a/app/soapbox/components/hover_ref_wrapper.tsx b/app/soapbox/components/hover-ref-wrapper.tsx similarity index 94% rename from app/soapbox/components/hover_ref_wrapper.tsx rename to app/soapbox/components/hover-ref-wrapper.tsx index f509b2efee..bcde02720c 100644 --- a/app/soapbox/components/hover_ref_wrapper.tsx +++ b/app/soapbox/components/hover-ref-wrapper.tsx @@ -6,9 +6,9 @@ import { fetchAccount } from 'soapbox/actions/accounts'; import { openProfileHoverCard, closeProfileHoverCard, -} from 'soapbox/actions/profile_hover_card'; +} from 'soapbox/actions/profile-hover-card'; import { useAppDispatch } from 'soapbox/hooks'; -import { isMobile } from 'soapbox/is_mobile'; +import { isMobile } from 'soapbox/is-mobile'; const showProfileHoverCard = debounce((dispatch, ref, accountId) => { dispatch(openProfileHoverCard(ref, accountId)); diff --git a/app/soapbox/components/hover-status-wrapper.tsx b/app/soapbox/components/hover-status-wrapper.tsx index da962e47c4..a90969da20 100644 --- a/app/soapbox/components/hover-status-wrapper.tsx +++ b/app/soapbox/components/hover-status-wrapper.tsx @@ -7,7 +7,7 @@ import { openStatusHoverCard, closeStatusHoverCard, } from 'soapbox/actions/status-hover-card'; -import { isMobile } from 'soapbox/is_mobile'; +import { isMobile } from 'soapbox/is-mobile'; const showStatusHoverCard = debounce((dispatch, ref, statusId) => { dispatch(openStatusHoverCard(ref, statusId)); diff --git a/app/soapbox/components/icon_button.js b/app/soapbox/components/icon-button.js similarity index 98% rename from app/soapbox/components/icon_button.js rename to app/soapbox/components/icon-button.js index cb92c28414..bdfe157a60 100644 Binary files a/app/soapbox/components/icon_button.js and b/app/soapbox/components/icon-button.js differ diff --git a/app/soapbox/components/icon_with_counter.tsx b/app/soapbox/components/icon-with-counter.tsx similarity index 89% rename from app/soapbox/components/icon_with_counter.tsx rename to app/soapbox/components/icon-with-counter.tsx index 45c3460642..95e1060d8d 100644 --- a/app/soapbox/components/icon_with_counter.tsx +++ b/app/soapbox/components/icon-with-counter.tsx @@ -16,9 +16,9 @@ const IconWithCounter: React.FC = ({ icon, count, countMax, .. {count > 0 && ( - + - + )} ); diff --git a/app/soapbox/components/icon.tsx b/app/soapbox/components/icon.tsx index cba7b58050..f03f405801 100644 --- a/app/soapbox/components/icon.tsx +++ b/app/soapbox/components/icon.tsx @@ -7,8 +7,8 @@ import React from 'react'; -import ForkAwesomeIcon, { IForkAwesomeIcon } from './fork_awesome_icon'; -import SvgIcon, { ISvgIcon } from './svg_icon'; +import ForkAwesomeIcon, { IForkAwesomeIcon } from './fork-awesome-icon'; +import SvgIcon, { ISvgIcon } from './svg-icon'; export type IIcon = IForkAwesomeIcon | ISvgIcon; diff --git a/app/soapbox/components/load_gap.tsx b/app/soapbox/components/load-gap.tsx similarity index 100% rename from app/soapbox/components/load_gap.tsx rename to app/soapbox/components/load-gap.tsx diff --git a/app/soapbox/components/load_more.tsx b/app/soapbox/components/load-more.tsx similarity index 100% rename from app/soapbox/components/load_more.tsx rename to app/soapbox/components/load-more.tsx diff --git a/app/soapbox/components/media_gallery.tsx b/app/soapbox/components/media-gallery.tsx similarity index 99% rename from app/soapbox/components/media_gallery.tsx rename to app/soapbox/components/media-gallery.tsx index 390a300cac..42b961dc1c 100644 --- a/app/soapbox/components/media_gallery.tsx +++ b/app/soapbox/components/media-gallery.tsx @@ -3,14 +3,14 @@ import React, { useState, useRef, useEffect } from 'react'; import Blurhash from 'soapbox/components/blurhash'; import Icon from 'soapbox/components/icon'; -import StillImage from 'soapbox/components/still_image'; +import StillImage from 'soapbox/components/still-image'; import { MIMETYPE_ICONS } from 'soapbox/features/compose/components/upload'; import { useSettings } from 'soapbox/hooks'; import { Attachment } from 'soapbox/types/entities'; import { truncateFilename } from 'soapbox/utils/media'; -import { isIOS } from '../is_mobile'; -import { isPanoramic, isPortrait, isNonConformingRatio, minimumAspectRatio, maximumAspectRatio } from '../utils/media_aspect_ratio'; +import { isIOS } from '../is-mobile'; +import { isPanoramic, isPortrait, isNonConformingRatio, minimumAspectRatio, maximumAspectRatio } from '../utils/media-aspect-ratio'; import type { Property } from 'csstype'; import type { List as ImmutableList } from 'immutable'; diff --git a/app/soapbox/components/missing_indicator.tsx b/app/soapbox/components/missing-indicator.tsx similarity index 100% rename from app/soapbox/components/missing_indicator.tsx rename to app/soapbox/components/missing-indicator.tsx diff --git a/app/soapbox/components/modal_root.tsx b/app/soapbox/components/modal-root.tsx similarity index 99% rename from app/soapbox/components/modal_root.tsx rename to app/soapbox/components/modal-root.tsx index ade6db367e..92af680ca2 100644 --- a/app/soapbox/components/modal_root.tsx +++ b/app/soapbox/components/modal-root.tsx @@ -11,7 +11,7 @@ import { queryClient } from 'soapbox/queries/client'; import { IPolicy, PolicyKeys } from 'soapbox/queries/policies'; import type { UnregisterCallback } from 'history'; -import type { ModalType } from 'soapbox/features/ui/components/modal_root'; +import type { ModalType } from 'soapbox/features/ui/components/modal-root'; import type { ReducerCompose } from 'soapbox/reducers/compose'; const messages = defineMessages({ diff --git a/app/soapbox/components/more_follows.tsx b/app/soapbox/components/more_follows.tsx deleted file mode 100644 index f200cd5431..0000000000 --- a/app/soapbox/components/more_follows.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import React from 'react'; -import { defineMessages, useIntl } from 'react-intl'; - -import { useAppSelector } from 'soapbox/hooks'; -import { getFeatures } from 'soapbox/utils/features'; - -const messages = defineMessages({ - following: { - id: 'morefollows.following_label', - defaultMessage: '…and {count} more {count, plural, one {follow} other {follows}} on remote sites.', - }, - followers: { - id: 'morefollows.followers_label', - defaultMessage: '…and {count} more {count, plural, one {follower} other {followers}} on remote sites.', - }, -}); - -interface IMoreFollows { - visible?: Boolean, - count?: number, - type: 'following' | 'followers', -} - -const MoreFollows: React.FC = ({ visible = true, count, type }) => { - const intl = useIntl(); - const features = useAppSelector((state) => getFeatures(state.instance)); - - const getMessage = () => { - return intl.formatMessage(messages[type], { count }); - }; - - // If the instance isn't federating, there are no remote followers - if (!features.federating) { - return null; - } - - return ( -
-
-
- {getMessage()} -
-
-
- ); -}; - -export default MoreFollows; diff --git a/app/soapbox/components/profile-hover-card.tsx b/app/soapbox/components/profile-hover-card.tsx index 5baabeb86a..367c788e02 100644 --- a/app/soapbox/components/profile-hover-card.tsx +++ b/app/soapbox/components/profile-hover-card.tsx @@ -8,16 +8,16 @@ import { fetchRelationships } from 'soapbox/actions/accounts'; import { closeProfileHoverCard, updateProfileHoverCard, -} from 'soapbox/actions/profile_hover_card'; +} from 'soapbox/actions/profile-hover-card'; import Badge from 'soapbox/components/badge'; import ActionButton from 'soapbox/features/ui/components/action-button'; -import BundleContainer from 'soapbox/features/ui/containers/bundle_container'; +import BundleContainer from 'soapbox/features/ui/containers/bundle-container'; import { UserPanel } from 'soapbox/features/ui/util/async-components'; import { useAppSelector, useAppDispatch } from 'soapbox/hooks'; import { makeGetAccount } from 'soapbox/selectors'; import { isLocal } from 'soapbox/utils/accounts'; -import { showProfileHoverCard } from './hover_ref_wrapper'; +import { showProfileHoverCard } from './hover-ref-wrapper'; import { Card, CardBody, HStack, Icon, Stack, Text } from './ui'; import type { AppDispatch } from 'soapbox/store'; diff --git a/app/soapbox/components/progress_circle.tsx b/app/soapbox/components/progress-circle.tsx similarity index 100% rename from app/soapbox/components/progress_circle.tsx rename to app/soapbox/components/progress-circle.tsx diff --git a/app/soapbox/components/quoted-status.tsx b/app/soapbox/components/quoted-status.tsx index 863a5d3afe..8b358158b2 100644 --- a/app/soapbox/components/quoted-status.tsx +++ b/app/soapbox/components/quoted-status.tsx @@ -5,13 +5,13 @@ import { useHistory } from 'react-router-dom'; import StatusMedia from 'soapbox/components/status-media'; import { Stack } from 'soapbox/components/ui'; -import AccountContainer from 'soapbox/containers/account_container'; +import AccountContainer from 'soapbox/containers/account-container'; import { useSettings } from 'soapbox/hooks'; import { defaultMediaVisibility } from 'soapbox/utils/status'; import OutlineBox from './outline-box'; +import StatusContent from './status-content'; import StatusReplyMentions from './status-reply-mentions'; -import StatusContent from './status_content'; import SensitiveContentOverlay from './statuses/sensitive-content-overlay'; import type { Account as AccountEntity, Status as StatusEntity } from 'soapbox/types/entities'; @@ -103,7 +103,7 @@ const QuotedStatus: React.FC = ({ status, onCancel, compose }) => - diff --git a/app/soapbox/components/radio_button.tsx b/app/soapbox/components/radio_button.tsx deleted file mode 100644 index 2d350b9530..0000000000 --- a/app/soapbox/components/radio_button.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import classNames from 'clsx'; -import React from 'react'; - -interface IRadioButton { - value: string, - checked?: boolean, - name: string, - onChange: React.ChangeEventHandler, - label: React.ReactNode, -} - -const RadioButton: React.FC = ({ name, value, checked, onChange, label }) => ( - -); - -export default RadioButton; diff --git a/app/soapbox/components/scrollable_list.tsx b/app/soapbox/components/scrollable-list.tsx similarity index 99% rename from app/soapbox/components/scrollable_list.tsx rename to app/soapbox/components/scrollable-list.tsx index cdb74e5805..86e40570e0 100644 --- a/app/soapbox/components/scrollable_list.tsx +++ b/app/soapbox/components/scrollable-list.tsx @@ -5,7 +5,7 @@ import { Virtuoso, Components, VirtuosoProps, VirtuosoHandle, ListRange, IndexLo import { useSettings } from 'soapbox/hooks'; -import LoadMore from './load_more'; +import LoadMore from './load-more'; import { Card, Spinner } from './ui'; /** Custom Viruoso component context. */ diff --git a/app/soapbox/components/sidebar_menu.tsx b/app/soapbox/components/sidebar-menu.tsx similarity index 99% rename from app/soapbox/components/sidebar_menu.tsx rename to app/soapbox/components/sidebar-menu.tsx index 817e1f0d2e..0e0ae7f6fd 100644 --- a/app/soapbox/components/sidebar_menu.tsx +++ b/app/soapbox/components/sidebar-menu.tsx @@ -9,7 +9,7 @@ import { getSettings } from 'soapbox/actions/settings'; import { closeSidebar } from 'soapbox/actions/sidebar'; import Account from 'soapbox/components/account'; import { Stack } from 'soapbox/components/ui'; -import ProfileStats from 'soapbox/features/ui/components/profile_stats'; +import ProfileStats from 'soapbox/features/ui/components/profile-stats'; import { useAppSelector, useFeatures } from 'soapbox/hooks'; import { makeGetAccount, makeGetOtherAccounts } from 'soapbox/selectors'; @@ -228,7 +228,7 @@ const SidebarMenu: React.FC = (): JSX.Element | null => { {features.federating && ( } onClick={onClose} /> diff --git a/app/soapbox/components/sidebar-navigation.tsx b/app/soapbox/components/sidebar-navigation.tsx index 58bffda90b..94e921a9c1 100644 --- a/app/soapbox/components/sidebar-navigation.tsx +++ b/app/soapbox/components/sidebar-navigation.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { getSettings } from 'soapbox/actions/settings'; -import DropdownMenu from 'soapbox/containers/dropdown_menu_container'; +import DropdownMenu from 'soapbox/containers/dropdown-menu-container'; import { useStatContext } from 'soapbox/contexts/stat-context'; import ComposeButton from 'soapbox/features/ui/components/compose-button'; import { useAppSelector, useOwnAccount } from 'soapbox/hooks'; @@ -10,7 +10,7 @@ import { getFeatures } from 'soapbox/utils/features'; import SidebarNavigationLink from './sidebar-navigation-link'; -import type { Menu } from 'soapbox/components/dropdown_menu'; +import type { Menu } from 'soapbox/components/dropdown-menu'; const messages = defineMessages({ follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' }, @@ -98,7 +98,7 @@ const SidebarNavigation = () => { if (features.publicTimeline && features.federating) { menu.push({ to: '/timeline/fediverse', - icon: require('icons/fediverse.svg'), + icon: require('assets/icons/fediverse.svg'), text: intl.formatMessage(messages.fediverse), }); } diff --git a/app/soapbox/components/site-logo.tsx b/app/soapbox/components/site-logo.tsx index 56add1c19d..90552d0bdc 100644 --- a/app/soapbox/components/site-logo.tsx +++ b/app/soapbox/components/site-logo.tsx @@ -18,8 +18,8 @@ const SiteLogo: React.FC = ({ className, theme, ...rest }) => { /** Soapbox logo. */ const soapboxLogo = darkMode - ? require('images/soapbox-logo-white.svg') - : require('images/soapbox-logo.svg'); + ? require('assets/images/soapbox-logo-white.svg') + : require('assets/images/soapbox-logo.svg'); // Use the right logo if provided, then use fallbacks. const getSrc = () => { diff --git a/app/soapbox/components/status-action-bar.tsx b/app/soapbox/components/status-action-bar.tsx index c427612ec6..bbaff6b616 100644 --- a/app/soapbox/components/status-action-bar.tsx +++ b/app/soapbox/components/status-action-bar.tsx @@ -16,12 +16,12 @@ import { initReport } from 'soapbox/actions/reports'; import { deleteStatus, editStatus, toggleMuteStatus } from 'soapbox/actions/statuses'; import EmojiButtonWrapper from 'soapbox/components/emoji-button-wrapper'; import StatusActionButton from 'soapbox/components/status-action-button'; -import DropdownMenuContainer from 'soapbox/containers/dropdown_menu_container'; +import DropdownMenuContainer from 'soapbox/containers/dropdown-menu-container'; import { useAppDispatch, useAppSelector, useFeatures, useOwnAccount, useSettings, useSoapboxConfig } from 'soapbox/hooks'; import { isLocal } from 'soapbox/utils/accounts'; -import { getReactForStatus, reduceEmoji } from 'soapbox/utils/emoji_reacts'; +import { getReactForStatus, reduceEmoji } from 'soapbox/utils/emoji-reacts'; -import type { Menu } from 'soapbox/components/dropdown_menu'; +import type { Menu } from 'soapbox/components/dropdown-menu'; import type { Account, Status } from 'soapbox/types/entities'; const messages = defineMessages({ diff --git a/app/soapbox/components/status_content.tsx b/app/soapbox/components/status-content.tsx similarity index 99% rename from app/soapbox/components/status_content.tsx rename to app/soapbox/components/status-content.tsx index b3592c62d4..a495a9f821 100644 --- a/app/soapbox/components/status_content.tsx +++ b/app/soapbox/components/status-content.tsx @@ -6,7 +6,7 @@ import { useHistory } from 'react-router-dom'; import Icon from 'soapbox/components/icon'; import { useSoapboxConfig } from 'soapbox/hooks'; import { addGreentext } from 'soapbox/utils/greentext'; -import { onlyEmoji as isOnlyEmoji } from 'soapbox/utils/rich_content'; +import { onlyEmoji as isOnlyEmoji } from 'soapbox/utils/rich-content'; import { isRtl } from '../rtl'; diff --git a/app/soapbox/components/status-hover-card.tsx b/app/soapbox/components/status-hover-card.tsx index 4ae3f705ec..37ca117a04 100644 --- a/app/soapbox/components/status-hover-card.tsx +++ b/app/soapbox/components/status-hover-card.tsx @@ -8,7 +8,7 @@ import { updateStatusHoverCard, } from 'soapbox/actions/status-hover-card'; import { fetchStatus } from 'soapbox/actions/statuses'; -import StatusContainer from 'soapbox/containers/status_container'; +import StatusContainer from 'soapbox/containers/status-container'; import { useAppSelector, useAppDispatch } from 'soapbox/hooks'; import { showStatusHoverCard } from './hover-status-wrapper'; diff --git a/app/soapbox/components/status_list.tsx b/app/soapbox/components/status-list.tsx similarity index 97% rename from app/soapbox/components/status_list.tsx rename to app/soapbox/components/status-list.tsx index 09fbe3275a..68dba32c6d 100644 --- a/app/soapbox/components/status_list.tsx +++ b/app/soapbox/components/status-list.tsx @@ -5,20 +5,20 @@ import React, { useRef, useCallback } from 'react'; import { FormattedMessage } from 'react-intl'; import { v4 as uuidv4 } from 'uuid'; -import LoadGap from 'soapbox/components/load_gap'; -import ScrollableList from 'soapbox/components/scrollable_list'; -import StatusContainer from 'soapbox/containers/status_container'; +import LoadGap from 'soapbox/components/load-gap'; +import ScrollableList from 'soapbox/components/scrollable-list'; +import StatusContainer from 'soapbox/containers/status-container'; import Ad from 'soapbox/features/ads/components/ad'; import FeedSuggestions from 'soapbox/features/feed-suggestions/feed-suggestions'; -import PlaceholderStatus from 'soapbox/features/placeholder/components/placeholder_status'; +import PlaceholderStatus from 'soapbox/features/placeholder/components/placeholder-status'; import { ALGORITHMS } from 'soapbox/features/timeline-insertion'; -import PendingStatus from 'soapbox/features/ui/components/pending_status'; +import PendingStatus from 'soapbox/features/ui/components/pending-status'; import { useSoapboxConfig } from 'soapbox/hooks'; import useAds from 'soapbox/queries/ads'; import type { OrderedSet as ImmutableOrderedSet } from 'immutable'; import type { VirtuosoHandle } from 'react-virtuoso'; -import type { IScrollableList } from 'soapbox/components/scrollable_list'; +import type { IScrollableList } from 'soapbox/components/scrollable-list'; import type { Ad as AdEntity } from 'soapbox/types/soapbox'; interface IStatusList extends Omit { diff --git a/app/soapbox/components/status-media.tsx b/app/soapbox/components/status-media.tsx index 4445e67b52..71177cb122 100644 --- a/app/soapbox/components/status-media.tsx +++ b/app/soapbox/components/status-media.tsx @@ -2,11 +2,12 @@ import React, { useState } from 'react'; import { openModal } from 'soapbox/actions/modals'; import AttachmentThumbs from 'soapbox/components/attachment-thumbs'; -import PlaceholderCard from 'soapbox/features/placeholder/components/placeholder_card'; +import PlaceholderCard from 'soapbox/features/placeholder/components/placeholder-card'; import Card from 'soapbox/features/status/components/card'; import Bundle from 'soapbox/features/ui/components/bundle'; import { MediaGallery, Video, Audio } from 'soapbox/features/ui/util/async-components'; -import { useAppDispatch } from 'soapbox/hooks'; +import { useAppDispatch, useSettings } from 'soapbox/hooks'; +import { addAutoPlay } from 'soapbox/utils/media'; import type { List as ImmutableList } from 'immutable'; import type { Status, Attachment } from 'soapbox/types/entities'; @@ -33,6 +34,9 @@ const StatusMedia: React.FC = ({ onToggleVisibility = () => { }, }) => { const dispatch = useAppDispatch(); + const settings = useSettings(); + const shouldAutoPlayVideo = settings.get('autoPlayVideo'); + const [mediaWrapperWidth, setMediaWrapperWidth] = useState(undefined); const size = status.media_attachments.size; @@ -93,7 +97,9 @@ const StatusMedia: React.FC = ({ ref={setRef} className='status-card__image status-card-video' style={height ? { height } : undefined} - dangerouslySetInnerHTML={{ __html: status.card.html }} + dangerouslySetInnerHTML={{ + __html: shouldAutoPlayVideo ? addAutoPlay(status.card.html) : status.card.html, + }} /> ); diff --git a/app/soapbox/components/status-reply-mentions.tsx b/app/soapbox/components/status-reply-mentions.tsx index 4d65abd11e..0964c84ae1 100644 --- a/app/soapbox/components/status-reply-mentions.tsx +++ b/app/soapbox/components/status-reply-mentions.tsx @@ -3,8 +3,8 @@ import { FormattedList, FormattedMessage } from 'react-intl'; import { Link } from 'react-router-dom'; import { openModal } from 'soapbox/actions/modals'; +import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper'; import HoverStatusWrapper from 'soapbox/components/hover-status-wrapper'; -import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper'; import { useAppDispatch } from 'soapbox/hooks'; import type { Account, Status } from 'soapbox/types/entities'; @@ -75,7 +75,7 @@ const StatusReplyMentions: React.FC = ({ status, hoverable return (
, diff --git a/app/soapbox/components/status.tsx b/app/soapbox/components/status.tsx index f01ded300e..fab25ea922 100644 --- a/app/soapbox/components/status.tsx +++ b/app/soapbox/components/status.tsx @@ -10,15 +10,15 @@ import { openModal } from 'soapbox/actions/modals'; import { toggleStatusHidden } from 'soapbox/actions/statuses'; import Icon from 'soapbox/components/icon'; import TranslateButton from 'soapbox/components/translate-button'; -import AccountContainer from 'soapbox/containers/account_container'; -import QuotedStatus from 'soapbox/features/status/containers/quoted_status_container'; +import AccountContainer from 'soapbox/containers/account-container'; +import QuotedStatus from 'soapbox/features/status/containers/quoted-status-container'; import { useAppDispatch, useSettings } from 'soapbox/hooks'; import { defaultMediaVisibility, textForScreenReader, getActualStatus } from 'soapbox/utils/status'; import StatusActionBar from './status-action-bar'; +import StatusContent from './status-content'; import StatusMedia from './status-media'; import StatusReplyMentions from './status-reply-mentions'; -import StatusContent from './status_content'; import SensitiveContentOverlay from './statuses/sensitive-content-overlay'; import { Card, HStack, Stack, Text } from './ui'; @@ -359,7 +359,7 @@ const Status: React.FC = (props) => { void, +} + +/** + * Accordion + * An accordion is a vertically stacked group of collapsible sections. + */ +const Accordion: React.FC = ({ headline, children, menu, expanded = false, onToggle = () => {} }) => { + const intl = useIntl(); + + const handleToggle = (e: React.MouseEvent) => { + onToggle(!expanded); + e.preventDefault(); + }; + + return ( +
+ + +
+ {children} +
+
+ ); +}; + +export default Accordion; diff --git a/app/soapbox/components/ui/avatar/avatar.tsx b/app/soapbox/components/ui/avatar/avatar.tsx index bdd38df9c1..ec19809787 100644 --- a/app/soapbox/components/ui/avatar/avatar.tsx +++ b/app/soapbox/components/ui/avatar/avatar.tsx @@ -1,7 +1,7 @@ import classNames from 'clsx'; import * as React from 'react'; -import StillImage from 'soapbox/components/still_image'; +import StillImage from 'soapbox/components/still-image'; const AVATAR_SIZE = 42; diff --git a/app/soapbox/components/ui/index.ts b/app/soapbox/components/ui/index.ts index fd9cb055e8..90f5933edf 100644 --- a/app/soapbox/components/ui/index.ts +++ b/app/soapbox/components/ui/index.ts @@ -1,3 +1,4 @@ +export { default as Accordion } from './accordion/accordion'; export { default as Avatar } from './avatar/avatar'; export { default as Banner } from './banner/banner'; export { default as Button } from './button/button'; @@ -30,6 +31,7 @@ export { export { default as Modal } from './modal/modal'; export { default as PhoneInput } from './phone-input/phone-input'; export { default as ProgressBar } from './progress-bar/progress-bar'; +export { default as RadioButton } from './radio-button/radio-button'; export { default as Select } from './select/select'; export { default as Spinner } from './spinner/spinner'; export { default as Stack } from './stack/stack'; diff --git a/app/soapbox/components/ui/radio-button/radio-button.tsx b/app/soapbox/components/ui/radio-button/radio-button.tsx new file mode 100644 index 0000000000..322cbd7e75 --- /dev/null +++ b/app/soapbox/components/ui/radio-button/radio-button.tsx @@ -0,0 +1,37 @@ +import React, { useMemo } from 'react'; +import { v4 as uuidv4 } from 'uuid'; + +interface IRadioButton { + value: string + checked?: boolean + name: string + onChange: React.ChangeEventHandler + label: React.ReactNode +} + +/** + * A group for radio input with label. + */ +const RadioButton: React.FC = ({ name, value, checked, onChange, label }) => { + const formFieldId: string = useMemo(() => `radio-${uuidv4()}`, []); + + return ( +
+ + + +
+ ); +}; + +export default RadioButton; diff --git a/app/soapbox/components/upload-progress.tsx b/app/soapbox/components/upload-progress.tsx index a7996e1bfd..fe9b84797b 100644 --- a/app/soapbox/components/upload-progress.tsx +++ b/app/soapbox/components/upload-progress.tsx @@ -3,7 +3,7 @@ import { FormattedMessage } from 'react-intl'; import { spring } from 'react-motion'; import { HStack, Icon, Stack, Text } from 'soapbox/components/ui'; -import Motion from 'soapbox/features/ui/util/optional_motion'; +import Motion from 'soapbox/features/ui/util/optional-motion'; interface IUploadProgress { /** Number between 0 and 1 to represent the percentage complete. */ diff --git a/app/soapbox/components/verification_badge.tsx b/app/soapbox/components/verification-badge.tsx similarity index 91% rename from app/soapbox/components/verification_badge.tsx rename to app/soapbox/components/verification-badge.tsx index ce1d3792a7..766decb883 100644 --- a/app/soapbox/components/verification_badge.tsx +++ b/app/soapbox/components/verification-badge.tsx @@ -18,7 +18,7 @@ const VerificationBadge: React.FC = ({ className }) => { const soapboxConfig = useSoapboxConfig(); // Prefer a custom icon if found - const icon = soapboxConfig.verifiedIcon || require('icons/verified.svg'); + const icon = soapboxConfig.verifiedIcon || require('assets/icons/verified.svg'); // Render component based on file extension const Element = icon.endsWith('.svg') ? Icon : 'img'; diff --git a/app/soapbox/containers/account_container.js b/app/soapbox/containers/account-container.js similarity index 100% rename from app/soapbox/containers/account_container.js rename to app/soapbox/containers/account-container.js diff --git a/app/soapbox/containers/dropdown_menu_container.ts b/app/soapbox/containers/dropdown-menu-container.ts similarity index 89% rename from app/soapbox/containers/dropdown_menu_container.ts rename to app/soapbox/containers/dropdown-menu-container.ts index b047edfff5..936e3c5c20 100644 --- a/app/soapbox/containers/dropdown_menu_container.ts +++ b/app/soapbox/containers/dropdown-menu-container.ts @@ -1,12 +1,12 @@ import { connect } from 'react-redux'; -import { openDropdownMenu, closeDropdownMenu } from '../actions/dropdown_menu'; +import { openDropdownMenu, closeDropdownMenu } from '../actions/dropdown-menu'; import { openModal, closeModal } from '../actions/modals'; -import DropdownMenu from '../components/dropdown_menu'; -import { isUserTouching } from '../is_mobile'; +import DropdownMenu from '../components/dropdown-menu'; +import { isUserTouching } from '../is-mobile'; import type { Dispatch } from 'redux'; -import type { DropdownPlacement, IDropdown } from 'soapbox/components/dropdown_menu'; +import type { DropdownPlacement, IDropdown } from 'soapbox/components/dropdown-menu'; import type { RootState } from 'soapbox/store'; const mapStateToProps = (state: RootState) => ({ diff --git a/app/soapbox/containers/soapbox.tsx b/app/soapbox/containers/soapbox.tsx index e26154ba5d..c8302436b5 100644 --- a/app/soapbox/containers/soapbox.tsx +++ b/app/soapbox/containers/soapbox.tsx @@ -13,14 +13,14 @@ import { loadInstance } from 'soapbox/actions/instance'; import { fetchMe } from 'soapbox/actions/me'; import { loadSoapboxConfig, getSoapboxConfig } from 'soapbox/actions/soapbox'; import { fetchVerificationConfig } from 'soapbox/actions/verification'; -import * as BuildConfig from 'soapbox/build_config'; +import * as BuildConfig from 'soapbox/build-config'; import GdprBanner from 'soapbox/components/gdpr-banner'; import Helmet from 'soapbox/components/helmet'; import LoadingScreen from 'soapbox/components/loading-screen'; -import AuthLayout from 'soapbox/features/auth_layout'; +import AuthLayout from 'soapbox/features/auth-layout'; import EmbeddedStatus from 'soapbox/features/embedded-status'; -import PublicLayout from 'soapbox/features/public_layout'; -import BundleContainer from 'soapbox/features/ui/containers/bundle_container'; +import PublicLayout from 'soapbox/features/public-layout'; +import BundleContainer from 'soapbox/features/ui/containers/bundle-container'; import { ModalContainer, NotificationsContainer, @@ -45,7 +45,7 @@ import { generateThemeCss } from 'soapbox/utils/theme'; import { checkOnboardingStatus } from '../actions/onboarding'; import { preload } from '../actions/preload'; -import ErrorBoundary from '../components/error_boundary'; +import ErrorBoundary from '../components/error-boundary'; import UI from '../features/ui'; import { store } from '../store'; diff --git a/app/soapbox/containers/status_container.tsx b/app/soapbox/containers/status-container.tsx similarity index 100% rename from app/soapbox/containers/status_container.tsx rename to app/soapbox/containers/status-container.tsx diff --git a/app/soapbox/custom.ts b/app/soapbox/custom.ts index 4bccb386d5..461f64845e 100644 --- a/app/soapbox/custom.ts +++ b/app/soapbox/custom.ts @@ -1,7 +1,7 @@ /** * Functions for dealing with custom build configuration. */ -import * as BuildConfig from 'soapbox/build_config'; +import * as BuildConfig from 'soapbox/build-config'; /** Require a custom JSON file if it exists */ export const custom = (filename: string, fallback: any = {}): any => { diff --git a/app/soapbox/extra_polyfills.ts b/app/soapbox/extra-polyfills.ts similarity index 100% rename from app/soapbox/extra_polyfills.ts rename to app/soapbox/extra-polyfills.ts diff --git a/app/soapbox/features/about/index.tsx b/app/soapbox/features/about/index.tsx index 5c184a97af..9cc1e92955 100644 --- a/app/soapbox/features/about/index.tsx +++ b/app/soapbox/features/about/index.tsx @@ -35,11 +35,11 @@ const AboutPage: React.FC = () => { }, [locale, slug]); const alsoAvailable = (defaultLocale) && ( -
+
{' '} -