Revert "move dialogs into their respective screens"
This reverts commit 4dac2822e5.
This commit is contained in:
@@ -5,8 +5,6 @@ import {GeneratorView} from '@atproto/api/dist/client/types/app/bsky/feed/defs'
|
||||
import {List} from 'view/com/util/List'
|
||||
import {useWizardState} from '#/screens/StarterPack/Wizard/State'
|
||||
import {atoms as a} from '#/alf'
|
||||
import {useDialogControl} from '#/components/Dialog'
|
||||
import {WizardAddDialog} from '#/components/StarterPack/Wizard/WizardAddDialog'
|
||||
import {WizardFeedCard} from '#/components/StarterPack/Wizard/WizardFeedCard'
|
||||
import {WizardListEmpty} from '#/components/StarterPack/Wizard/WizardListEmpty'
|
||||
|
||||
@@ -16,27 +14,18 @@ function keyExtractor(item: GeneratorView) {
|
||||
|
||||
export function StepFeeds() {
|
||||
const [state, dispatch] = useWizardState()
|
||||
const control = useDialogControl()
|
||||
|
||||
const renderItem = ({item}: ListRenderItemInfo<GeneratorView>) => {
|
||||
return <WizardFeedCard generator={item} state={state} dispatch={dispatch} />
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<List
|
||||
data={state.feeds}
|
||||
renderItem={renderItem}
|
||||
keyExtractor={keyExtractor}
|
||||
style={[a.flex_1]}
|
||||
ListEmptyComponent={<WizardListEmpty type="feeds" />}
|
||||
/>
|
||||
<WizardAddDialog
|
||||
control={control}
|
||||
type="feeds"
|
||||
state={state}
|
||||
dispatch={dispatch}
|
||||
/>
|
||||
</>
|
||||
<List
|
||||
data={state.feeds}
|
||||
renderItem={renderItem}
|
||||
keyExtractor={keyExtractor}
|
||||
style={[a.flex_1]}
|
||||
ListEmptyComponent={<WizardListEmpty type="feeds" />}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import React from 'react'
|
||||
import {ListRenderItemInfo} from 'react-native'
|
||||
import {ListRenderItemInfo, View} from 'react-native'
|
||||
import {AppBskyActorDefs} from '@atproto/api'
|
||||
|
||||
import {List} from 'view/com/util/List'
|
||||
import {useWizardState} from '#/screens/StarterPack/Wizard/State'
|
||||
import {useDialogControl} from '#/components/Dialog'
|
||||
import {WizardAddDialog} from '#/components/StarterPack/Wizard/WizardAddDialog'
|
||||
import {atoms as a} from '#/alf'
|
||||
import {WizardListEmpty} from '#/components/StarterPack/Wizard/WizardListEmpty'
|
||||
import {WizardProfileCard} from '#/components/StarterPack/Wizard/WizardProfileCard'
|
||||
|
||||
@@ -15,7 +14,6 @@ function keyExtractor(item: AppBskyActorDefs.ProfileViewBasic) {
|
||||
|
||||
export function StepProfiles() {
|
||||
const [state, dispatch] = useWizardState()
|
||||
const control = useDialogControl()
|
||||
|
||||
const renderItem = ({
|
||||
item,
|
||||
@@ -27,18 +25,14 @@ export function StepProfiles() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<List
|
||||
data={state.profiles}
|
||||
renderItem={renderItem}
|
||||
keyExtractor={keyExtractor}
|
||||
ListEmptyComponent={<WizardListEmpty type="profiles" />}
|
||||
/>
|
||||
<WizardAddDialog
|
||||
control={control}
|
||||
type="profiles"
|
||||
state={state}
|
||||
dispatch={dispatch}
|
||||
/>
|
||||
<View style={[a.flex_1]}>
|
||||
<List
|
||||
data={state.profiles}
|
||||
renderItem={renderItem}
|
||||
keyExtractor={keyExtractor}
|
||||
ListEmptyComponent={<WizardListEmpty type="profiles" />}
|
||||
/>
|
||||
</View>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ import {StepFeeds} from '#/screens/StarterPack/Wizard/StepFeeds'
|
||||
import {StepProfiles} from '#/screens/StarterPack/Wizard/StepProfiles'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {Button, ButtonText} from '#/components/Button'
|
||||
import {useDialogControl} from '#/components/Dialog'
|
||||
import {WizardAddDialog} from '#/components/StarterPack/Wizard/WizardAddDialog'
|
||||
import {Provider} from './State'
|
||||
|
||||
export function Wizard({
|
||||
@@ -75,6 +77,7 @@ function WizardInner() {
|
||||
did: currentAccount?.did,
|
||||
staleTime: 0,
|
||||
})
|
||||
const searchDialogControl = useDialogControl()
|
||||
|
||||
React.useEffect(() => {
|
||||
navigation.setOptions({
|
||||
@@ -173,6 +176,15 @@ function WizardInner() {
|
||||
<Container>
|
||||
<StepView />
|
||||
</Container>
|
||||
|
||||
{(state.currentStep === 'Profiles' || state.currentStep === 'Feeds') && (
|
||||
<WizardAddDialog
|
||||
control={searchDialogControl}
|
||||
state={state}
|
||||
dispatch={dispatch}
|
||||
type={state.currentStep === 'Profiles' ? 'profiles' : 'feeds'}
|
||||
/>
|
||||
)}
|
||||
</CenteredView>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user