Starter: use correct profile types
This commit is contained in:
@@ -38,7 +38,7 @@ export function WizardEditListDialog({
|
|||||||
state: WizardState
|
state: WizardState
|
||||||
dispatch: (action: WizardAction) => void
|
dispatch: (action: WizardAction) => void
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
profile: AppBskyActorDefs.ProfileViewBasic
|
profile: AppBskyActorDefs.ProfileViewDetailed
|
||||||
}) {
|
}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ type Action =
|
|||||||
| {type: 'SetCanNext'; canNext: boolean}
|
| {type: 'SetCanNext'; canNext: boolean}
|
||||||
| {type: 'SetName'; name: string}
|
| {type: 'SetName'; name: string}
|
||||||
| {type: 'SetDescription'; description: string}
|
| {type: 'SetDescription'; description: string}
|
||||||
| {type: 'AddProfile'; profile: AppBskyActorDefs.ProfileViewBasic}
|
| {type: 'AddProfile'; profile: AppBskyActorDefs.ProfileView}
|
||||||
| {type: 'RemoveProfile'; profileDid: string}
|
| {type: 'RemoveProfile'; profileDid: string}
|
||||||
| {type: 'AddFeed'; feed: GeneratorView}
|
| {type: 'AddFeed'; feed: GeneratorView}
|
||||||
| {type: 'RemoveFeed'; feedUri: string}
|
| {type: 'RemoveFeed'; feedUri: string}
|
||||||
@@ -32,7 +32,7 @@ interface State {
|
|||||||
currentStep: Step
|
currentStep: Step
|
||||||
name?: string
|
name?: string
|
||||||
description?: string
|
description?: string
|
||||||
profiles: AppBskyActorDefs.ProfileViewBasic[]
|
profiles: AppBskyActorDefs.ProfileView[]
|
||||||
feeds: GeneratorView[]
|
feeds: GeneratorView[]
|
||||||
processing: boolean
|
processing: boolean
|
||||||
error?: string
|
error?: string
|
||||||
@@ -113,7 +113,6 @@ function reducer(state: State, action: Action): State {
|
|||||||
return updatedState
|
return updatedState
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO supply the initial state to this component
|
|
||||||
export function Provider({
|
export function Provider({
|
||||||
starterPack,
|
starterPack,
|
||||||
listItems,
|
listItems,
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ import {ListMaybePlaceholder} from '#/components/Lists'
|
|||||||
import {Loader} from '#/components/Loader'
|
import {Loader} from '#/components/Loader'
|
||||||
import {WizardEditListDialog} from '#/components/StarterPack/Wizard/WizardEditListDialog'
|
import {WizardEditListDialog} from '#/components/StarterPack/Wizard/WizardEditListDialog'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
import * as atp from '#/types/atproto'
|
||||||
import {Provider} from './State'
|
import {Provider} from './State'
|
||||||
|
|
||||||
export function Wizard({
|
export function Wizard({
|
||||||
@@ -141,7 +142,7 @@ function WizardInner({
|
|||||||
}: {
|
}: {
|
||||||
currentStarterPack?: AppBskyGraphDefs.StarterPackView
|
currentStarterPack?: AppBskyGraphDefs.StarterPackView
|
||||||
currentListItems?: AppBskyGraphDefs.ListItemView[]
|
currentListItems?: AppBskyGraphDefs.ListItemView[]
|
||||||
profile: AppBskyActorDefs.ProfileViewBasic
|
profile: AppBskyActorDefs.ProfileViewDetailed
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
}) {
|
}) {
|
||||||
const navigation = useNavigation<NavigationProp>()
|
const navigation = useNavigation<NavigationProp>()
|
||||||
@@ -363,7 +364,7 @@ function Footer({
|
|||||||
onNext: () => void
|
onNext: () => void
|
||||||
nextBtnText: string
|
nextBtnText: string
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
profile: AppBskyActorDefs.ProfileViewBasic
|
profile: AppBskyActorDefs.ProfileViewDetailed
|
||||||
}) {
|
}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const t = useTheme()
|
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') {
|
if (typeof item.displayName === 'string') {
|
||||||
return enforceLen(sanitizeDisplayName(item.displayName), 28, true)
|
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 enforceLen(sanitizeHandle(item.handle), 28, true)
|
||||||
}
|
}
|
||||||
return ''
|
return ''
|
||||||
|
|||||||
Reference in New Issue
Block a user