diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index 8334094..d3817af 100644 --- a/public/locales/fa/app.json +++ b/public/locales/fa/app.json @@ -69,6 +69,12 @@ "error_invalid_email": "ایمیل نامعتبر است", "typography_edit_profile": "ویرایش پروفایل", "text_field_email": "ایمیل", - "text_field_enter_your_password": "رمز عبور خود را وارد کنید" + "text_field_enter_your_password": "رمز عبور خود را وارد کنید", + "text_field_username":"نام کاربری", + "text_field_name":"نام", + "text_field_phone_number":"شماره تماس", + "text_field_position":"سمت", + "text_field_province_name":"نام استان", + "error_message_required": "اجباری !" } } diff --git a/src/components/dashboard/edit-profile/index.jsx b/src/components/dashboard/edit-profile/index.jsx index cfa16d7..fa3e2e1 100644 --- a/src/components/dashboard/edit-profile/index.jsx +++ b/src/components/dashboard/edit-profile/index.jsx @@ -25,6 +25,7 @@ import ImageResizer from "@/core/components/ImageConvertor"; const DashboardEditProfile = () => { const t = useTranslations(); const { user, token, getUser, changeUser } = useUser(); + console.log(user); const { directionApp } = useDirection(); const editAvatar = async (avatar) => { @@ -97,11 +98,22 @@ const DashboardEditProfile = () => { }; const initialValues = { expert_avatar: null, - expert_email: user.expert_email, - change_avatar: false, + username: user.username, + name: user.name, + email: user.email, + province_name: user.province_name, + position: user.position, }; const validationSchema = Yup.object().shape({ - expert_email: Yup.string().email(t("UpdateProfile.error_invalid_email")), + // username: Yup.string().required(t("UpdateProfile.error_message_required")), + // name: Yup.string().required(t("UpdateProfile.error_message_required")), + // email: Yup.string() + // .email(t("UpdateProfile.error_invalid_email")) + // .required(t("UpdateProfile.error_message_required")), + // province_name: Yup.string().required( + // t("UpdateProfile.error_message_required") + // ), + // position: Yup.string().required(t("UpdateProfile.error_message_required")), }); return ( @@ -145,10 +157,11 @@ const DashboardEditProfile = () => { { { { { { /> - + */} diff --git a/src/pages/dashboard/edit-profile/index.jsx b/src/pages/dashboard/edit-profile/index.jsx index 1cf3b5c..aacdc40 100644 --- a/src/pages/dashboard/edit-profile/index.jsx +++ b/src/pages/dashboard/edit-profile/index.jsx @@ -1,6 +1,6 @@ import DashboardEditProfile from "@/components/dashboard/edit-profile"; import TitlePage from "@/core/components/TitlePage"; -import WithAuthMiddleware from "@/middlewares/WithoutAuth"; +import WithAuthMiddleware from "@/middlewares/WithAuth"; import { parse } from "next-useragent"; export default function LoanFollowUp() {