From 0f10922c3d156f397d471cebb93fdba6730038c6 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 7 Oct 2023 15:43:34 -0500 Subject: [PATCH] ProfilePage: fix types of async components --- src/features/ui/components/panels/account-note-panel.tsx | 2 +- src/features/ui/components/pinned-accounts-panel.tsx | 2 +- src/features/ui/components/profile-familiar-followers.tsx | 2 +- src/features/ui/components/profile-fields-panel.tsx | 2 +- src/features/ui/components/profile-info-panel.tsx | 2 +- src/features/ui/components/profile-media-panel.tsx | 3 ++- src/pages/remote-instance-page.tsx | 6 +++--- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/features/ui/components/panels/account-note-panel.tsx b/src/features/ui/components/panels/account-note-panel.tsx index 045fd6083..032039dae 100644 --- a/src/features/ui/components/panels/account-note-panel.tsx +++ b/src/features/ui/components/panels/account-note-panel.tsx @@ -7,8 +7,8 @@ import { submitAccountNote } from 'soapbox/actions/account-notes'; import { HStack, Text, Widget } from 'soapbox/components/ui'; import { useAppDispatch } from 'soapbox/hooks'; +import type { Account as AccountEntity } from 'soapbox/schemas'; import type { AppDispatch } from 'soapbox/store'; -import type { Account as AccountEntity } from 'soapbox/types/entities'; const onSave = debounce( (dispatch: AppDispatch, id: string, value: string, callback: () => void) => diff --git a/src/features/ui/components/pinned-accounts-panel.tsx b/src/features/ui/components/pinned-accounts-panel.tsx index d9aed232b..b0f5e918f 100644 --- a/src/features/ui/components/pinned-accounts-panel.tsx +++ b/src/features/ui/components/pinned-accounts-panel.tsx @@ -9,7 +9,7 @@ import BundleContainer from 'soapbox/features/ui/containers/bundle-container'; import { WhoToFollowPanel } from 'soapbox/features/ui/util/async-components'; import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; -import type { Account } from 'soapbox/types/entities'; +import type { Account } from 'soapbox/schemas'; interface IPinnedAccountsPanel { account: Account; diff --git a/src/features/ui/components/profile-familiar-followers.tsx b/src/features/ui/components/profile-familiar-followers.tsx index 749e52f93..c80e46b04 100644 --- a/src/features/ui/components/profile-familiar-followers.tsx +++ b/src/features/ui/components/profile-familiar-followers.tsx @@ -12,7 +12,7 @@ import VerificationBadge from 'soapbox/components/verification-badge'; import { useAppDispatch, useAppSelector, useFeatures } from 'soapbox/hooks'; import { makeGetAccount } from 'soapbox/selectors'; -import type { Account } from 'soapbox/types/entities'; +import type { Account } from 'soapbox/schemas'; const getAccount = makeGetAccount(); diff --git a/src/features/ui/components/profile-fields-panel.tsx b/src/features/ui/components/profile-fields-panel.tsx index 946cf35a7..fb434a25b 100644 --- a/src/features/ui/components/profile-fields-panel.tsx +++ b/src/features/ui/components/profile-fields-panel.tsx @@ -5,7 +5,7 @@ import { Widget, Stack } from 'soapbox/components/ui'; import ProfileField from './profile-field'; -import type { Account } from 'soapbox/types/entities'; +import type { Account } from 'soapbox/schemas'; interface IProfileFieldsPanel { account: Account; diff --git a/src/features/ui/components/profile-info-panel.tsx b/src/features/ui/components/profile-info-panel.tsx index d44a83d8e..244434b8b 100644 --- a/src/features/ui/components/profile-info-panel.tsx +++ b/src/features/ui/components/profile-info-panel.tsx @@ -15,7 +15,7 @@ import ProfileFamiliarFollowers from './profile-familiar-followers'; import ProfileField from './profile-field'; import ProfileStats from './profile-stats'; -import type { Account } from 'soapbox/types/entities'; +import type { Account } from 'soapbox/schemas'; /** Basically ensure the URL isn't `javascript:alert('hi')` or something like that */ const isSafeUrl = (text: string): boolean => { diff --git a/src/features/ui/components/profile-media-panel.tsx b/src/features/ui/components/profile-media-panel.tsx index f87b12c55..d63b849f3 100644 --- a/src/features/ui/components/profile-media-panel.tsx +++ b/src/features/ui/components/profile-media-panel.tsx @@ -10,7 +10,8 @@ import { getAccountGallery } from 'soapbox/selectors'; import MediaItem from '../../account-gallery/components/media-item'; -import type { Account, Attachment } from 'soapbox/types/entities'; +import type { Account } from 'soapbox/schemas'; +import type { Attachment } from 'soapbox/types/entities'; interface IProfileMediaPanel { account?: Account; diff --git a/src/pages/remote-instance-page.tsx b/src/pages/remote-instance-page.tsx index b5c4e5262..60a61e16d 100644 --- a/src/pages/remote-instance-page.tsx +++ b/src/pages/remote-instance-page.tsx @@ -13,15 +13,15 @@ import { federationRestrictionsDisclosed } from 'soapbox/utils/state'; import { Layout } from '../components/ui'; interface IRemoteInstancePage { - params?: { - instance?: string; + params: { + instance: string; }; children: React.ReactNode; } /** Page for viewing a remote instance timeline. */ const RemoteInstancePage: React.FC = ({ children, params }) => { - const host = params?.instance; + const host = params.instance; const { account } = useOwnAccount(); const disclosed = useAppSelector(federationRestrictionsDisclosed);