From ae3d98505e7578b97a3ba745ece770ac70f25d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Tue, 1 Oct 2024 16:49:17 +0200 Subject: [PATCH] wip hooks migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/src/actions/accounts.ts | 2 +- packages/pl-fe/src/actions/admin.ts | 3 +- packages/pl-fe/src/actions/aliases.ts | 2 +- packages/pl-fe/src/actions/auth.ts | 2 +- packages/pl-fe/src/actions/bookmarks.ts | 3 +- packages/pl-fe/src/actions/compose.ts | 2 +- packages/pl-fe/src/actions/conversations.ts | 3 +- packages/pl-fe/src/actions/directory.ts | 3 +- packages/pl-fe/src/actions/emoji-reacts.ts | 3 +- packages/pl-fe/src/actions/events.ts | 2 +- .../pl-fe/src/actions/familiar-followers.ts | 3 +- packages/pl-fe/src/actions/favourites.ts | 3 +- packages/pl-fe/src/actions/groups.ts | 3 +- packages/pl-fe/src/actions/history.ts | 3 +- packages/pl-fe/src/actions/interactions.ts | 2 +- packages/pl-fe/src/actions/lists.ts | 3 +- packages/pl-fe/src/actions/me.ts | 3 +- packages/pl-fe/src/actions/notifications.ts | 4 +- packages/pl-fe/src/actions/pin-statuses.ts | 3 +- packages/pl-fe/src/actions/polls.ts | 3 +- packages/pl-fe/src/actions/preload.ts | 1 - packages/pl-fe/src/actions/search.ts | 3 +- packages/pl-fe/src/actions/status-quotes.ts | 3 +- packages/pl-fe/src/actions/statuses.ts | 3 +- packages/pl-fe/src/actions/suggestions.ts | 3 +- packages/pl-fe/src/actions/timelines.ts | 2 +- .../pl-fe/src/actions/trending-statuses.ts | 3 +- packages/pl-fe/src/components/account.tsx | 2 +- .../announcements/announcements-panel.tsx | 2 +- .../src/components/announcements/reaction.tsx | 4 +- .../src/components/autosuggest-input.tsx | 2 +- .../pl-fe/src/components/avatar-stack.tsx | 2 +- packages/pl-fe/src/components/big-card.tsx | 2 +- .../dropdown-menu/dropdown-menu-item.tsx | 4 +- .../dropdown-menu/dropdown-menu.tsx | 4 +- .../pl-fe/src/components/event-preview.tsx | 4 +- packages/pl-fe/src/components/group-card.tsx | 4 +- .../groups/popover/group-popover.tsx | 4 +- .../pl-fe/src/components/landing-gradient.tsx | 2 +- packages/pl-fe/src/components/link.tsx | 2 +- packages/pl-fe/src/components/list.tsx | 2 +- packages/pl-fe/src/components/mention.tsx | 2 +- packages/pl-fe/src/components/modal-root.tsx | 2 +- packages/pl-fe/src/components/navlinks.tsx | 2 +- .../src/components/pending-items-row.tsx | 2 +- .../src/components/polls/poll-option.tsx | 10 +- .../src/components/profile-hover-card.tsx | 2 +- packages/pl-fe/src/components/radio.tsx | 2 +- .../src/components/scroll-top-button.tsx | 2 +- .../pl-fe/src/components/sidebar-menu.tsx | 12 +- .../src/components/site-error-boundary.tsx | 8 +- .../src/components/status-action-button.tsx | 2 +- .../pl-fe/src/components/status-content.tsx | 2 +- .../src/components/status-hover-card.tsx | 2 +- .../pl-fe/src/components/status-mention.tsx | 2 +- .../src/components/status-reactions-bar.tsx | 2 +- .../src/components/status-reply-mentions.tsx | 2 +- packages/pl-fe/src/components/status.tsx | 4 +- .../src/components/statuses/status-info.tsx | 2 +- .../pl-fe/src/components/thumb-navigation.tsx | 6 +- .../pl-fe/src/components/trending-link.tsx | 2 +- .../src/components/ui/accordion/accordion.tsx | 2 +- .../pl-fe/src/components/ui/card/card.tsx | 2 +- .../src/components/ui/carousel/carousel.tsx | 4 +- .../src/components/ui/checkbox/checkbox.tsx | 2 +- .../src/components/ui/counter/counter.tsx | 2 +- .../src/components/ui/divider/divider.tsx | 4 +- .../components/ui/form-group/form-group.tsx | 4 +- .../components/ui/icon-button/icon-button.tsx | 2 +- .../inline-multiselect/inline-multiselect.tsx | 4 +- .../pl-fe/src/components/ui/input/input.tsx | 4 +- .../pl-fe/src/components/ui/layout/layout.tsx | 2 +- .../pl-fe/src/components/ui/menu/menu.tsx | 4 +- .../pl-fe/src/components/ui/modal/modal.tsx | 8 +- .../src/components/ui/popover/popover.tsx | 4 +- .../ui/progress-bar/progress-bar.tsx | 4 +- .../ui/radio-button/radio-button.tsx | 2 +- .../pl-fe/src/components/ui/select/select.tsx | 2 +- .../pl-fe/src/components/ui/slider/slider.tsx | 6 +- .../pl-fe/src/components/ui/tabs/tabs.tsx | 4 +- .../src/components/ui/tag-input/tag-input.tsx | 2 +- .../pl-fe/src/components/ui/tag-input/tag.tsx | 2 +- .../src/components/ui/textarea/textarea.tsx | 2 +- .../pl-fe/src/components/ui/toast/toast.tsx | 8 +- .../pl-fe/src/components/ui/toggle/toggle.tsx | 2 +- .../pl-fe/src/components/ui/widget/widget.tsx | 2 +- .../src/components/verification-badge.tsx | 4 +- packages/pl-fe/src/features/about/index.tsx | 2 +- .../components/moved-note.tsx | 2 +- .../features/account/components/header.tsx | 8 +- .../src/features/admin/announcements.tsx | 2 +- .../src/features/admin/components/report.tsx | 2 +- packages/pl-fe/src/features/admin/domains.tsx | 2 +- packages/pl-fe/src/features/admin/relays.tsx | 2 +- packages/pl-fe/src/features/admin/rules.tsx | 2 +- .../features/aliases/components/search.tsx | 2 +- packages/pl-fe/src/features/audio/index.tsx | 4 +- .../auth-login/components/consumers-list.tsx | 2 +- .../src/features/auth-token-list/index.tsx | 2 +- packages/pl-fe/src/features/backups/index.tsx | 2 +- .../chats/components/chat-composer.tsx | 4 +- .../chats/components/chat-list-item.tsx | 4 +- .../features/chats/components/chat-list.tsx | 4 +- .../chats/components/chat-page/chat-page.tsx | 6 +- .../chat-page/components/chat-page-main.tsx | 4 +- .../chats/components/chat-pending-upload.tsx | 2 +- .../chats/components/chat-search/results.tsx | 4 +- .../chats/components/chat-textarea.tsx | 16 +- .../features/chats/components/chat-upload.tsx | 4 +- .../chat-widget/chat-pane-header.tsx | 2 +- .../components/chat-widget/chat-settings.tsx | 6 +- .../components/chat-widget/chat-window.tsx | 2 +- .../headers/chat-search-header.tsx | 2 +- .../src/features/chats/components/ui/pane.tsx | 2 +- packages/pl-fe/src/features/circle/index.tsx | 2 +- .../compose/components/compose-form.tsx | 2 +- .../compose/components/language-dropdown.tsx | 2 +- .../compose/components/reply-indicator.tsx | 2 +- .../compose/components/reply-mentions.tsx | 2 +- .../plugins/floating-link-editor-plugin.tsx | 2 +- .../floating-text-format-toolbar-plugin.tsx | 4 +- .../directory/components/account-card.tsx | 4 +- .../edit-profile/components/avatar-picker.tsx | 2 +- .../edit-profile/components/header-picker.tsx | 2 +- .../src/features/embedded-status/index.tsx | 2 +- .../event/components/event-header.tsx | 6 +- .../src/features/event/event-information.tsx | 4 +- .../feed-suggestions/feed-suggestions.tsx | 4 +- packages/pl-fe/src/features/filters/index.tsx | 2 +- .../group/components/group-header.tsx | 8 +- .../src/features/hashtag-timeline/index.tsx | 2 +- .../src/features/home-timeline/index.tsx | 2 +- .../landing-timeline/components/logo-text.tsx | 2 +- .../pl-fe/src/features/migration/index.tsx | 2 +- .../notifications/components/notification.tsx | 4 +- .../src/features/notifications/index.tsx | 14 +- .../steps/avatar-selection-step.tsx | 2 +- .../onboarding/steps/completed-step.tsx | 2 +- .../steps/cover-photo-selection-step.tsx | 4 +- .../onboarding/steps/fediverse-step.tsx | 6 +- .../steps/suggested-accounts-step.tsx | 2 +- .../components/icon-picker-menu.tsx | 4 +- .../pl-fe-config/components/site-preview.tsx | 2 +- .../components/placeholder-avatar.tsx | 4 +- .../components/placeholder-card.tsx | 2 +- .../components/placeholder-chat-message.tsx | 4 +- .../components/placeholder-display-name.tsx | 2 +- .../components/placeholder-event-header.tsx | 2 +- .../components/placeholder-event-preview.tsx | 4 +- .../components/placeholder-group-card.tsx | 4 +- .../components/placeholder-group-search.tsx | 2 +- .../components/placeholder-hashtag.tsx | 2 +- .../components/placeholder-media-gallery.tsx | 2 +- .../components/placeholder-notification.tsx | 2 +- .../placeholder-sidebar-suggestions.tsx | 2 +- .../components/placeholder-sidebar-trends.tsx | 2 +- .../components/placeholder-status-content.tsx | 2 +- .../src/features/public-timeline/index.tsx | 2 +- .../components/pinned-hosts-picker.tsx | 2 +- .../status/components/detailed-status.tsx | 2 +- .../status/components/thread-status.tsx | 2 +- .../src/features/status/components/thread.tsx | 6 +- .../src/features/test-timeline/index.tsx | 2 +- .../ui/components/background-shapes.tsx | 2 +- .../ui/components/column-forbidden.tsx | 2 +- .../ui/components/floating-action-button.tsx | 4 +- .../modals/compare-history-modal.tsx | 2 +- .../modals/compose-event-modal/index.tsx | 4 +- .../compose-event-modal/upload-button.tsx | 2 +- .../components/modals/dropdown-menu-modal.tsx | 2 +- .../modals/edit-bookmark-folder-modal.tsx | 2 +- .../ui/components/modals/hotkeys-modal.tsx | 2 +- .../steps/confirmation-step.tsx | 6 +- .../report-modal/steps/confirmation-step.tsx | 2 +- .../modals/report-modal/steps/reason-step.tsx | 2 +- .../ui/components/profile-dropdown.tsx | 4 +- packages/pl-fe/src/features/ui/index.tsx | 6 +- packages/pl-fe/src/features/video/index.tsx | 2 +- packages/pl-fe/src/init/pl-fe-head.tsx | 2 +- packages/pl-fe/src/layouts/chats-layout.tsx | 2 +- packages/pl-fe/src/layouts/home-layout.tsx | 2 +- packages/pl-fe/src/layouts/landing-layout.tsx | 2 +- packages/pl-fe/src/normalizers/status.ts | 1 - packages/pl-fe/src/pl-hooks | 1 + packages/pl-fe/src/pl-hooks/README.md | 1 - packages/pl-fe/src/queries/chats.ts | 2 +- packages/pl-fe/src/queries/suggestions.ts | 2 +- packages/pl-fe/tsconfig.json | 3 +- .../lib}/hooks/markers/useMarkers.ts | 0 .../hooks/notifications/useNotification.ts | 4 +- .../notifications/useNotificationList.ts | 4 +- .../pl-hooks/lib/hooks/statuses/useStatus.ts | 46 +++++ .../src/pl-hooks => pl-hooks/lib}/importer.ts | 0 .../lib}/minifiers/minifyNotification.ts | 0 .../pl-hooks/lib/minifiers/minifyStatus.ts | 15 ++ .../normalizers/deduplicateNotifications.ts | 0 .../lib/normalizers/normalizeStatus.ts | 170 ++++++++++++++++++ packages/pl-hooks/tsconfig.json | 2 +- packages/pl-hooks/vite.config.ts | 2 +- 199 files changed, 535 insertions(+), 287 deletions(-) create mode 120000 packages/pl-fe/src/pl-hooks delete mode 100644 packages/pl-fe/src/pl-hooks/README.md rename packages/{pl-fe/src/pl-hooks => pl-hooks/lib}/hooks/markers/useMarkers.ts (100%) rename packages/{pl-fe/src/pl-hooks => pl-hooks/lib}/hooks/notifications/useNotification.ts (96%) rename packages/{pl-fe/src/pl-hooks => pl-hooks/lib}/hooks/notifications/useNotificationList.ts (100%) create mode 100644 packages/pl-hooks/lib/hooks/statuses/useStatus.ts rename packages/{pl-fe/src/pl-hooks => pl-hooks/lib}/importer.ts (100%) rename packages/{pl-fe/src/pl-hooks => pl-hooks/lib}/minifiers/minifyNotification.ts (100%) create mode 100644 packages/pl-hooks/lib/minifiers/minifyStatus.ts rename packages/{pl-fe/src/pl-hooks => pl-hooks/lib}/normalizers/deduplicateNotifications.ts (100%) create mode 100644 packages/pl-hooks/lib/normalizers/normalizeStatus.ts diff --git a/packages/pl-fe/src/actions/accounts.ts b/packages/pl-fe/src/actions/accounts.ts index f52b6002e..9b386f1bf 100644 --- a/packages/pl-fe/src/actions/accounts.ts +++ b/packages/pl-fe/src/actions/accounts.ts @@ -1,8 +1,8 @@ import { PLEROMA, type UpdateNotificationSettingsParams, type Account, type CreateAccountParams, type PaginatedResponse, type Relationship } from 'pl-api'; +import { importEntities } from 'pl-fe/pl-hooks/importer'; import { getClient, type PlfeResponse } from 'pl-fe/api'; import { Entities } from 'pl-fe/entity-store/entities'; -import { importEntities } from 'pl-fe/pl-hooks/importer'; import { selectAccount } from 'pl-fe/selectors'; import { isLoggedIn } from 'pl-fe/utils/auth'; diff --git a/packages/pl-fe/src/actions/admin.ts b/packages/pl-fe/src/actions/admin.ts index 4be3d0741..d3f13137a 100644 --- a/packages/pl-fe/src/actions/admin.ts +++ b/packages/pl-fe/src/actions/admin.ts @@ -1,6 +1,7 @@ +import { importEntities } from 'pl-fe/pl-hooks/importer'; + import { fetchRelationships } from 'pl-fe/actions/accounts'; import { getClient } from 'pl-fe/api'; -import { importEntities } from 'pl-fe/pl-hooks/importer'; import { filterBadges, getTagDiff } from 'pl-fe/utils/badges'; import { deleteFromTimelines } from './timelines'; diff --git a/packages/pl-fe/src/actions/aliases.ts b/packages/pl-fe/src/actions/aliases.ts index aad1dc396..1d31a4aa1 100644 --- a/packages/pl-fe/src/actions/aliases.ts +++ b/packages/pl-fe/src/actions/aliases.ts @@ -1,7 +1,7 @@ +import { importEntities } from 'pl-fe/pl-hooks/importer'; import { defineMessages } from 'react-intl'; import { getClient } from 'pl-fe/api'; -import { importEntities } from 'pl-fe/pl-hooks/importer'; import toast from 'pl-fe/toast'; import { isLoggedIn } from 'pl-fe/utils/auth'; diff --git a/packages/pl-fe/src/actions/auth.ts b/packages/pl-fe/src/actions/auth.ts index efb65ec74..711518a33 100644 --- a/packages/pl-fe/src/actions/auth.ts +++ b/packages/pl-fe/src/actions/auth.ts @@ -7,6 +7,7 @@ * @see module:pl-fe/actions/security */ import { credentialAccountSchema, PlApiClient, type CreateAccountParams, type Token } from 'pl-api'; +import { importEntities } from 'pl-fe/pl-hooks/importer'; import { defineMessages } from 'react-intl'; import { createAccount } from 'pl-fe/actions/accounts'; @@ -17,7 +18,6 @@ import { startOnboarding } from 'pl-fe/actions/onboarding'; import { type PlfeResponse, getClient } from 'pl-fe/api'; import * as BuildConfig from 'pl-fe/build-config'; import { custom } from 'pl-fe/custom'; -import { importEntities } from 'pl-fe/pl-hooks/importer'; import { queryClient } from 'pl-fe/queries/client'; import { selectAccount } from 'pl-fe/selectors'; import { unsetSentryAccount } from 'pl-fe/sentry'; diff --git a/packages/pl-fe/src/actions/bookmarks.ts b/packages/pl-fe/src/actions/bookmarks.ts index f116a5995..9967c73ea 100644 --- a/packages/pl-fe/src/actions/bookmarks.ts +++ b/packages/pl-fe/src/actions/bookmarks.ts @@ -1,6 +1,7 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; +import { getClient } from 'pl-fe/api'; + import type { PaginatedResponse, Status } from 'pl-api'; import type { AppDispatch, RootState } from 'pl-fe/store'; diff --git a/packages/pl-fe/src/actions/compose.ts b/packages/pl-fe/src/actions/compose.ts index 64d6d643f..f54de5f54 100644 --- a/packages/pl-fe/src/actions/compose.ts +++ b/packages/pl-fe/src/actions/compose.ts @@ -1,11 +1,11 @@ import throttle from 'lodash/throttle'; +import { importEntities } from 'pl-fe/pl-hooks/importer'; import { defineMessages, IntlShape } from 'react-intl'; import { getClient } from 'pl-fe/api'; import { isNativeEmoji } from 'pl-fe/features/emoji'; import emojiSearch from 'pl-fe/features/emoji/search'; import { Language } from 'pl-fe/features/preferences'; -import { importEntities } from 'pl-fe/pl-hooks/importer'; import { selectAccount, selectOwnAccount, makeGetAccount } from 'pl-fe/selectors'; import { tagHistory } from 'pl-fe/settings'; import { useModalsStore } from 'pl-fe/stores'; diff --git a/packages/pl-fe/src/actions/conversations.ts b/packages/pl-fe/src/actions/conversations.ts index adac3b19f..e32c19810 100644 --- a/packages/pl-fe/src/actions/conversations.ts +++ b/packages/pl-fe/src/actions/conversations.ts @@ -1,5 +1,6 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; + +import { getClient } from 'pl-fe/api'; import { isLoggedIn } from 'pl-fe/utils/auth'; import type { Account, Conversation, PaginatedResponse, Status } from 'pl-api'; diff --git a/packages/pl-fe/src/actions/directory.ts b/packages/pl-fe/src/actions/directory.ts index bff0c19ba..effb747eb 100644 --- a/packages/pl-fe/src/actions/directory.ts +++ b/packages/pl-fe/src/actions/directory.ts @@ -1,6 +1,7 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; +import { getClient } from 'pl-fe/api'; + import { fetchRelationships } from './accounts'; import type { Account, ProfileDirectoryParams } from 'pl-api'; diff --git a/packages/pl-fe/src/actions/emoji-reacts.ts b/packages/pl-fe/src/actions/emoji-reacts.ts index 54bc4899d..90a44e8b1 100644 --- a/packages/pl-fe/src/actions/emoji-reacts.ts +++ b/packages/pl-fe/src/actions/emoji-reacts.ts @@ -1,5 +1,6 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; + +import { getClient } from 'pl-fe/api'; import { isLoggedIn } from 'pl-fe/utils/auth'; import type { Status } from 'pl-api'; diff --git a/packages/pl-fe/src/actions/events.ts b/packages/pl-fe/src/actions/events.ts index 515646a71..b4aa9ecb4 100644 --- a/packages/pl-fe/src/actions/events.ts +++ b/packages/pl-fe/src/actions/events.ts @@ -1,8 +1,8 @@ +import { importEntities } from 'pl-fe/pl-hooks/importer'; import { defineMessages } from 'react-intl'; import { STATUS_FETCH_SOURCE_FAIL, STATUS_FETCH_SOURCE_REQUEST, STATUS_FETCH_SOURCE_SUCCESS } from 'pl-fe/actions/statuses'; import { getClient } from 'pl-fe/api'; -import { importEntities } from 'pl-fe/pl-hooks/importer'; import { useModalsStore } from 'pl-fe/stores'; import toast from 'pl-fe/toast'; diff --git a/packages/pl-fe/src/actions/familiar-followers.ts b/packages/pl-fe/src/actions/familiar-followers.ts index 404a99259..f4e185820 100644 --- a/packages/pl-fe/src/actions/familiar-followers.ts +++ b/packages/pl-fe/src/actions/familiar-followers.ts @@ -1,5 +1,6 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; + +import { getClient } from 'pl-fe/api'; import { AppDispatch, RootState } from 'pl-fe/store'; import { fetchRelationships } from './accounts'; diff --git a/packages/pl-fe/src/actions/favourites.ts b/packages/pl-fe/src/actions/favourites.ts index 2ba10fcd5..c4c3b747b 100644 --- a/packages/pl-fe/src/actions/favourites.ts +++ b/packages/pl-fe/src/actions/favourites.ts @@ -1,5 +1,6 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; + +import { getClient } from 'pl-fe/api'; import { isLoggedIn } from 'pl-fe/utils/auth'; import type { PaginatedResponse, Status } from 'pl-api'; diff --git a/packages/pl-fe/src/actions/groups.ts b/packages/pl-fe/src/actions/groups.ts index 3c719c877..3844a606d 100644 --- a/packages/pl-fe/src/actions/groups.ts +++ b/packages/pl-fe/src/actions/groups.ts @@ -1,6 +1,7 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; +import { getClient } from 'pl-fe/api'; + import type { Account, PaginatedResponse } from 'pl-api'; import type { AppDispatch, RootState } from 'pl-fe/store'; diff --git a/packages/pl-fe/src/actions/history.ts b/packages/pl-fe/src/actions/history.ts index 1f110f11e..59f48fdb0 100644 --- a/packages/pl-fe/src/actions/history.ts +++ b/packages/pl-fe/src/actions/history.ts @@ -1,6 +1,7 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; +import { getClient } from 'pl-fe/api'; + import type { StatusEdit } from 'pl-api'; import type { AppDispatch, RootState } from 'pl-fe/store'; diff --git a/packages/pl-fe/src/actions/interactions.ts b/packages/pl-fe/src/actions/interactions.ts index 81a36c9c8..65b5d58bc 100644 --- a/packages/pl-fe/src/actions/interactions.ts +++ b/packages/pl-fe/src/actions/interactions.ts @@ -1,7 +1,7 @@ +import { importEntities } from 'pl-fe/pl-hooks/importer'; import { defineMessages } from 'react-intl'; import { getClient } from 'pl-fe/api'; -import { importEntities } from 'pl-fe/pl-hooks/importer'; import { useModalsStore } from 'pl-fe/stores'; import toast, { type IToastOptions } from 'pl-fe/toast'; import { isLoggedIn } from 'pl-fe/utils/auth'; diff --git a/packages/pl-fe/src/actions/lists.ts b/packages/pl-fe/src/actions/lists.ts index 502a363a9..c30f83a58 100644 --- a/packages/pl-fe/src/actions/lists.ts +++ b/packages/pl-fe/src/actions/lists.ts @@ -1,5 +1,6 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; + +import { getClient } from 'pl-fe/api'; import { selectAccount } from 'pl-fe/selectors'; import toast from 'pl-fe/toast'; import { isLoggedIn } from 'pl-fe/utils/auth'; diff --git a/packages/pl-fe/src/actions/me.ts b/packages/pl-fe/src/actions/me.ts index 0febc7f61..38958f894 100644 --- a/packages/pl-fe/src/actions/me.ts +++ b/packages/pl-fe/src/actions/me.ts @@ -1,5 +1,6 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; + +import { getClient } from 'pl-fe/api'; import { selectAccount } from 'pl-fe/selectors'; import { setSentryAccount } from 'pl-fe/sentry'; import KVStore from 'pl-fe/storage/kv-store'; diff --git a/packages/pl-fe/src/actions/notifications.ts b/packages/pl-fe/src/actions/notifications.ts index 635d4484a..6687ff683 100644 --- a/packages/pl-fe/src/actions/notifications.ts +++ b/packages/pl-fe/src/actions/notifications.ts @@ -1,11 +1,11 @@ import IntlMessageFormat from 'intl-messageformat'; import 'intl-pluralrules'; +import { importEntities } from 'pl-fe/pl-hooks/importer'; import { defineMessages } from 'react-intl'; import { FILTER_TYPES, type FilterType } from 'pl-fe/features/notifications'; import { getNotificationStatus } from 'pl-fe/features/notifications/components/notification'; import { normalizeNotification } from 'pl-fe/normalizers'; -import { importEntities } from 'pl-fe/pl-hooks/importer'; import { queryClient } from 'pl-fe/queries/client'; import { getFilters, regexFromFilters } from 'pl-fe/selectors'; import { unescapeHTML } from 'pl-fe/utils/html'; @@ -129,7 +129,7 @@ const dequeueNotifications = () => // dispatch(markReadNotifications()); }; -const setFilter = (filterType: FilterType | 'all') => +const setFilter = (filterType: FilterType) => (dispatch: AppDispatch, getState: () => RootState) => { const activeFilter = getSettings(getState()).getIn(['notifications', 'quickFilter', 'active']); diff --git a/packages/pl-fe/src/actions/pin-statuses.ts b/packages/pl-fe/src/actions/pin-statuses.ts index f4968f194..e67474afe 100644 --- a/packages/pl-fe/src/actions/pin-statuses.ts +++ b/packages/pl-fe/src/actions/pin-statuses.ts @@ -1,5 +1,6 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; + +import { getClient } from 'pl-fe/api'; import { isLoggedIn } from 'pl-fe/utils/auth'; import type { Status } from 'pl-api'; diff --git a/packages/pl-fe/src/actions/polls.ts b/packages/pl-fe/src/actions/polls.ts index c913f9ef8..82af7b4c5 100644 --- a/packages/pl-fe/src/actions/polls.ts +++ b/packages/pl-fe/src/actions/polls.ts @@ -1,6 +1,7 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; +import { getClient } from 'pl-fe/api'; + import type { Poll } from 'pl-api'; import type { AppDispatch, RootState } from 'pl-fe/store'; diff --git a/packages/pl-fe/src/actions/preload.ts b/packages/pl-fe/src/actions/preload.ts index 7925046ea..a523f6c9c 100644 --- a/packages/pl-fe/src/actions/preload.ts +++ b/packages/pl-fe/src/actions/preload.ts @@ -1,5 +1,4 @@ import mapValues from 'lodash/mapValues'; - import { importEntities } from 'pl-fe/pl-hooks/importer'; import { verifyCredentials } from './auth'; diff --git a/packages/pl-fe/src/actions/search.ts b/packages/pl-fe/src/actions/search.ts index c7c03ad81..b04f18940 100644 --- a/packages/pl-fe/src/actions/search.ts +++ b/packages/pl-fe/src/actions/search.ts @@ -1,6 +1,7 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; +import { getClient } from 'pl-fe/api'; + import { fetchRelationships } from './accounts'; import type { Search } from 'pl-api'; diff --git a/packages/pl-fe/src/actions/status-quotes.ts b/packages/pl-fe/src/actions/status-quotes.ts index a865e23cd..8bdd19f5c 100644 --- a/packages/pl-fe/src/actions/status-quotes.ts +++ b/packages/pl-fe/src/actions/status-quotes.ts @@ -1,6 +1,7 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; +import { getClient } from 'pl-fe/api'; + import type { Status as BaseStatus, PaginatedResponse } from 'pl-api'; import type { AppDispatch, RootState } from 'pl-fe/store'; diff --git a/packages/pl-fe/src/actions/statuses.ts b/packages/pl-fe/src/actions/statuses.ts index cd0934ece..db782b070 100644 --- a/packages/pl-fe/src/actions/statuses.ts +++ b/packages/pl-fe/src/actions/statuses.ts @@ -1,5 +1,6 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; + +import { getClient } from 'pl-fe/api'; import { useModalsStore } from 'pl-fe/stores'; import { isLoggedIn } from 'pl-fe/utils/auth'; import { shouldHaveCard } from 'pl-fe/utils/status'; diff --git a/packages/pl-fe/src/actions/suggestions.ts b/packages/pl-fe/src/actions/suggestions.ts index 59baafb7c..cee2f3908 100644 --- a/packages/pl-fe/src/actions/suggestions.ts +++ b/packages/pl-fe/src/actions/suggestions.ts @@ -1,6 +1,7 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; +import { getClient } from 'pl-fe/api'; + import { fetchRelationships } from './accounts'; import { insertSuggestionsIntoTimeline } from './timelines'; diff --git a/packages/pl-fe/src/actions/timelines.ts b/packages/pl-fe/src/actions/timelines.ts index 641fe377f..41bcbc347 100644 --- a/packages/pl-fe/src/actions/timelines.ts +++ b/packages/pl-fe/src/actions/timelines.ts @@ -1,8 +1,8 @@ import { Map as ImmutableMap } from 'immutable'; +import { importEntities } from 'pl-fe/pl-hooks/importer'; import { getLocale, getSettings } from 'pl-fe/actions/settings'; import { getClient } from 'pl-fe/api'; -import { importEntities } from 'pl-fe/pl-hooks/importer'; import { shouldFilter } from 'pl-fe/utils/timelines'; import type { PaginatedResponse, Status as BaseStatus, PublicTimelineParams, HomeTimelineParams, ListTimelineParams, HashtagTimelineParams, GetAccountStatusesParams, GroupTimelineParams } from 'pl-api'; diff --git a/packages/pl-fe/src/actions/trending-statuses.ts b/packages/pl-fe/src/actions/trending-statuses.ts index 9534c4e18..c6d8db428 100644 --- a/packages/pl-fe/src/actions/trending-statuses.ts +++ b/packages/pl-fe/src/actions/trending-statuses.ts @@ -1,6 +1,7 @@ -import { getClient } from 'pl-fe/api'; import { importEntities } from 'pl-fe/pl-hooks/importer'; +import { getClient } from 'pl-fe/api'; + import type { AppDispatch, RootState } from 'pl-fe/store'; const TRENDING_STATUSES_FETCH_REQUEST = 'TRENDING_STATUSES_FETCH_REQUEST' as const; diff --git a/packages/pl-fe/src/components/account.tsx b/packages/pl-fe/src/components/account.tsx index d306b0adf..b074b9e49 100644 --- a/packages/pl-fe/src/components/account.tsx +++ b/packages/pl-fe/src/components/account.tsx @@ -47,7 +47,7 @@ const InstanceFavicon: React.FC = ({ account, disabled }) => { return ( diff --git a/packages/pl-fe/src/components/autosuggest-input.tsx b/packages/pl-fe/src/components/autosuggest-input.tsx index 4ce065837..557376496 100644 --- a/packages/pl-fe/src/components/autosuggest-input.tsx +++ b/packages/pl-fe/src/components/autosuggest-input.tsx @@ -230,7 +230,7 @@ class AutosuggestInput extends ImmutablePureComponent { return menu.map((item, i) => ( = ({ accountIds, limit = 3 }) => { style={{ zIndex: limit - i }} > = ({ title, subtitle, children }) => ( -
+
{title} {subtitle && {subtitle}} diff --git a/packages/pl-fe/src/components/dropdown-menu/dropdown-menu-item.tsx b/packages/pl-fe/src/components/dropdown-menu/dropdown-menu-item.tsx index b203c2348..430a56c0e 100644 --- a/packages/pl-fe/src/components/dropdown-menu/dropdown-menu-item.tsx +++ b/packages/pl-fe/src/components/dropdown-menu/dropdown-menu-item.tsx @@ -99,7 +99,7 @@ const DropdownMenuItem = ({ index, item, onClick, autoFocus, onSetTab }: IDropdo } return ( -
  • +
  • { } const getClassName = () => { - const className = clsx('z-[1001] bg-white py-1 shadow-lg ease-in-out focus:outline-none black:bg-black no-reduce-motion:transition-all dark:bg-gray-900 dark:ring-2 dark:ring-primary-700', { + const className = clsx('black:bg-black no-reduce-motion:transition-all dark:ring-primary-700 z-[1001] bg-white py-1 shadow-lg ease-in-out focus:outline-none dark:bg-gray-900 dark:ring-2', { 'rounded-md min-w-56 max-w-sm duration-100': true, 'no-reduce-motion:scale-0': !(isDisplayed && isOpen), 'scale-100': isDisplayed && isOpen, @@ -368,7 +368,7 @@ const DropdownMenu = (props: IDropdownMenu) => {
  • diff --git a/packages/pl-fe/src/components/event-preview.tsx b/packages/pl-fe/src/components/event-preview.tsx index 575facdcc..a224dc2ce 100644 --- a/packages/pl-fe/src/components/event-preview.tsx +++ b/packages/pl-fe/src/components/event-preview.tsx @@ -51,11 +51,11 @@ const EventPreview: React.FC = ({ status, className, hideAction, )); return ( -
    +
    {floatingAction && action}
    -
    +
    {banner && {intl.formatMessage(messages.eventBanner)}}
    diff --git a/packages/pl-fe/src/components/group-card.tsx b/packages/pl-fe/src/components/group-card.tsx index 11c1d2b21..644609695 100644 --- a/packages/pl-fe/src/components/group-card.tsx +++ b/packages/pl-fe/src/components/group-card.tsx @@ -16,11 +16,11 @@ interface IGroupCard { const GroupCard: React.FC = ({ group }) => ( {/* Group Cover Image */} - + { content={ {/* Group Cover Image */} - + {group.header && ( ( -
    +
    ); export { LandingGradient as default }; diff --git a/packages/pl-fe/src/components/link.tsx b/packages/pl-fe/src/components/link.tsx index 413061279..7516ce49f 100644 --- a/packages/pl-fe/src/components/link.tsx +++ b/packages/pl-fe/src/components/link.tsx @@ -4,7 +4,7 @@ import { Link as Comp, LinkProps } from 'react-router-dom'; const Link = (props: LinkProps) => ( ); diff --git a/packages/pl-fe/src/components/list.tsx b/packages/pl-fe/src/components/list.tsx index 4d5934d26..82541544c 100644 --- a/packages/pl-fe/src/components/list.tsx +++ b/packages/pl-fe/src/components/list.tsx @@ -56,7 +56,7 @@ const ListItem: React.FC = ({ className, label, hint, children, to, h return null; }), [children, domId]); - const classNames = clsx('flex items-center justify-between overflow-hidden bg-gradient-to-r from-gradient-start/20 to-gradient-end/20 first:rounded-t-lg last:rounded-b-lg dark:from-gradient-start/10 dark:to-gradient-end/10', + const classNames = clsx('from-gradient-start/20 to-gradient-end/20 dark:from-gradient-start/10 dark:to-gradient-end/10 flex items-center justify-between overflow-hidden bg-gradient-to-r first:rounded-t-lg last:rounded-b-lg', className, { 'px-4 py-2': size === 'md', diff --git a/packages/pl-fe/src/components/mention.tsx b/packages/pl-fe/src/components/mention.tsx index 582d98990..5dbbca63b 100644 --- a/packages/pl-fe/src/components/mention.tsx +++ b/packages/pl-fe/src/components/mention.tsx @@ -23,7 +23,7 @@ const Mention: React.FC = ({ mention: { acct, username }, disabled }) diff --git a/packages/pl-fe/src/components/modal-root.tsx b/packages/pl-fe/src/components/modal-root.tsx index dd658e786..2b1801e54 100644 --- a/packages/pl-fe/src/components/modal-root.tsx +++ b/packages/pl-fe/src/components/modal-root.tsx @@ -233,7 +233,7 @@ const ModalRoot: React.FC = ({ children, onCancel, onClose, type })