From e94012c76c8efa822ac15d69b632024ce8ee4182 Mon Sep 17 00:00:00 2001 From: Hailey Date: Fri, 14 Jun 2024 13:10:03 -0700 Subject: [PATCH] fix null error --- .../Wizard/WizardEditListDialog.tsx | 44 ++++++++++++++++--- .../StarterPack/Wizard/WizardProfileCard.tsx | 2 + src/screens/StarterPack/Wizard/index.tsx | 4 +- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/src/components/StarterPack/Wizard/WizardEditListDialog.tsx b/src/components/StarterPack/Wizard/WizardEditListDialog.tsx index df356165a6..a411f3d91e 100644 --- a/src/components/StarterPack/Wizard/WizardEditListDialog.tsx +++ b/src/components/StarterPack/Wizard/WizardEditListDialog.tsx @@ -4,11 +4,14 @@ import {View} from 'react-native' import {AppBskyActorDefs} from '@atproto/api' import {GeneratorView} from '@atproto/api/dist/client/types/app/bsky/feed/defs' import {BottomSheetFlatListMethods} from '@discord/bottom-sheet' -import {Trans} from '@lingui/macro' +import {msg, Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' +import {isWeb} from 'platform/detection' import {useSession} from 'state/session' import {WizardAction, WizardState} from '#/screens/StarterPack/Wizard/State' import {atoms as a, native, useTheme, web} from '#/alf' +import {Button, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' import {WizardFeedCard} from '#/components/StarterPack/Wizard/WizardFeedCard' import {WizardProfileCard} from '#/components/StarterPack/Wizard/WizardProfileCard' @@ -30,8 +33,9 @@ export function WizardEditListDialog({ state: WizardState dispatch: (action: WizardAction) => void }) { - const {currentAccount} = useSession() + const {_} = useLingui() const t = useTheme() + const {currentAccount} = useSession() const listRef = useRef(null) @@ -68,15 +72,29 @@ export function WizardEditListDialog({ ListHeaderComponent={ + {state.currentStep === 'Profiles' ? ( Edit People @@ -84,6 +102,20 @@ export function WizardEditListDialog({ Edit Feeds )} + + {isWeb && ( + + )} + } stickyHeaderIndices={[0]} diff --git a/src/components/StarterPack/Wizard/WizardProfileCard.tsx b/src/components/StarterPack/Wizard/WizardProfileCard.tsx index a8a99675a8..a97f119014 100644 --- a/src/components/StarterPack/Wizard/WizardProfileCard.tsx +++ b/src/components/StarterPack/Wizard/WizardProfileCard.tsx @@ -30,6 +30,8 @@ export function WizardProfileCard({ const onPressAddRemove = () => { Keyboard.dismiss() + if (profile.did === currentAccount?.did) return + if (!includesProfile) { dispatch({type: 'AddProfile', profile}) } else { diff --git a/src/screens/StarterPack/Wizard/index.tsx b/src/screens/StarterPack/Wizard/index.tsx index 6ef54535ad..0bdea6eabb 100644 --- a/src/screens/StarterPack/Wizard/index.tsx +++ b/src/screens/StarterPack/Wizard/index.tsx @@ -491,7 +491,7 @@ function Container({ {showDeleteBtn && (