Starter: ok these need to be loose too
This commit is contained in:
@@ -22,6 +22,7 @@ import {Button, ButtonText} from '#/components/Button'
|
||||
import * as Toggle from '#/components/forms/Toggle'
|
||||
import {Checkbox} from '#/components/forms/Toggle'
|
||||
import {Text} from '#/components/Typography'
|
||||
import * as atp from '#/types/atproto'
|
||||
|
||||
function WizardListCard({
|
||||
type,
|
||||
@@ -123,7 +124,7 @@ export function WizardProfileCard({
|
||||
btnType: 'checkbox' | 'remove'
|
||||
state: WizardState
|
||||
dispatch: (action: WizardAction) => void
|
||||
profile: AppBskyActorDefs.ProfileViewBasic
|
||||
profile: atp.profile.AnyProfileView
|
||||
moderationOpts: ModerationOpts
|
||||
}) {
|
||||
const {currentAccount} = useSession()
|
||||
|
||||
@@ -15,6 +15,7 @@ import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {enforceLen} from '#/lib/strings/helpers'
|
||||
import {useAgent} from '#/state/session'
|
||||
import * as atp from '#/types/atproto'
|
||||
|
||||
export const createStarterPackList = async ({
|
||||
name,
|
||||
@@ -26,7 +27,7 @@ export const createStarterPackList = async ({
|
||||
name: string
|
||||
description?: string
|
||||
descriptionFacets?: Facet[]
|
||||
profiles: AppBskyActorDefs.ProfileView[]
|
||||
profiles: atp.profile.AnyProfileView[]
|
||||
agent: BskyAgent
|
||||
}): Promise<{uri: string; cid: string}> => {
|
||||
if (profiles.length === 0) throw new Error('No profiles given')
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
import React from 'react'
|
||||
import {
|
||||
AppBskyActorDefs,
|
||||
AppBskyGraphDefs,
|
||||
AppBskyGraphStarterpack,
|
||||
} from '@atproto/api'
|
||||
import {AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api'
|
||||
import {GeneratorView} from '@atproto/api/dist/client/types/app/bsky/feed/defs'
|
||||
import {msg} from '@lingui/macro'
|
||||
|
||||
import {STARTER_PACK_MAX_SIZE} from '#/lib/constants'
|
||||
import {useSession} from '#/state/session'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import * as atp from '#/types/atproto'
|
||||
|
||||
const steps = ['Details', 'Profiles', 'Feeds'] as const
|
||||
type Step = (typeof steps)[number]
|
||||
@@ -20,7 +17,7 @@ type Action =
|
||||
| {type: 'SetCanNext'; canNext: boolean}
|
||||
| {type: 'SetName'; name: string}
|
||||
| {type: 'SetDescription'; description: string}
|
||||
| {type: 'AddProfile'; profile: AppBskyActorDefs.ProfileView}
|
||||
| {type: 'AddProfile'; profile: atp.profile.AnyProfileView}
|
||||
| {type: 'RemoveProfile'; profileDid: string}
|
||||
| {type: 'AddFeed'; feed: GeneratorView}
|
||||
| {type: 'RemoveFeed'; feedUri: string}
|
||||
@@ -32,7 +29,7 @@ interface State {
|
||||
currentStep: Step
|
||||
name?: string
|
||||
description?: string
|
||||
profiles: AppBskyActorDefs.ProfileView[]
|
||||
profiles: atp.profile.AnyProfileView[]
|
||||
feeds: GeneratorView[]
|
||||
processing: boolean
|
||||
error?: string
|
||||
|
||||
@@ -16,6 +16,7 @@ import {Loader} from '#/components/Loader'
|
||||
import {ScreenTransition} from '#/components/StarterPack/Wizard/ScreenTransition'
|
||||
import {WizardProfileCard} from '#/components/StarterPack/Wizard/WizardListCard'
|
||||
import {Text} from '#/components/Typography'
|
||||
import * as atp from '#/types/atproto'
|
||||
|
||||
function keyExtractor(item: AppBskyActorDefs.ProfileViewBasic) {
|
||||
return item?.did ?? ''
|
||||
@@ -50,7 +51,7 @@ export function StepProfiles({
|
||||
|
||||
const renderItem = ({
|
||||
item,
|
||||
}: ListRenderItemInfo<AppBskyActorDefs.ProfileViewBasic>) => {
|
||||
}: ListRenderItemInfo<atp.profile.AnyProfileView>) => {
|
||||
return (
|
||||
<WizardProfileCard
|
||||
profile={item}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {
|
||||
AppBskyActorDefs,
|
||||
AppBskyFeedDefs,
|
||||
AppBskyGraphDefs,
|
||||
AppBskyGraphGetStarterPack,
|
||||
@@ -29,6 +28,7 @@ import {invalidateActorStarterPacksQuery} from '#/state/queries/actor-starter-pa
|
||||
import {STALE} from '#/state/queries/index'
|
||||
import {invalidateListMembersQuery} from '#/state/queries/list-members'
|
||||
import {useAgent} from '#/state/session'
|
||||
import * as atp from '#/types/atproto'
|
||||
|
||||
const RQKEY_ROOT = 'starter-pack'
|
||||
const RQKEY = ({
|
||||
@@ -93,7 +93,7 @@ export async function invalidateStarterPack({
|
||||
interface UseCreateStarterPackMutationParams {
|
||||
name: string
|
||||
description?: string
|
||||
profiles: AppBskyActorDefs.ProfileView[]
|
||||
profiles: atp.profile.AnyProfileView[]
|
||||
feeds?: AppBskyFeedDefs.GeneratorView[]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user