From a47cba4ee4425e84bbbaed69c3712ba1af13d015 Mon Sep 17 00:00:00 2001 From: Koosha Lahouti Date: Wed, 16 Jul 2025 08:35:54 +0330 Subject: [PATCH] feat: complete phone number and edit of that in user-profile --- .../profile/components/UserProfileForm.tsx | 237 ++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 src/features/profile/components/UserProfileForm.tsx diff --git a/src/features/profile/components/UserProfileForm.tsx b/src/features/profile/components/UserProfileForm.tsx new file mode 100644 index 0000000..bd48a23 --- /dev/null +++ b/src/features/profile/components/UserProfileForm.tsx @@ -0,0 +1,237 @@ +import { + Box, + Typography, + Button, + TextField, + Grid, + FormControl, + InputLabel, + Select, + MenuItem, + type SelectChangeEvent, +} from '@mui/material'; +import { useState, type ChangeEvent } from 'react'; + +export function UserProfileForm() { + const [isEditing, setIsEditing] = useState(false); + const [gender, setGender] = useState(''); + const [data, setData] = useState({ + firstName: 'محمد حسین', + lastName: 'برزه‌گر', + gender: 'مرد', + nationalCode: '', + }); + + const handleChange = (e: ChangeEvent) => { + setData((prev) => ({ + ...prev, + [e.target.name]: e.target.value, + })); + }; + + const toggleEdit = () => { + setIsEditing((prev) => !prev); + }; + const handleChangeGender = (e: SelectChangeEvent) => { + setGender(e.target.value); + }; + const displayValue = (value: string | null | undefined) => { + return value && value.trim() !== '' ? value : 'تعیین نشده'; + }; + + return ( +
+ + + + + اطلاعات شخصی من + + + این اطلاعات شما صرفا برای احراز هویت شما است و نزد هارمونی باقی + می‌ماند + + + + + + + + + + نام + + {isEditing ? ( + + ) : ( + + {displayValue(data.firstName)} + + )} + + + + + جنسیت + + {isEditing ? ( + + جنسیت + + + ) : ( + + {displayValue(data.gender)} + + )} + + + + + + + نام خانوادگی + + {isEditing ? ( + + ) : ( + + {displayValue(data.lastName)} + + )} + + + + + کد ملی + + {isEditing ? ( + + ) : ( + + {displayValue(data.nationalCode)} + + )} + + + + +
+ ); +}