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