add emoji list
This commit is contained in:
@@ -68,6 +68,7 @@ export function StepProfile() {
|
|||||||
|
|
||||||
<View style={[a.pt_5xl, a.gap_3xl]}>
|
<View style={[a.pt_5xl, a.gap_3xl]}>
|
||||||
<Items type="colors" />
|
<Items type="colors" />
|
||||||
|
<Items type="emojis" />
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<OnboardingControls.Portal>
|
<OnboardingControls.Portal>
|
||||||
@@ -117,6 +118,14 @@ function AvatarCircle({
|
|||||||
const colors = ['image', 'red', 'blue', 'green', 'orange'] as const
|
const colors = ['image', 'red', 'blue', 'green', 'orange'] as const
|
||||||
type Color = (typeof colors)[number]
|
type Color = (typeof colors)[number]
|
||||||
|
|
||||||
|
const emojis = ['smile', 'frown', 'eyes'] as const
|
||||||
|
type Emoji = (typeof emojis)[number]
|
||||||
|
const emojiItems: Record<Emoji, string> = {
|
||||||
|
smile: '😊',
|
||||||
|
frown: '☹️',
|
||||||
|
eyes: '👀',
|
||||||
|
}
|
||||||
|
|
||||||
function ColorItem({color}: {color: Color}) {
|
function ColorItem({color}: {color: Color}) {
|
||||||
if (color === 'image') return null
|
if (color === 'image') return null
|
||||||
|
|
||||||
@@ -134,15 +143,38 @@ function colorRenderItem({item}: ListRenderItemInfo<Color>) {
|
|||||||
return <ColorItem color={item} />
|
return <ColorItem color={item} />
|
||||||
}
|
}
|
||||||
|
|
||||||
function Items({type}: {type: 'icons' | 'colors'}) {
|
function EmojiItem({emoji}: {emoji: Emoji}) {
|
||||||
return (
|
return (
|
||||||
<FlatList
|
<View style={[styles.imageContainer, styles.paletteContainer]}>
|
||||||
|
<Text>{emojiItems[emoji]}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
function emojiRenderItem({item}: ListRenderItemInfo<Emoji>) {
|
||||||
|
return <EmojiItem emoji={item} />
|
||||||
|
}
|
||||||
|
|
||||||
|
function Items({type}: {type: 'emojis' | 'colors'}) {
|
||||||
|
if (type === 'colors') {
|
||||||
|
return (
|
||||||
|
<FlatList<Color>
|
||||||
|
style={{height: 100}}
|
||||||
data={colors}
|
data={colors}
|
||||||
renderItem={colorRenderItem}
|
renderItem={colorRenderItem}
|
||||||
horizontal
|
horizontal
|
||||||
contentContainerStyle={styles.flatListContainer}
|
contentContainerStyle={styles.flatListContainer}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FlatList<Emoji>
|
||||||
|
data={emojis}
|
||||||
|
renderItem={emojiRenderItem}
|
||||||
|
horizontal
|
||||||
|
contentContainerStyle={styles.flatListContainer}
|
||||||
|
/>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
|
|||||||
Reference in New Issue
Block a user