diff --git a/src/screens/Onboarding/StepProfile/SelectImageButton.tsx b/src/screens/Onboarding/StepProfile/SelectImageButton.tsx
index 6a8ff58e5f..5cc897c6cb 100644
--- a/src/screens/Onboarding/StepProfile/SelectImageButton.tsx
+++ b/src/screens/Onboarding/StepProfile/SelectImageButton.tsx
@@ -78,8 +78,8 @@ const styles = StyleSheet.create({
justifyContent: 'center',
},
paletteContainer: {
- height: 80,
- width: 80,
+ height: 70,
+ width: 70,
marginHorizontal: 5,
},
})
diff --git a/src/screens/Onboarding/StepProfile/index.tsx b/src/screens/Onboarding/StepProfile/index.tsx
index f082771f40..714f47f63b 100644
--- a/src/screens/Onboarding/StepProfile/index.tsx
+++ b/src/screens/Onboarding/StepProfile/index.tsx
@@ -44,6 +44,11 @@ import {
PlaceholderCanvasRef,
} from '#/screens/Onboarding/StepProfile/PlaceholderCanvas'
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
+import Animated, {
+ useAnimatedStyle,
+ useSharedValue,
+ withTiming,
+} from 'react-native-reanimated'
interface Avatar {
image?: {
@@ -188,7 +193,7 @@ function AvatarCircle() {
{height: 40, width: 40, bottom: 5, right: 5},
]}
onPress={onPressRemoveAvatar}>
-
+
)
@@ -203,13 +208,45 @@ function AvatarCircle() {
backgroundColor: avatar.backgroundColor,
},
]}>
-
+
)
}
-function ColorItem({color}: {color: AvatarColor}) {
+function AnimatedCircle({
+ selected,
+ children,
+}: React.PropsWithChildren<{selected: boolean}>) {
const t = useTheme()
+ const size = useSharedValue(selected ? 80 : 70)
+
+ React.useEffect(() => {
+ if (selected && size.value !== 80) {
+ size.value = withTiming(80)
+ } else if (!selected && size.value !== 70) {
+ size.value = withTiming(70)
+ }
+ }, [selected, size])
+
+ const animatedStyle = useAnimatedStyle(() => ({
+ height: size.value,
+ width: size.value,
+ }))
+
+ return (
+
+ {children}
+
+ )
+}
+
+function ColorItem({color}: {color: AvatarColor}) {
const avatar = useAvatar()
const setAvatar = useSetAvatar()
@@ -221,19 +258,13 @@ function ColorItem({color}: {color: AvatarColor}) {
}, [color, setAvatar])
return (
-
+
+
+
)
}
function colorRenderItem({item}: ListRenderItemInfo) {
@@ -258,19 +289,14 @@ function EmojiItem({emojiName}: {emojiName: EmojiName}) {
}
return (
-
-
-
+
+
+
+
+
)
}
function emojiRenderItem({item}: ListRenderItemInfo) {
@@ -367,8 +393,8 @@ const styles = StyleSheet.create({
justifyContent: 'center',
},
paletteContainer: {
- height: 80,
- width: 80,
+ height: 70,
+ width: 70,
marginHorizontal: 5,
},
flatListOuter: {
@@ -379,6 +405,7 @@ const styles = StyleSheet.create({
flatListContainer: {
paddingLeft: 40,
paddingRight: 40,
+ alignItems: 'center',
},
})