From 047a371a452ed6c9874db8cb2351e65cbb0490c8 Mon Sep 17 00:00:00 2001 From: mkljczk Date: Thu, 5 Dec 2024 10:18:27 +0100 Subject: [PATCH] pl-fe: move stuff around Signed-off-by: mkljczk --- packages/pl-fe/src/actions/accounts.ts | 2 +- packages/pl-fe/src/actions/domain-blocks.ts | 2 +- packages/pl-fe/src/actions/notifications.ts | 2 +- .../api/hooks/accounts/use-account-lookup.ts | 3 +- .../src/api/hooks/accounts/use-account.ts | 3 +- .../src/api/hooks/admin/use-announcements.ts | 2 +- .../api/hooks/statuses/use-bookmark-folder.ts | 5 -- .../hooks/statuses/use-bookmark-folders.ts | 22 ------- .../statuses/use-create-bookmark-folder.ts | 21 ------ .../statuses/use-delete-bookmark-folder.ts | 16 ----- .../statuses/use-update-bookmark-folder.ts | 21 ------ .../api/hooks/streaming/use-user-stream.ts | 2 +- .../announcements/announcements-panel.tsx | 2 +- .../src/components/announcements/reaction.tsx | 2 +- .../announcements/reactions-bar.tsx | 2 +- .../pl-fe/src/components/birthday-panel.tsx | 2 +- .../pl-fe/src/components/location-search.tsx | 2 +- .../pl-fe/src/components/sidebar-menu.tsx | 4 +- .../src/components/sidebar-navigation.tsx | 4 +- .../src/components/status-action-bar.tsx | 2 +- .../pl-fe/src/components/status-content.tsx | 2 +- .../pl-fe/src/components/translate-button.tsx | 4 +- packages/pl-fe/src/components/upload.tsx | 2 +- packages/pl-fe/src/features/about/index.tsx | 2 +- packages/pl-fe/src/features/audio/index.tsx | 2 +- .../components/new-folder-form.tsx | 2 +- .../src/features/bookmark-folders/index.tsx | 2 +- .../pl-fe/src/features/bookmarks/index.tsx | 3 +- .../tabs/manage-pending-participants.tsx | 2 +- .../pl-fe/src/features/directory/index.tsx | 2 +- .../components/account-authorize.tsx | 2 +- .../src/features/follow-requests/index.tsx | 2 +- .../features/interaction-requests/index.tsx | 2 +- packages/pl-fe/src/features/quotes/index.tsx | 2 +- .../search/components/search-results.tsx | 8 +-- .../features/ui/components/action-button.tsx | 2 +- .../ui/components/modals/birthdays-modal.tsx | 2 +- .../modals/compare-history-modal.tsx | 2 +- .../ui/components/modals/dislikes-modal.tsx | 2 +- .../modals/edit-bookmark-folder-modal.tsx | 3 +- .../modals/event-participants-modal.tsx | 2 +- .../modals/familiar-followers-modal.tsx | 2 +- .../ui/components/modals/favourites-modal.tsx | 2 +- .../ui/components/modals/reactions-modal.tsx | 2 +- .../ui/components/modals/reblogs-modal.tsx | 2 +- .../modals/select-bookmark-folder-modal.tsx | 2 +- .../panels/pinned-accounts-panel.tsx | 2 +- .../components/profile-familiar-followers.tsx | 2 +- packages/pl-fe/src/features/ui/index.tsx | 2 +- packages/pl-fe/src/features/video/index.tsx | 2 +- .../account-lists/use-birthday-reminders.ts | 0 .../account-lists/use-directory.ts | 0 .../account-lists/use-endorsed-accounts.ts | 0 .../use-event-participation-requests.ts | 0 .../account-lists/use-event-participations.ts | 0 .../account-lists/use-familiar-followers.ts | 0 .../account-lists/use-follow-requests.ts | 0 .../account-lists/use-status-interactions.ts | 0 .../accounts/use-account-scrobble.ts | 0 .../announcements/use-announcements.ts | 0 .../instance/use-translation-languages.ts | 0 .../hooks => queries}/pl-fe/use-about-page.ts | 0 .../search/use-search-location.ts | 0 .../hooks => queries}/search/use-search.ts | 0 .../queries/statuses/use-bookmark-folders.ts | 66 +++++++++++++++++++ .../statuses/use-interaction-requests.ts | 0 .../statuses/use-status-history.ts | 0 .../statuses/use-status-quotes.ts | 0 .../statuses/use-status-translation.ts | 0 .../trends/use-suggested-accounts.ts | 0 .../trends/use-trending-links.ts | 0 .../trends/use-trending-statuses.ts | 0 72 files changed, 119 insertions(+), 138 deletions(-) delete mode 100644 packages/pl-fe/src/api/hooks/statuses/use-bookmark-folder.ts delete mode 100644 packages/pl-fe/src/api/hooks/statuses/use-bookmark-folders.ts delete mode 100644 packages/pl-fe/src/api/hooks/statuses/use-create-bookmark-folder.ts delete mode 100644 packages/pl-fe/src/api/hooks/statuses/use-delete-bookmark-folder.ts delete mode 100644 packages/pl-fe/src/api/hooks/statuses/use-update-bookmark-folder.ts rename packages/pl-fe/src/{api/hooks => queries}/account-lists/use-birthday-reminders.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/account-lists/use-directory.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/account-lists/use-endorsed-accounts.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/account-lists/use-event-participation-requests.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/account-lists/use-event-participations.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/account-lists/use-familiar-followers.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/account-lists/use-follow-requests.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/account-lists/use-status-interactions.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/accounts/use-account-scrobble.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/announcements/use-announcements.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/instance/use-translation-languages.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/pl-fe/use-about-page.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/search/use-search-location.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/search/use-search.ts (100%) create mode 100644 packages/pl-fe/src/queries/statuses/use-bookmark-folders.ts rename packages/pl-fe/src/{api/hooks => queries}/statuses/use-interaction-requests.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/statuses/use-status-history.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/statuses/use-status-quotes.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/statuses/use-status-translation.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/trends/use-suggested-accounts.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/trends/use-trending-links.ts (100%) rename packages/pl-fe/src/{api/hooks => queries}/trends/use-trending-statuses.ts (100%) diff --git a/packages/pl-fe/src/actions/accounts.ts b/packages/pl-fe/src/actions/accounts.ts index d20c14b46..966bd8089 100644 --- a/packages/pl-fe/src/actions/accounts.ts +++ b/packages/pl-fe/src/actions/accounts.ts @@ -17,7 +17,7 @@ import { getClient, type PlfeResponse } from '../api'; import { importEntities } from './importer'; -import type { MinifiedSuggestion } from 'pl-fe/api/hooks/trends/use-suggested-accounts'; +import type { MinifiedSuggestion } from 'pl-fe/queries/trends/use-suggested-accounts'; import type { MinifiedStatus } from 'pl-fe/reducers/statuses'; import type { AppDispatch, RootState } from 'pl-fe/store'; import type { History } from 'pl-fe/types/history'; diff --git a/packages/pl-fe/src/actions/domain-blocks.ts b/packages/pl-fe/src/actions/domain-blocks.ts index 439801b06..88c3903c0 100644 --- a/packages/pl-fe/src/actions/domain-blocks.ts +++ b/packages/pl-fe/src/actions/domain-blocks.ts @@ -5,9 +5,9 @@ import { isLoggedIn } from 'pl-fe/utils/auth'; import { getClient } from '../api'; import type { PaginatedResponse } from 'pl-api'; -import type { MinifiedSuggestion } from 'pl-fe/api/hooks/trends/use-suggested-accounts'; import type { EntityStore } from 'pl-fe/entity-store/types'; import type { Account } from 'pl-fe/normalizers/account'; +import type { MinifiedSuggestion } from 'pl-fe/queries/trends/use-suggested-accounts'; import type { AppDispatch, RootState } from 'pl-fe/store'; const DOMAIN_BLOCK_REQUEST = 'DOMAIN_BLOCK_REQUEST' as const; diff --git a/packages/pl-fe/src/actions/notifications.ts b/packages/pl-fe/src/actions/notifications.ts index 34976f763..f8c5df481 100644 --- a/packages/pl-fe/src/actions/notifications.ts +++ b/packages/pl-fe/src/actions/notifications.ts @@ -3,9 +3,9 @@ import 'intl-pluralrules'; import { defineMessages } from 'react-intl'; import { getClient } from 'pl-fe/api'; -import { appendFollowRequest } from 'pl-fe/api/hooks/account-lists/use-follow-requests'; import { getNotificationStatus } from 'pl-fe/features/notifications/components/notification'; import { normalizeNotification } from 'pl-fe/normalizers/notification'; +import { appendFollowRequest } from 'pl-fe/queries/account-lists/use-follow-requests'; import { getFilters, regexFromFilters } from 'pl-fe/selectors'; import { useSettingsStore } from 'pl-fe/stores/settings'; import { isLoggedIn } from 'pl-fe/utils/auth'; diff --git a/packages/pl-fe/src/api/hooks/accounts/use-account-lookup.ts b/packages/pl-fe/src/api/hooks/accounts/use-account-lookup.ts index ac3806700..86abdc638 100644 --- a/packages/pl-fe/src/api/hooks/accounts/use-account-lookup.ts +++ b/packages/pl-fe/src/api/hooks/accounts/use-account-lookup.ts @@ -8,7 +8,8 @@ import { useFeatures } from 'pl-fe/hooks/use-features'; import { useLoggedIn } from 'pl-fe/hooks/use-logged-in'; import { type Account, normalizeAccount } from 'pl-fe/normalizers/account'; -import { useAccountScrobble } from './use-account-scrobble'; +import { useAccountScrobble } from '../../../queries/accounts/use-account-scrobble'; + import { useRelationship } from './use-relationship'; import type { Account as BaseAccount } from 'pl-api'; diff --git a/packages/pl-fe/src/api/hooks/accounts/use-account.ts b/packages/pl-fe/src/api/hooks/accounts/use-account.ts index 2f27e7ef7..75f0e3ac7 100644 --- a/packages/pl-fe/src/api/hooks/accounts/use-account.ts +++ b/packages/pl-fe/src/api/hooks/accounts/use-account.ts @@ -9,7 +9,8 @@ import { useFeatures } from 'pl-fe/hooks/use-features'; import { useLoggedIn } from 'pl-fe/hooks/use-logged-in'; import { type Account, normalizeAccount } from 'pl-fe/normalizers/account'; -import { useAccountScrobble } from './use-account-scrobble'; +import { useAccountScrobble } from '../../../queries/accounts/use-account-scrobble'; + import { useRelationship } from './use-relationship'; import type { Account as BaseAccount } from 'pl-api'; diff --git a/packages/pl-fe/src/api/hooks/admin/use-announcements.ts b/packages/pl-fe/src/api/hooks/admin/use-announcements.ts index c313e0895..651ae4b0b 100644 --- a/packages/pl-fe/src/api/hooks/admin/use-announcements.ts +++ b/packages/pl-fe/src/api/hooks/admin/use-announcements.ts @@ -10,7 +10,7 @@ import * as v from 'valibot'; import { useClient } from 'pl-fe/hooks/use-client'; import { queryClient } from 'pl-fe/queries/client'; -import { useAnnouncements as useUserAnnouncements } from '../announcements/use-announcements'; +import { useAnnouncements as useUserAnnouncements } from '../../../queries/announcements/use-announcements'; const useAnnouncements = () => { const client = useClient(); diff --git a/packages/pl-fe/src/api/hooks/statuses/use-bookmark-folder.ts b/packages/pl-fe/src/api/hooks/statuses/use-bookmark-folder.ts deleted file mode 100644 index 79f145aaa..000000000 --- a/packages/pl-fe/src/api/hooks/statuses/use-bookmark-folder.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { useBookmarkFolders } from './use-bookmark-folders'; - -const useBookmarkFolder = (folderId?: string) => useBookmarkFolders((data) => folderId ? data.find(folder => folder.id === folderId) : undefined); - -export { useBookmarkFolder }; diff --git a/packages/pl-fe/src/api/hooks/statuses/use-bookmark-folders.ts b/packages/pl-fe/src/api/hooks/statuses/use-bookmark-folders.ts deleted file mode 100644 index 7e857b1ac..000000000 --- a/packages/pl-fe/src/api/hooks/statuses/use-bookmark-folders.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { useQuery } from '@tanstack/react-query'; - -import { useClient } from 'pl-fe/hooks/use-client'; -import { useFeatures } from 'pl-fe/hooks/use-features'; - -import type { BookmarkFolder } from 'pl-api'; - -const useBookmarkFolders = ( - select?: ((data: Array) => T), -) => { - const client = useClient(); - const features = useFeatures(); - - return useQuery({ - queryKey: ['bookmarkFolders'], - queryFn: () => client.myAccount.getBookmarkFolders(), - enabled: features.bookmarkFolders, - select, - }); -}; - -export { useBookmarkFolders }; diff --git a/packages/pl-fe/src/api/hooks/statuses/use-create-bookmark-folder.ts b/packages/pl-fe/src/api/hooks/statuses/use-create-bookmark-folder.ts deleted file mode 100644 index 0cc9acfc8..000000000 --- a/packages/pl-fe/src/api/hooks/statuses/use-create-bookmark-folder.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { useMutation } from '@tanstack/react-query'; - -import { useClient } from 'pl-fe/hooks/use-client'; -import { queryClient } from 'pl-fe/queries/client'; - -interface CreateBookmarkFolderParams { - name: string; - emoji?: string; -} - -const useCreateBookmarkFolder = () => { - const client = useClient(); - - return useMutation({ - mutationKey: ['bookmarkFolders', 'create'], - mutationFn: (params: CreateBookmarkFolderParams) => client.myAccount.createBookmarkFolder(params), - onSettled: () => queryClient.invalidateQueries({ queryKey: ['bookmarkFolders'] }), - }); -}; - -export { useCreateBookmarkFolder }; diff --git a/packages/pl-fe/src/api/hooks/statuses/use-delete-bookmark-folder.ts b/packages/pl-fe/src/api/hooks/statuses/use-delete-bookmark-folder.ts deleted file mode 100644 index 9c96d5786..000000000 --- a/packages/pl-fe/src/api/hooks/statuses/use-delete-bookmark-folder.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { useMutation } from '@tanstack/react-query'; - -import { useClient } from 'pl-fe/hooks/use-client'; -import { queryClient } from 'pl-fe/queries/client'; - -const useDeleteBookmarkFolder = () => { - const client = useClient(); - - return useMutation({ - mutationKey: ['bookmarkFolders', 'delete'], - mutationFn: (folderId: string) => client.myAccount.deleteBookmarkFolder(folderId), - onSettled: () => queryClient.invalidateQueries({ queryKey: ['bookmarkFolders'] }), - }); -}; - -export { useDeleteBookmarkFolder }; diff --git a/packages/pl-fe/src/api/hooks/statuses/use-update-bookmark-folder.ts b/packages/pl-fe/src/api/hooks/statuses/use-update-bookmark-folder.ts deleted file mode 100644 index 13c6b28e9..000000000 --- a/packages/pl-fe/src/api/hooks/statuses/use-update-bookmark-folder.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { useMutation } from '@tanstack/react-query'; - -import { useClient } from 'pl-fe/hooks/use-client'; -import { queryClient } from 'pl-fe/queries/client'; - -interface UpdateBookmarkFolderParams { - name: string; - emoji?: string; -} - -const useUpdateBookmarkFolder = (folderId: string) => { - const client = useClient(); - - return useMutation({ - mutationKey: ['bookmarkFolders', 'update', folderId], - mutationFn: (params: UpdateBookmarkFolderParams) => client.myAccount.updateBookmarkFolder(folderId, params), - onSettled: () => queryClient.invalidateQueries({ queryKey: ['bookmarkFolders'] }), - }); -}; - -export { useUpdateBookmarkFolder }; diff --git a/packages/pl-fe/src/api/hooks/streaming/use-user-stream.ts b/packages/pl-fe/src/api/hooks/streaming/use-user-stream.ts index ac161db0c..8804f0741 100644 --- a/packages/pl-fe/src/api/hooks/streaming/use-user-stream.ts +++ b/packages/pl-fe/src/api/hooks/streaming/use-user-stream.ts @@ -19,7 +19,7 @@ import { useSettingsStore } from 'pl-fe/stores/settings'; import { getUnreadChatsCount, updateChatListItem } from 'pl-fe/utils/chats'; import { play, soundCache } from 'pl-fe/utils/sounds'; -import { updateReactions } from '../announcements/use-announcements'; +import { updateReactions } from '../../../queries/announcements/use-announcements'; import { useTimelineStream } from './use-timeline-stream'; diff --git a/packages/pl-fe/src/components/announcements/announcements-panel.tsx b/packages/pl-fe/src/components/announcements/announcements-panel.tsx index ecbddd826..1f66af996 100644 --- a/packages/pl-fe/src/components/announcements/announcements-panel.tsx +++ b/packages/pl-fe/src/components/announcements/announcements-panel.tsx @@ -4,11 +4,11 @@ import { FormattedMessage } from 'react-intl'; import ReactSwipeableViews from 'react-swipeable-views'; import { createSelector } from 'reselect'; -import { useAnnouncements } from 'pl-fe/api/hooks/announcements/use-announcements'; import Card from 'pl-fe/components/ui/card'; import HStack from 'pl-fe/components/ui/hstack'; import Widget from 'pl-fe/components/ui/widget'; import { useAppSelector } from 'pl-fe/hooks/use-app-selector'; +import { useAnnouncements } from 'pl-fe/queries/announcements/use-announcements'; import Announcement from './announcement'; diff --git a/packages/pl-fe/src/components/announcements/reaction.tsx b/packages/pl-fe/src/components/announcements/reaction.tsx index 99ba3b790..ac6d817c2 100644 --- a/packages/pl-fe/src/components/announcements/reaction.tsx +++ b/packages/pl-fe/src/components/announcements/reaction.tsx @@ -1,9 +1,9 @@ import clsx from 'clsx'; import React, { useState } from 'react'; -import { useAnnouncements } from 'pl-fe/api/hooks/announcements/use-announcements'; import AnimatedNumber from 'pl-fe/components/animated-number'; import unicodeMapping from 'pl-fe/features/emoji/mapping'; +import { useAnnouncements } from 'pl-fe/queries/announcements/use-announcements'; import Emoji from './emoji'; diff --git a/packages/pl-fe/src/components/announcements/reactions-bar.tsx b/packages/pl-fe/src/components/announcements/reactions-bar.tsx index d0db5971b..3d56c774d 100644 --- a/packages/pl-fe/src/components/announcements/reactions-bar.tsx +++ b/packages/pl-fe/src/components/announcements/reactions-bar.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { TransitionMotion, spring } from 'react-motion'; -import { useAnnouncements } from 'pl-fe/api/hooks/announcements/use-announcements'; import EmojiPickerDropdown from 'pl-fe/features/emoji/containers/emoji-picker-dropdown-container'; import { useSettings } from 'pl-fe/hooks/use-settings'; +import { useAnnouncements } from 'pl-fe/queries/announcements/use-announcements'; import Reaction from './reaction'; diff --git a/packages/pl-fe/src/components/birthday-panel.tsx b/packages/pl-fe/src/components/birthday-panel.tsx index b7b9f06a6..8205351fd 100644 --- a/packages/pl-fe/src/components/birthday-panel.tsx +++ b/packages/pl-fe/src/components/birthday-panel.tsx @@ -1,9 +1,9 @@ import React, { useRef, useState } from 'react'; import { FormattedMessage } from 'react-intl'; -import { useBirthdayReminders } from 'pl-fe/api/hooks/account-lists/use-birthday-reminders'; import Widget from 'pl-fe/components/ui/widget'; import AccountContainer from 'pl-fe/containers/account-container'; +import { useBirthdayReminders } from 'pl-fe/queries/account-lists/use-birthday-reminders'; const timeToMidnight = () => { const now = new Date(); diff --git a/packages/pl-fe/src/components/location-search.tsx b/packages/pl-fe/src/components/location-search.tsx index 7e1a19530..4766a10a8 100644 --- a/packages/pl-fe/src/components/location-search.tsx +++ b/packages/pl-fe/src/components/location-search.tsx @@ -3,9 +3,9 @@ import clsx from 'clsx'; import React, { useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import { useSearchLocation } from 'pl-fe/api/hooks/search/use-search-location'; import AutosuggestInput, { AutoSuggestion } from 'pl-fe/components/autosuggest-input'; import Icon from 'pl-fe/components/icon'; +import { useSearchLocation } from 'pl-fe/queries/search/use-search-location'; import type { Location } from 'pl-api'; diff --git a/packages/pl-fe/src/components/sidebar-menu.tsx b/packages/pl-fe/src/components/sidebar-menu.tsx index aabaaff18..d1d9669d5 100644 --- a/packages/pl-fe/src/components/sidebar-menu.tsx +++ b/packages/pl-fe/src/components/sidebar-menu.tsx @@ -5,9 +5,7 @@ import { defineMessages, useIntl, FormattedMessage } from 'react-intl'; import { Link, NavLink } from 'react-router-dom'; import { fetchOwnAccounts, logOut, switchAccount } from 'pl-fe/actions/auth'; -import { useFollowRequestsCount } from 'pl-fe/api/hooks/account-lists/use-follow-requests'; import { useAccount } from 'pl-fe/api/hooks/accounts/use-account'; -import { useInteractionRequestsCount } from 'pl-fe/api/hooks/statuses/use-interaction-requests'; import Account from 'pl-fe/components/account'; import Divider from 'pl-fe/components/ui/divider'; import HStack from 'pl-fe/components/ui/hstack'; @@ -20,6 +18,8 @@ import { useAppSelector } from 'pl-fe/hooks/use-app-selector'; import { useFeatures } from 'pl-fe/hooks/use-features'; import { useInstance } from 'pl-fe/hooks/use-instance'; import { useRegistrationStatus } from 'pl-fe/hooks/use-registration-status'; +import { useFollowRequestsCount } from 'pl-fe/queries/account-lists/use-follow-requests'; +import { useInteractionRequestsCount } from 'pl-fe/queries/statuses/use-interaction-requests'; import { makeGetOtherAccounts } from 'pl-fe/selectors'; import { useSettingsStore } from 'pl-fe/stores/settings'; import { useUiStore } from 'pl-fe/stores/ui'; diff --git a/packages/pl-fe/src/components/sidebar-navigation.tsx b/packages/pl-fe/src/components/sidebar-navigation.tsx index bb18d825e..ad3313a61 100644 --- a/packages/pl-fe/src/components/sidebar-navigation.tsx +++ b/packages/pl-fe/src/components/sidebar-navigation.tsx @@ -1,8 +1,6 @@ import React from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; -import { useFollowRequestsCount } from 'pl-fe/api/hooks/account-lists/use-follow-requests'; -import { useInteractionRequestsCount } from 'pl-fe/api/hooks/statuses/use-interaction-requests'; import Icon from 'pl-fe/components/ui/icon'; import Stack from 'pl-fe/components/ui/stack'; import { useStatContext } from 'pl-fe/contexts/stat-context'; @@ -15,6 +13,8 @@ import { useLogo } from 'pl-fe/hooks/use-logo'; import { useOwnAccount } from 'pl-fe/hooks/use-own-account'; import { useRegistrationStatus } from 'pl-fe/hooks/use-registration-status'; import { useSettings } from 'pl-fe/hooks/use-settings'; +import { useFollowRequestsCount } from 'pl-fe/queries/account-lists/use-follow-requests'; +import { useInteractionRequestsCount } from 'pl-fe/queries/statuses/use-interaction-requests'; import Account from './account'; import DropdownMenu, { Menu } from './dropdown-menu'; diff --git a/packages/pl-fe/src/components/status-action-bar.tsx b/packages/pl-fe/src/components/status-action-bar.tsx index 413173f89..1171584ab 100644 --- a/packages/pl-fe/src/components/status-action-bar.tsx +++ b/packages/pl-fe/src/components/status-action-bar.tsx @@ -17,7 +17,6 @@ import { useBlockGroupMember } from 'pl-fe/api/hooks/groups/use-block-group-memb import { useDeleteGroupStatus } from 'pl-fe/api/hooks/groups/use-delete-group-status'; import { useGroup } from 'pl-fe/api/hooks/groups/use-group'; import { useGroupRelationship } from 'pl-fe/api/hooks/groups/use-group-relationship'; -import { useTranslationLanguages } from 'pl-fe/api/hooks/instance/use-translation-languages'; import DropdownMenu from 'pl-fe/components/dropdown-menu'; import StatusActionButton from 'pl-fe/components/status-action-button'; import HStack from 'pl-fe/components/ui/hstack'; @@ -31,6 +30,7 @@ import { useInstance } from 'pl-fe/hooks/use-instance'; import { useOwnAccount } from 'pl-fe/hooks/use-own-account'; import { useSettings } from 'pl-fe/hooks/use-settings'; import { useChats } from 'pl-fe/queries/chats'; +import { useTranslationLanguages } from 'pl-fe/queries/instance/use-translation-languages'; import { RootState } from 'pl-fe/store'; import { useModalsStore } from 'pl-fe/stores/modals'; import { useStatusMetaStore } from 'pl-fe/stores/status-meta'; diff --git a/packages/pl-fe/src/components/status-content.tsx b/packages/pl-fe/src/components/status-content.tsx index 966889c42..d429f5669 100644 --- a/packages/pl-fe/src/components/status-content.tsx +++ b/packages/pl-fe/src/components/status-content.tsx @@ -2,7 +2,6 @@ import clsx from 'clsx'; import React, { useState, useRef, useLayoutEffect, useMemo, useEffect } from 'react'; import { FormattedMessage } from 'react-intl'; -import { useStatusTranslation } from 'pl-fe/api/hooks/statuses/use-status-translation'; import Icon from 'pl-fe/components/icon'; import Button from 'pl-fe/components/ui/button'; import Stack from 'pl-fe/components/ui/stack'; @@ -10,6 +9,7 @@ import Text from 'pl-fe/components/ui/text'; import Emojify from 'pl-fe/features/emoji/emojify'; import QuotedStatus from 'pl-fe/features/status/containers/quoted-status-container'; import { useSettings } from 'pl-fe/hooks/use-settings'; +import { useStatusTranslation } from 'pl-fe/queries/statuses/use-status-translation'; import { useStatusMetaStore } from 'pl-fe/stores/status-meta'; import { onlyEmoji as isOnlyEmoji } from 'pl-fe/utils/rich-content'; diff --git a/packages/pl-fe/src/components/translate-button.tsx b/packages/pl-fe/src/components/translate-button.tsx index 3d8e41198..32eab1807 100644 --- a/packages/pl-fe/src/components/translate-button.tsx +++ b/packages/pl-fe/src/components/translate-button.tsx @@ -1,8 +1,6 @@ import React, { useEffect } from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; -import { useTranslationLanguages } from 'pl-fe/api/hooks/instance/use-translation-languages'; -import { useStatusTranslation } from 'pl-fe/api/hooks/statuses/use-status-translation'; import HStack from 'pl-fe/components/ui/hstack'; import Icon from 'pl-fe/components/ui/icon'; import Stack from 'pl-fe/components/ui/stack'; @@ -11,6 +9,8 @@ import { useAppSelector } from 'pl-fe/hooks/use-app-selector'; import { useFeatures } from 'pl-fe/hooks/use-features'; import { useInstance } from 'pl-fe/hooks/use-instance'; import { useSettings } from 'pl-fe/hooks/use-settings'; +import { useTranslationLanguages } from 'pl-fe/queries/instance/use-translation-languages'; +import { useStatusTranslation } from 'pl-fe/queries/statuses/use-status-translation'; import { useStatusMetaStore } from 'pl-fe/stores/status-meta'; import type { Status } from 'pl-fe/normalizers/status'; diff --git a/packages/pl-fe/src/components/upload.tsx b/packages/pl-fe/src/components/upload.tsx index 095407f05..65b238e03 100644 --- a/packages/pl-fe/src/components/upload.tsx +++ b/packages/pl-fe/src/components/upload.tsx @@ -237,7 +237,7 @@ const Upload: React.FC = ({ /> )} -
+
{mediaType === 'video' && (
-
+
-
+