adjust flex

This commit is contained in:
Hailey
2024-06-07 12:20:35 -07:00
parent 82096b7652
commit a6f29f1835
3 changed files with 35 additions and 20 deletions
+9 -2
View File
@@ -1,9 +1,16 @@
import React from 'react' import React from 'react'
import {StyleProp, ViewStyle} from 'react-native'
import Animated, {FadeInRight, FadeOutLeft} from 'react-native-reanimated' import Animated, {FadeInRight, FadeOutLeft} from 'react-native-reanimated'
export function ScreenTransition({children}: {children: React.ReactNode}) { export function ScreenTransition({
style,
children,
}: {
style?: StyleProp<ViewStyle>
children: React.ReactNode
}) {
return ( return (
<Animated.View entering={FadeInRight} exiting={FadeOutLeft}> <Animated.View style={style} entering={FadeInRight} exiting={FadeOutLeft}>
{children} {children}
</Animated.View> </Animated.View>
) )
+13 -9
View File
@@ -12,7 +12,7 @@ import {SearchInput} from 'view/com/util/forms/SearchInput'
import {List} from 'view/com/util/List' import {List} from 'view/com/util/List'
import {ScreenTransition} from '#/screens/Login/ScreenTransition' import {ScreenTransition} from '#/screens/Login/ScreenTransition'
import {useWizardState} from '#/screens/StarterPack/Wizard/State' import {useWizardState} from '#/screens/StarterPack/Wizard/State'
import {atoms as a} from '#/alf' import {atoms as a, useTheme} from '#/alf'
import {Loader} from '#/components/Loader' import {Loader} from '#/components/Loader'
import {WizardFeedCard} from '#/components/StarterPack/Wizard/WizardFeedCard' import {WizardFeedCard} from '#/components/StarterPack/Wizard/WizardFeedCard'
@@ -21,6 +21,7 @@ function keyExtractor(item: GeneratorView) {
} }
export function StepFeeds() { export function StepFeeds() {
const t = useTheme()
const [state, dispatch] = useWizardState() const [state, dispatch] = useWizardState()
const [query, setQuery] = useState('') const [query, setQuery] = useState('')
@@ -54,14 +55,16 @@ export function StepFeeds() {
} }
return ( return (
<ScreenTransition> <ScreenTransition style={[a.flex_1]}>
<View style={[a.my_sm, a.px_md, {height: 40}]}> <View style={[a.border_b, t.atoms.border_contrast_medium]}>
<SearchInput <View style={[a.my_sm, a.px_md, {height: 40}]}>
query={query} <SearchInput
onChangeQuery={onChangeQuery} query={query}
onPressCancelSearch={() => setQuery('')} onChangeQuery={onChangeQuery}
onSubmitQuery={() => {}} onPressCancelSearch={() => setQuery('')}
/> onSubmitQuery={() => {}}
/>
</View>
</View> </View>
<List <List
data={query ? searchedFeeds : popularFeeds} data={query ? searchedFeeds : popularFeeds}
@@ -72,6 +75,7 @@ export function StepFeeds() {
renderScrollComponent={props => <KeyboardAwareScrollView {...props} />} renderScrollComponent={props => <KeyboardAwareScrollView {...props} />}
containWeb={true} containWeb={true}
sideBorders={false} sideBorders={false}
style={{flex: 1}}
ListEmptyComponent={ ListEmptyComponent={
<View style={[a.flex_1, a.align_center, a.mt_lg]}> <View style={[a.flex_1, a.align_center, a.mt_lg]}>
<Loader size="lg" /> <Loader size="lg" />
@@ -10,7 +10,7 @@ import {SearchInput} from 'view/com/util/forms/SearchInput'
import {List} from 'view/com/util/List' import {List} from 'view/com/util/List'
import {ScreenTransition} from '#/screens/Login/ScreenTransition' import {ScreenTransition} from '#/screens/Login/ScreenTransition'
import {useWizardState} from '#/screens/StarterPack/Wizard/State' import {useWizardState} from '#/screens/StarterPack/Wizard/State'
import {atoms as a} from '#/alf' import {atoms as a, useTheme} from '#/alf'
import {Loader} from '#/components/Loader' import {Loader} from '#/components/Loader'
import {WizardProfileCard} from '#/components/StarterPack/Wizard/WizardProfileCard' import {WizardProfileCard} from '#/components/StarterPack/Wizard/WizardProfileCard'
@@ -19,6 +19,7 @@ function keyExtractor(item: AppBskyActorDefs.ProfileViewBasic) {
} }
export function StepProfiles() { export function StepProfiles() {
const t = useTheme()
const [state, dispatch] = useWizardState() const [state, dispatch] = useWizardState()
const [query, setQuery] = useState('') const [query, setQuery] = useState('')
@@ -43,14 +44,16 @@ export function StepProfiles() {
} }
return ( return (
<ScreenTransition> <ScreenTransition style={[a.flex_1]}>
<View style={[a.my_sm, a.px_md, {height: 40}]}> <View style={[a.border_b, t.atoms.border_contrast_medium]}>
<SearchInput <View style={[a.my_sm, a.px_md, {height: 40}]}>
query={query} <SearchInput
onChangeQuery={setQuery} query={query}
onPressCancelSearch={() => setQuery('')} onChangeQuery={setQuery}
onSubmitQuery={() => {}} onPressCancelSearch={() => setQuery('')}
/> onSubmitQuery={() => {}}
/>
</View>
</View> </View>
<List <List
data={query ? results : follows} data={query ? results : follows}
@@ -61,6 +64,7 @@ export function StepProfiles() {
renderScrollComponent={props => <KeyboardAwareScrollView {...props} />} renderScrollComponent={props => <KeyboardAwareScrollView {...props} />}
containWeb={true} containWeb={true}
sideBorders={false} sideBorders={false}
style={[a.flex_1]}
ListEmptyComponent={ ListEmptyComponent={
<View style={[a.flex_1, a.align_center, a.mt_lg]}> <View style={[a.flex_1, a.align_center, a.mt_lg]}>
<Loader size="lg" /> <Loader size="lg" />