Skip to content

Commit cbadfae

Browse files
committed
feat: migliorata la visualizzazione dell'avatar nel profilo con un gradiente e iniziali utente
1 parent 7b9976e commit cbadfae

2 files changed

Lines changed: 28 additions & 17 deletions

File tree

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
"Bash(git log:*)",
4949
"Bash(grep:*)",
5050
"Bash(powershell -Command \"Get-Content ''e:\\\\MyTaskly\\\\MyTaskly-app\\\\src\\\\locales\\\\en.json'' | Select-Object -Last 20\")",
51-
"Bash(powershell -Command \"Get-Content ''e:\\\\MyTaskly\\\\MyTaskly-app\\\\src\\\\locales\\\\it.json'' | Select-Object -Last 20\")"
51+
"Bash(powershell -Command \"Get-Content ''e:\\\\MyTaskly\\\\MyTaskly-app\\\\src\\\\locales\\\\it.json'' | Select-Object -Last 20\")",
52+
"Bash(npm ls:*)"
5253
],
5354
"deny": [],
5455
"defaultMode": "acceptEdits"

src/navigation/screens/Profile.tsx

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
TouchableOpacity,
66
StyleSheet,
77
Dimensions,
8-
Image,
98
ScrollView,
109
StatusBar,
1110
Animated,
@@ -14,6 +13,7 @@ import {
1413
import { Ionicons } from "@expo/vector-icons";
1514
import { useNavigation, NavigationProp } from "@react-navigation/native";
1615
import { useTranslation } from "react-i18next";
16+
import { LinearGradient } from "expo-linear-gradient";
1717
import * as authService from "../../services/authService";
1818
import { NotificationSnackbar } from "../../components/UI/NotificationSnackbar";
1919
import AsyncStorage from "@react-native-async-storage/async-storage";
@@ -183,11 +183,17 @@ const ProfileScreen = () => {
183183
<ScrollView contentContainerStyle={styles.scrollContainer}>
184184
<Animated.View style={[styles.content, { opacity: fadeAnim }]}>
185185
<View style={styles.headerSection}>
186-
<View style={styles.avatar}>
187-
<Image
188-
source={require("../../../assets/circle-user.png")}
189-
style={styles.avatarImage}
190-
/>
186+
<View style={styles.avatarContainer}>
187+
<LinearGradient
188+
colors={['#1a1a1a', '#4a4a4a', '#2d2d2d']}
189+
start={{ x: 0, y: 0 }}
190+
end={{ x: 1, y: 1 }}
191+
style={styles.gradientAvatar}
192+
>
193+
<Text style={styles.initialsText}>
194+
{userData.username ? userData.username.substring(0, 2).toUpperCase() : 'U'}
195+
</Text>
196+
</LinearGradient>
191197
</View>
192198
<Text style={styles.username}>{userData.username}</Text>
193199
<Text style={styles.userSubtitle}>{t('profile.user.subtitle')}</Text>
@@ -377,21 +383,25 @@ const styles = StyleSheet.create({
377383
marginTop: 20,
378384
paddingHorizontal: 20,
379385
},
380-
avatar: {
386+
avatarContainer: {
381387
width: 120,
382388
height: 120,
383389
borderRadius: 60,
384-
backgroundColor: "#ffffff",
385390
marginBottom: 20,
386-
justifyContent: "center",
387-
alignItems: "center",
388-
borderWidth: 4,
389-
borderColor: "#000000",
391+
overflow: 'hidden',
390392
},
391-
avatarImage: {
392-
width: "85%",
393-
height: "85%",
394-
borderRadius: 50,
393+
gradientAvatar: {
394+
width: '100%',
395+
height: '100%',
396+
justifyContent: 'center',
397+
alignItems: 'center',
398+
},
399+
initialsText: {
400+
fontSize: 48,
401+
fontWeight: '700',
402+
color: '#ffffff',
403+
fontFamily: 'System',
404+
letterSpacing: 2,
395405
},
396406
username: {
397407
fontSize: 28,

0 commit comments

Comments
 (0)