diff --git a/src/components/StarterPack/Wizard/WizardEditListDialog.tsx b/src/components/StarterPack/Wizard/WizardEditListDialog.tsx index b67a8d302f..5ce2988427 100644 --- a/src/components/StarterPack/Wizard/WizardEditListDialog.tsx +++ b/src/components/StarterPack/Wizard/WizardEditListDialog.tsx @@ -38,7 +38,7 @@ export function WizardEditListDialog({ state: WizardState dispatch: (action: WizardAction) => void moderationOpts: ModerationOpts - profile: AppBskyActorDefs.ProfileViewBasic + profile: AppBskyActorDefs.ProfileViewDetailed }) { const {_} = useLingui() const t = useTheme() diff --git a/src/screens/StarterPack/Wizard/State.tsx b/src/screens/StarterPack/Wizard/State.tsx index b6da56065b..2edee3f25e 100644 --- a/src/screens/StarterPack/Wizard/State.tsx +++ b/src/screens/StarterPack/Wizard/State.tsx @@ -20,7 +20,7 @@ type Action = | {type: 'SetCanNext'; canNext: boolean} | {type: 'SetName'; name: string} | {type: 'SetDescription'; description: string} - | {type: 'AddProfile'; profile: AppBskyActorDefs.ProfileViewBasic} + | {type: 'AddProfile'; profile: AppBskyActorDefs.ProfileView} | {type: 'RemoveProfile'; profileDid: string} | {type: 'AddFeed'; feed: GeneratorView} | {type: 'RemoveFeed'; feedUri: string} @@ -32,7 +32,7 @@ interface State { currentStep: Step name?: string description?: string - profiles: AppBskyActorDefs.ProfileViewBasic[] + profiles: AppBskyActorDefs.ProfileView[] feeds: GeneratorView[] processing: boolean error?: string @@ -113,7 +113,6 @@ function reducer(state: State, action: Action): State { return updatedState } -// TODO supply the initial state to this component export function Provider({ starterPack, listItems, diff --git a/src/screens/StarterPack/Wizard/index.tsx b/src/screens/StarterPack/Wizard/index.tsx index b42b753e36..99431724e0 100644 --- a/src/screens/StarterPack/Wizard/index.tsx +++ b/src/screens/StarterPack/Wizard/index.tsx @@ -54,6 +54,7 @@ import {ListMaybePlaceholder} from '#/components/Lists' import {Loader} from '#/components/Loader' import {WizardEditListDialog} from '#/components/StarterPack/Wizard/WizardEditListDialog' import {Text} from '#/components/Typography' +import * as atp from '#/types/atproto' import {Provider} from './State' export function Wizard({ @@ -141,7 +142,7 @@ function WizardInner({ }: { currentStarterPack?: AppBskyGraphDefs.StarterPackView currentListItems?: AppBskyGraphDefs.ListItemView[] - profile: AppBskyActorDefs.ProfileViewBasic + profile: AppBskyActorDefs.ProfileViewDetailed moderationOpts: ModerationOpts }) { const navigation = useNavigation() @@ -363,7 +364,7 @@ function Footer({ onNext: () => void nextBtnText: string moderationOpts: ModerationOpts - profile: AppBskyActorDefs.ProfileViewBasic + profile: AppBskyActorDefs.ProfileViewDetailed }) { const {_} = useLingui() const t = useTheme() @@ -577,10 +578,10 @@ function Footer({ ) } -function getName(item: AppBskyActorDefs.ProfileViewBasic | GeneratorView) { +function getName(item: atp.profile.AnyProfileView | GeneratorView) { if (typeof item.displayName === 'string') { return enforceLen(sanitizeDisplayName(item.displayName), 28, true) - } else if (typeof item.handle === 'string') { + } else if ('handle' in item) { return enforceLen(sanitizeHandle(item.handle), 28, true) } return ''