add screen transitions

This commit is contained in:
Hailey
2024-06-07 10:38:28 -07:00
parent b8e4863845
commit b65074dc83
4 changed files with 63 additions and 54 deletions
+42 -39
View File
@@ -5,6 +5,7 @@ import {useLingui} from '@lingui/react'
import {useProfileQuery} from 'state/queries/profile'
import {useSession} from 'state/session'
import {ScreenTransition} from '#/screens/Login/ScreenTransition'
import {useWizardState} from '#/screens/StarterPack/Wizard/State'
import {atoms as a} from '#/alf'
import * as TextField from '#/components/forms/TextField'
@@ -22,49 +23,51 @@ export function StepDetails() {
})
return (
<View style={[a.px_xl, a.gap_xl, a.mt_4xl]}>
<View style={[{height: 65}]}>
<StarterPackIcon />
</View>
<View style={[a.gap_md, a.align_center, a.px_md, a.mb_md]}>
<Text style={[a.font_bold, a.text_3xl]}>
<Trans>Invites, but personal</Trans>
</Text>
<Text style={[a.text_center, a.text_md, a.px_md]}>
<Trans>
Create a starter pack to invite new users to Bluesky and give them
your favorite feeds and follows.
</Trans>
</Text>
</View>
<View>
<TextField.LabelText>{_(msg`Name`)}</TextField.LabelText>
<TextField.Input
label={_(
msg`${
currentProfile?.displayName || currentProfile?.handle
}'s starter pack`,
)}
value={state.name}
onChangeText={text => dispatch({type: 'SetName', name: text})}
/>
</View>
<View>
<TextField.LabelText>{_(msg`Description`)}</TextField.LabelText>
<TextField.Root>
<ScreenTransition>
<View style={[a.px_xl, a.gap_xl, a.mt_4xl]}>
<View style={[{height: 65}]}>
<StarterPackIcon />
</View>
<View style={[a.gap_md, a.align_center, a.px_md, a.mb_md]}>
<Text style={[a.font_bold, a.text_3xl]}>
<Trans>Invites, but personal</Trans>
</Text>
<Text style={[a.text_center, a.text_md, a.px_md]}>
<Trans>
Create a starter pack to invite new users to Bluesky and give them
your favorite feeds and follows.
</Trans>
</Text>
</View>
<View>
<TextField.LabelText>{_(msg`Name`)}</TextField.LabelText>
<TextField.Input
label={_(
msg`Write a short description of your starter pack. What can new users expect?`,
msg`${
currentProfile?.displayName || currentProfile?.handle
}'s starter pack`,
)}
value={state.description}
onChangeText={text =>
dispatch({type: 'SetDescription', description: text})
}
multiline
style={{minHeight: 150}}
value={state.name}
onChangeText={text => dispatch({type: 'SetName', name: text})}
/>
</TextField.Root>
</View>
<View>
<TextField.LabelText>{_(msg`Description`)}</TextField.LabelText>
<TextField.Root>
<TextField.Input
label={_(
msg`Write a short description of your starter pack. What can new users expect?`,
)}
value={state.description}
onChangeText={text =>
dispatch({type: 'SetDescription', description: text})
}
multiline
style={{minHeight: 150}}
/>
</TextField.Root>
</View>
</View>
</View>
</ScreenTransition>
)
}
+3 -2
View File
@@ -10,6 +10,7 @@ import {
} from 'state/queries/feed'
import {SearchInput} from 'view/com/util/forms/SearchInput'
import {List} from 'view/com/util/List'
import {ScreenTransition} from '#/screens/Login/ScreenTransition'
import {useWizardState} from '#/screens/StarterPack/Wizard/State'
import {atoms as a} from '#/alf'
import {Loader} from '#/components/Loader'
@@ -53,7 +54,7 @@ export function StepFeeds() {
}
return (
<>
<ScreenTransition>
<View style={[a.my_sm, a.px_md, {height: 40}]}>
<SearchInput
query={query}
@@ -76,6 +77,6 @@ export function StepFeeds() {
</View>
}
/>
</>
</ScreenTransition>
)
}
@@ -8,6 +8,7 @@ import {useProfileFollowsQuery} from 'state/queries/profile-follows'
import {useSession} from 'state/session'
import {SearchInput} from 'view/com/util/forms/SearchInput'
import {List} from 'view/com/util/List'
import {ScreenTransition} from '#/screens/Login/ScreenTransition'
import {useWizardState} from '#/screens/StarterPack/Wizard/State'
import {atoms as a} from '#/alf'
import {Loader} from '#/components/Loader'
@@ -42,7 +43,7 @@ export function StepProfiles() {
}
return (
<>
<ScreenTransition>
<View style={[a.my_sm, a.px_md, {height: 40}]}>
<SearchInput
query={query}
@@ -64,6 +65,6 @@ export function StepProfiles() {
</View>
}
/>
</>
</ScreenTransition>
)
}
+15 -11
View File
@@ -221,17 +221,21 @@ function WizardInner() {
isWeb && [a.py_md],
]}>
<View style={[{width: 65}]}>
{state.currentStep !== 'Details' && (
<TouchableOpacity
testID="viewHeaderDrawerBtn"
onPress={() => dispatch({type: 'Back'})}
hitSlop={HITSLOP_10}
accessibilityRole="button"
accessibilityLabel={_(msg`Back`)}
accessibilityHint={_(msg`Go back to the previous step`)}>
<FontAwesomeIcon size={18} icon="angle-left" />
</TouchableOpacity>
)}
<TouchableOpacity
testID="viewHeaderDrawerBtn"
hitSlop={HITSLOP_10}
accessibilityRole="button"
accessibilityLabel={_(msg`Back`)}
accessibilityHint={_(msg`Go back to the previous step`)}
onPress={() => {
if (state.currentStep === 'Details') {
navigation.goBack()
} else {
dispatch({type: 'Back'})
}
}}>
<FontAwesomeIcon size={18} icon="angle-left" />
</TouchableOpacity>
</View>
<Text style={[a.flex_1, a.font_bold, a.text_lg, a.text_center]}>
{uiStrings.header}