From f363dd54a209cd24d0eac8499d7d7ee614f97110 Mon Sep 17 00:00:00 2001 From: LeChacal Date: Sat, 10 Jan 2026 17:02:39 +0100 Subject: [PATCH 01/10] Too big on Android --- components/onboarding/OnboardingInput.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/onboarding/OnboardingInput.tsx b/components/onboarding/OnboardingInput.tsx index 3622f7aa8..1eeae4706 100644 --- a/components/onboarding/OnboardingInput.tsx +++ b/components/onboarding/OnboardingInput.tsx @@ -5,7 +5,7 @@ import { KeyboardTypeOptions, Platform, TextInput, TextInputProps } from "react- import React from "react"; import { useTheme } from "@react-navigation/native"; -const OnboardingInput = ({placeholder, text, setText, isPassword, icon, inputProps}: { +const OnboardingInput = ({ placeholder, text, setText, isPassword, icon, inputProps }: { placeholder: string text: string setText: (text: string) => void @@ -27,8 +27,8 @@ const OnboardingInput = ({placeholder, text, setText, isPassword, icon, inputPro style={{ flex: 1, padding: 20, - paddingVertical: Platform.OS === "ios" ? 20 : 10, - backgroundColor: colors.text + (dark ? "15":"08"), + paddingVertical: Platform.OS === "ios" ? 20 : 5, + backgroundColor: colors.text + (dark ? "15" : "08"), borderRadius: 300, borderWidth: 1, borderColor: colors.border From 694efd37ebb9ad63b17d923633df07900bc3e695 Mon Sep 17 00:00:00 2001 From: LeChacal Date: Sat, 10 Jan 2026 17:04:08 +0100 Subject: [PATCH 02/10] Better Profile Modal --- app/(modals)/profile.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/(modals)/profile.tsx b/app/(modals)/profile.tsx index 67d73520a..284d57cf2 100644 --- a/app/(modals)/profile.tsx +++ b/app/(modals)/profile.tsx @@ -48,9 +48,9 @@ export default function CustomProfileScreen() { const updateProfilePictureFromLibrary = async () => { const result = await ImagePicker.launchImageLibraryAsync({ - mediaTypes: ['images', 'videos'], + mediaTypes: "images", allowsEditing: true, - aspect: [4, 3], + aspect: [1, 1], quality: 1, base64: true }); @@ -75,16 +75,18 @@ export default function CustomProfileScreen() { return ( - + {/* Removed `paddingTop: 20 + (Platform.OS === "android" ? height : 0)` to center */} + @@ -153,6 +155,7 @@ export default function CustomProfileScreen() { icon={"Font"} inputProps={{}} /> + Nom + { @@ -174,7 +178,6 @@ export default function CustomProfileScreen() { - From 51d40d5f3dd259b22aa5469f91aae5f059126776 Mon Sep 17 00:00:00 2001 From: LeChacal Date: Sat, 10 Jan 2026 17:29:06 +0100 Subject: [PATCH 03/10] Added translation for names --- app/(modals)/profile.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/(modals)/profile.tsx b/app/(modals)/profile.tsx index 284d57cf2..0732c748b 100644 --- a/app/(modals)/profile.tsx +++ b/app/(modals)/profile.tsx @@ -149,7 +149,7 @@ export default function CustomProfileScreen() { Prénom Nom Date: Sat, 10 Jan 2026 17:30:50 +0100 Subject: [PATCH 04/10] Added translation for names --- app/(modals)/profile.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/(modals)/profile.tsx b/app/(modals)/profile.tsx index 0732c748b..371057a2a 100644 --- a/app/(modals)/profile.tsx +++ b/app/(modals)/profile.tsx @@ -147,7 +147,7 @@ export default function CustomProfileScreen() { - Prénom + {t("Label_FirstName")} - Nom + {t("Label_LastName")} Date: Sat, 10 Jan 2026 17:34:42 +0100 Subject: [PATCH 05/10] Removed a " " --- app/(modals)/profile.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/(modals)/profile.tsx b/app/(modals)/profile.tsx index 371057a2a..164089650 100644 --- a/app/(modals)/profile.tsx +++ b/app/(modals)/profile.tsx @@ -180,6 +180,6 @@ export default function CustomProfileScreen() { - + ); } \ No newline at end of file From d6af6216284952f8b9d633a4a7b2f39b93029490 Mon Sep 17 00:00:00 2001 From: LeChacal Date: Sat, 10 Jan 2026 17:46:36 +0100 Subject: [PATCH 06/10] Added `updateAccountName` function --- app/(modals)/profile.tsx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/app/(modals)/profile.tsx b/app/(modals)/profile.tsx index 164089650..a81da1336 100644 --- a/app/(modals)/profile.tsx +++ b/app/(modals)/profile.tsx @@ -64,11 +64,28 @@ export default function CustomProfileScreen() { const updateProfilePictureFromService = async () => { Alert.alert( t("Feature_Soon"), - "Cette fonctionnalité n'est pas encore disponible, mais elle le sera dans une prochaine mise à jour.", + t("Feature_Soon_Notification"), [{ text: "OK" }] ); } + const updateAccountName = () => { + const trimmedFirstName = firstName.trim(); + const trimmedLastName = lastName.trim(); + + if (!trimmedFirstName || !trimmedLastName) { + Alert.alert( + t("Error"), + t("Error_FirstName_LastName_Required"), + [{ text: "OK" }] + ); + + return; + } + + useAccountStore.getState().setAccountName(lastUsedAccount, trimmedFirstName, trimmedLastName); + } + const { colors } = useTheme(); const height = useHeaderHeight(); @@ -170,7 +187,7 @@ export default function CustomProfileScreen() { { - useAccountStore.getState().setAccountName(lastUsedAccount, firstName, lastName); + updateAccountName(); router.back(); }} > From 81e40a9472c3211d0aff421515cf36d50e5e3d84 Mon Sep 17 00:00:00 2001 From: LeChacal Date: Sat, 10 Jan 2026 18:09:29 +0100 Subject: [PATCH 07/10] Added autosave --- app/(modals)/profile.tsx | 36 +++++++++----------------- app/(tabs)/index/atoms/UserProfile.tsx | 2 +- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/app/(modals)/profile.tsx b/app/(modals)/profile.tsx index a81da1336..279f7307a 100644 --- a/app/(modals)/profile.tsx +++ b/app/(modals)/profile.tsx @@ -3,7 +3,6 @@ import { MenuView, NativeActionEvent } from "@react-native-menu/menu"; import { useHeaderHeight } from "@react-navigation/elements"; import { useTheme } from "@react-navigation/native"; import * as ImagePicker from "expo-image-picker" -import { router } from "expo-router"; import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { @@ -19,13 +18,13 @@ import OnboardingInput from "@/components/onboarding/OnboardingInput"; import { useAccountStore } from "@/stores/account"; import Avatar from "@/ui/components/Avatar"; import Button from "@/ui/components/Button"; -import Icon from "@/ui/components/Icon"; -import { NativeHeaderPressable, NativeHeaderSide } from "@/ui/components/NativeHeader"; import Typography from "@/ui/components/Typography"; import { getInitials } from "@/utils/chats/initials"; +import { useNavigation } from "expo-router"; export default function CustomProfileScreen() { const { t } = useTranslation(); + const navigation = useNavigation(); const store = useAccountStore.getState(); const accounts = useAccountStore((state) => state.accounts); const lastUsedAccount = useAccountStore((state) => state.lastUsedAccount); @@ -44,6 +43,15 @@ export default function CustomProfileScreen() { } }, [account]); + // Automatic save + useEffect(() => { + const unsubscribe = navigation.addListener('beforeRemove', () => { + updateAccountName(); + }); + + return unsubscribe; + }, [navigation, firstName, lastName]); + const insets = useSafeAreaInsets() const updateProfilePictureFromLibrary = async () => { @@ -73,15 +81,7 @@ export default function CustomProfileScreen() { const trimmedFirstName = firstName.trim(); const trimmedLastName = lastName.trim(); - if (!trimmedFirstName || !trimmedLastName) { - Alert.alert( - t("Error"), - t("Error_FirstName_LastName_Required"), - [{ text: "OK" }] - ); - - return; - } + if (!trimmedFirstName || !trimmedLastName) return; useAccountStore.getState().setAccountName(lastUsedAccount, trimmedFirstName, trimmedLastName); } @@ -184,18 +184,6 @@ export default function CustomProfileScreen() { - - { - updateAccountName(); - router.back(); - }} - > - - - - - ); diff --git a/app/(tabs)/index/atoms/UserProfile.tsx b/app/(tabs)/index/atoms/UserProfile.tsx index a0ebbe7f2..b282da38e 100644 --- a/app/(tabs)/index/atoms/UserProfile.tsx +++ b/app/(tabs)/index/atoms/UserProfile.tsx @@ -23,7 +23,7 @@ const UserProfile = ({ subtitle, chevron, onPress }: { subtitle?: string, chevro > { - router.push("/(modals)/profile"); + router.navigate("/(modals)/profile"); }} > Date: Sun, 11 Jan 2026 15:39:01 +0100 Subject: [PATCH 08/10] Added French translation --- locales/fr.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locales/fr.json b/locales/fr.json index c70505686..0a0d603f3 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -13,6 +13,8 @@ "Button_Change_ProfilePicture_FromLibrary": "Depuis la photothèque", "Button_Change_ProfilePicture_FromService": "Récupérer depuis ton ENT", "Button_Change_ProfilePicture_Remove": "Supprimer la photo", + "Label_FirstName": "Prénom", + "Label_LastName": "Nom de famille", "Tab_Page": "Page", "Tab_Settings": "Paramètres", "Tab_News": "Actualités", @@ -400,7 +402,6 @@ "Profile_Cards_History": "Historique", "Magic_Important": "Peut-être important", - "OnBoarding_Step": "Étape ", "OnBoarding_Step_Of": "sur ", From de3e2134fa8810e3ffbc7abb04fef65dba616878 Mon Sep 17 00:00:00 2001 From: LeChacal Date: Sat, 17 Jan 2026 09:41:25 +0100 Subject: [PATCH 09/10] Removed unnecessary comment --- app/(modals)/profile.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/app/(modals)/profile.tsx b/app/(modals)/profile.tsx index 279f7307a..1ab2f42fd 100644 --- a/app/(modals)/profile.tsx +++ b/app/(modals)/profile.tsx @@ -100,7 +100,6 @@ export default function CustomProfileScreen() { style={{ height: "100%" }} contentContainerStyle={{ flexGrow: 1, justifyContent: "center" }} > - {/* Removed `paddingTop: 20 + (Platform.OS === "android" ? height : 0)` to center */} Date: Sat, 17 Jan 2026 09:53:13 +0100 Subject: [PATCH 10/10] Added translation for `es` and `en` --- locales/en.json | 4 +++- locales/es.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/locales/en.json b/locales/en.json index e6d01b4ff..a69132f8a 100644 --- a/locales/en.json +++ b/locales/en.json @@ -12,6 +12,8 @@ "Button_Change_ProfilePicture_FromLibrary": "From photo library", "Button_Change_ProfilePicture_FromService": "Retrieve from your ENT", "Button_Change_ProfilePicture_Remove": "Remove picture", + "Label_FirstName": "First name", + "Label_LastName": "Last name", "Tab_Page": "Page", "Tab_Settings": "Settings", "Tab_News": "News", @@ -371,4 +373,4 @@ "Today": "Today", "Yesterday": "Yesterday", "Tomorrow": "Tomorrow" -} \ No newline at end of file +} diff --git a/locales/es.json b/locales/es.json index 06361276c..2afbde7af 100644 --- a/locales/es.json +++ b/locales/es.json @@ -12,6 +12,8 @@ "Button_Change_ProfilePicture_FromLibrary": "Desde la galería", "Button_Change_ProfilePicture_FromService": "Recuperar desde tu ENT", "Button_Change_ProfilePicture_Remove": "Eliminar la foto", + "Label_FirstName": "Nombre", + "Label_LastName": "Apellido", "Tab_Page": "Página", "Tab_Settings": "Configuración", "Tab_News": "Noticias", @@ -368,4 +370,4 @@ "Today": "Hoy", "Yesterday": "Ayer", "Tomorrow": "Mañana" -} \ No newline at end of file +}