From 962654041c9de253dfd66beb98be655acc655a08 Mon Sep 17 00:00:00 2001 From: Chenyu Huang Date: Thu, 21 Aug 2025 11:49:08 -0700 Subject: fix linting, minor ui tweaks --- .../StarterPack/Wizard/WizardEditListDialog.tsx | 1 - src/components/dialogs/StarterPackDialog.tsx | 43 +++++++++------------- 2 files changed, 18 insertions(+), 26 deletions(-) (limited to 'src/components') diff --git a/src/components/StarterPack/Wizard/WizardEditListDialog.tsx b/src/components/StarterPack/Wizard/WizardEditListDialog.tsx index 7c3d1a40a..7dfde900f 100644 --- a/src/components/StarterPack/Wizard/WizardEditListDialog.tsx +++ b/src/components/StarterPack/Wizard/WizardEditListDialog.tsx @@ -11,7 +11,6 @@ import {useLingui} from '@lingui/react' import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender' import {isWeb} from '#/platform/detection' -import {useSession} from '#/state/session' import {type ListMethods} from '#/view/com/util/List' import { type WizardAction, diff --git a/src/components/dialogs/StarterPackDialog.tsx b/src/components/dialogs/StarterPackDialog.tsx index 443b84205..12dfc3d24 100644 --- a/src/components/dialogs/StarterPackDialog.tsx +++ b/src/components/dialogs/StarterPackDialog.tsx @@ -30,7 +30,7 @@ import * as bsky from '#/types/bsky' import {AvatarStack} from '../AvatarStack' import {PlusLarge_Stroke2_Corner0_Rounded} from '../icons/Plus' import {StarterPack} from '../icons/StarterPack' -import {TimesLarge_Stroke2_Corner0_Rounded} from '../icons/Times' +import {TimesLarge_Stroke2_Corner0_Rounded as XIcon} from '../icons/Times' type StarterPackWithMembership = AppBskyGraphGetStarterPacksWithMembership.StarterPackWithMembership @@ -130,8 +130,6 @@ function StarterPackList({ enabled?: boolean }) { const {_} = useLingui() - const t = useTheme() - const { data, refetch, @@ -184,10 +182,9 @@ function StarterPackList({ Add to starter packs - + {membershipItems.length > 0 && ( <> @@ -215,27 +212,23 @@ function StarterPackList({ ) - if (isLoading) { - return ( - <> - - - - - - ) - } - return ( <> - - item.starterPack.uri || index.toString() + data={isLoading ? [{}] : membershipItems} + renderItem={ + isLoading + ? () => ( + + + + ) + : renderItem + } + keyExtractor={ + isLoading + ? () => 'starter_pack_dialog_loader' + : (item: StarterPackWithMembership) => item.starterPack.uri } refreshing={false} onRefresh={_onRefresh} -- cgit 1.4.1