feat(userAccount): improve user profile handling with avatar upload and dynamic display name

This commit is contained in:
hamed
2026-06-19 11:05:43 +03:30
parent ea2c0c29ec
commit da05a4e13c
5 changed files with 103 additions and 65 deletions
@@ -8,6 +8,7 @@ function Field({
icon,
placeholder,
data,
value,
name,
iconGray,
error,
@@ -16,12 +17,18 @@ function Field({
props,
disable,
}) {
// وقتی value پاس داده شود فیلد controlled است (برای مقادیر فقط‌خواندنی مثل موبایل)؛
// در غیر این صورت رفتار قبلی (uncontrolled با defaultValue) حفظ می‌شود.
const controlled =
value !== undefined
? { value: value ?? "" }
: { defaultValue: data };
return (
<div className="relative w-full">
<TextField
{...props}
// value={data}
defaultValue={data}
{...controlled}
disabled={disable}
type={type || "text"}
placeholder={placeholder || ""}