select/update
This commit is contained in:
@@ -36,8 +36,8 @@ type AvatarPlaceholder = 'thinking' | 'heart' | 'laughing'
|
|||||||
|
|
||||||
interface Avatar {
|
interface Avatar {
|
||||||
imageUri?: string
|
imageUri?: string
|
||||||
backgroundColor?: Color
|
backgroundColor: Color
|
||||||
placeholder?: Emoji
|
placeholder: Emoji
|
||||||
}
|
}
|
||||||
|
|
||||||
const AvatarContext = React.createContext<Avatar>({} as Avatar)
|
const AvatarContext = React.createContext<Avatar>({} as Avatar)
|
||||||
@@ -53,7 +53,10 @@ export function StepProfile() {
|
|||||||
const {track} = useAnalytics()
|
const {track} = useAnalytics()
|
||||||
const {state, dispatch} = React.useContext(Context)
|
const {state, dispatch} = React.useContext(Context)
|
||||||
const onboardDispatch = useOnboardingDispatch()
|
const onboardDispatch = useOnboardingDispatch()
|
||||||
const [avatar, setAvatar] = React.useState<Avatar>({})
|
const [avatar, setAvatar] = React.useState<Avatar>({
|
||||||
|
placeholder: 'smile',
|
||||||
|
backgroundColor: 'red',
|
||||||
|
})
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
track('OnboardingV2:StepProfile:Start')
|
track('OnboardingV2:StepProfile:Start')
|
||||||
@@ -78,6 +81,9 @@ export function StepProfile() {
|
|||||||
</Description>
|
</Description>
|
||||||
|
|
||||||
<View style={[a.pt_5xl, a.gap_3xl]}>
|
<View style={[a.pt_5xl, a.gap_3xl]}>
|
||||||
|
<View style={[a.align_center, a.pb_lg]}>
|
||||||
|
<AvatarCircle />
|
||||||
|
</View>
|
||||||
<Items type="emojis" />
|
<Items type="emojis" />
|
||||||
<Items type="colors" />
|
<Items type="colors" />
|
||||||
</View>
|
</View>
|
||||||
@@ -119,8 +125,12 @@ function AvatarCircle() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={[styles.imageContainer, {backgroundColor: avatar.backgroundColor}]}
|
style={[
|
||||||
/>
|
styles.imageContainer,
|
||||||
|
{backgroundColor: avatar.backgroundColor},
|
||||||
|
]}>
|
||||||
|
<Text style={[a.text_5xl]}>{emojiItems[avatar.placeholder]}</Text>
|
||||||
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,8 +195,6 @@ function EmojiItem({emoji}: {emoji: Emoji}) {
|
|||||||
styles.imageContainer,
|
styles.imageContainer,
|
||||||
styles.paletteContainer,
|
styles.paletteContainer,
|
||||||
{
|
{
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
borderWidth: avatar.placeholder === emoji ? 3 : 1,
|
borderWidth: avatar.placeholder === emoji ? 3 : 1,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
@@ -228,12 +236,15 @@ const styles = StyleSheet.create({
|
|||||||
imageContainer: {
|
imageContainer: {
|
||||||
borderRadius: 100,
|
borderRadius: 100,
|
||||||
height: 150,
|
height: 150,
|
||||||
width: 250,
|
width: 150,
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
|
borderWidth: 1,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
paletteContainer: {
|
paletteContainer: {
|
||||||
height: 90,
|
height: 80,
|
||||||
width: 90,
|
width: 80,
|
||||||
marginHorizontal: 5,
|
marginHorizontal: 5,
|
||||||
},
|
},
|
||||||
flatListOuter: {
|
flatListOuter: {
|
||||||
|
|||||||
Reference in New Issue
Block a user