From 40c0415b63d0bbb5aeec2ac125d96a2189ec404d Mon Sep 17 00:00:00 2001 From: Koosha Lahouti Date: Wed, 23 Jul 2025 21:38:01 +0330 Subject: [PATCH] feat: responsive design and english translator for this section --- public/locales/en/profileSetting.json | 41 +++ src/App.tsx | 25 +- src/components/CardContainer.tsx | 16 +- .../components/PersonalInformation.tsx | 170 ++++++----- .../profile/components/PhoneNumber.tsx | 87 +++--- .../profile/components/SocialMedia.tsx | 122 +++++--- .../profile/components/UserProfileForm.tsx | 286 ------------------ 7 files changed, 276 insertions(+), 471 deletions(-) create mode 100644 public/locales/en/profileSetting.json delete mode 100644 src/features/profile/components/UserProfileForm.tsx diff --git a/public/locales/en/profileSetting.json b/public/locales/en/profileSetting.json new file mode 100644 index 0000000..3cd0346 --- /dev/null +++ b/public/locales/en/profileSetting.json @@ -0,0 +1,41 @@ +{ + "settingForm": { + "titlePersonalInfo": "My Personal Information", + "descriptionPersonalInfo": "This information is only for your identification and remains with Harmony.", + "titlePhoneNumber": "My phone number", + "descriptionPhoneNumber": "This information is only for your identification and remains with Harmony.", + "titleSocial": "My email and social medias", + "descriptionSocial": "This information is only for your identification and remains with Harmony.", + "rejectButton": "Cancel", + "saveButton": "Save", + "editButton": "Edit", + "editPhoneNumber": "Change phone number", + "addEmailOrSocialButton": "Add email / social", + "addEmailButton": "Add email", + "name": "Name", + "familyName": "Family Name", + "country": "Country", + "gender": "Gender", + "nationalCode": "National code", + "man": "Male", + "woman": "Female", + "genderPlaceholder": "Male", + "newPhoneNumber": "New phone number", + "verificationCodeButton": "Send verification code", + "verificationCode": "Verification code", + "checkCode": "Check code", + "successButton": "Confirmed", + "email": "Email", + "apple": "Apple", + "google": "Google", + "newEmail": "New email", + "dialogHeader": "By activating your email, you can use this email to log in the next time you log in.", + "or": "Or", + "emailError": "Please enter a valid email.", + "profilePicture": "User account image", + "allowedFormat": "Allowed formats: PNG, JPEG, GIF (maximum 10 MB)", + "uploadPicture": "Upload image", + "phoneNumberText": "Your new contact number will replace your previous contact number.", + "verb": "." + } +} diff --git a/src/App.tsx b/src/App.tsx index 47481fa..853a2c8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,31 +9,8 @@ import { import './App.css'; import { useTranslation } from 'react-i18next'; import { LanguageManager } from './components/LanguageManager'; -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD - -======= ->>>>>>> f1620b6 (fix: issue in user profile) -======= -======= -import { UserProfileForm } from './features/profile/components/UserProfileForm'; - ->>>>>>> 3698cbf (feat: implement user profile form) ->>>>>>> f9815fb (fix: issue in user profile) -======= ->>>>>>> 2a79376 (fix: merge conflict) -======= import { UserForm } from './features/profile/components/UserForm'; ->>>>>>> 60c6dc1 (fix: styles) -======= ->>>>>>> afc7ff8 (fix: translation and styles) -======= -import { UserForm } from './features/profile/components/UserForm'; ->>>>>>> b327e7a (fix: styles and add a country textfield in personal field) + function App() { const { t } = useTranslation(); diff --git a/src/components/CardContainer.tsx b/src/components/CardContainer.tsx index d62672b..80250f0 100644 --- a/src/components/CardContainer.tsx +++ b/src/components/CardContainer.tsx @@ -1,4 +1,5 @@ import { Box, Typography } from '@mui/material'; + export function CardContainer({ title, subtitle, @@ -15,13 +16,16 @@ export function CardContainer({ return ( @@ -30,7 +34,7 @@ export function CardContainer({ display: 'flex', justifyContent: 'space-between', alignItems: 'center', - backgroundColor: highlighted ? '#E3F2FD' : '#F5F5F5', + backgroundColor: highlighted ? 'primary.light' : 'background.default', p: 2, borderRadius: 1, }} @@ -38,12 +42,12 @@ export function CardContainer({ {title} {subtitle} diff --git a/src/features/profile/components/PersonalInformation.tsx b/src/features/profile/components/PersonalInformation.tsx index 291d075..a195047 100644 --- a/src/features/profile/components/PersonalInformation.tsx +++ b/src/features/profile/components/PersonalInformation.tsx @@ -89,7 +89,11 @@ export function PersonalInformation() { variant="text" onClick={() => setIsEditing(false)} size="large" - sx={{ color: '#2979FF', width: '43px' }} + sx={{ + color: 'primary.main', + width: '43px', + textTransform: 'none', + }} > {t('settingForm.rejectButton')} @@ -97,12 +101,16 @@ export function PersonalInformation() {