Starter: use correct profile types
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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<NavigationProp>()
|
||||
@@ -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 ''
|
||||
|
||||
Reference in New Issue
Block a user