From c2e0420b79c4c6abb1f7850bca994e07d52fcad7 Mon Sep 17 00:00:00 2001 From: Mohammad Jalali Date: Wed, 21 Aug 2024 15:16:40 +0330 Subject: [PATCH] compelete design of edit profile and change password components --- .../components/Profile/ChangePass/Form.jsx | 65 ++++++ .../components/Profile/ChangePass/index.jsx | 39 +--- src/core/components/Profile/Update/form.jsx | 220 ++++++++++-------- src/core/components/Profile/Update/index.jsx | 33 +-- 4 files changed, 209 insertions(+), 148 deletions(-) create mode 100644 src/core/components/Profile/ChangePass/Form.jsx diff --git a/src/core/components/Profile/ChangePass/Form.jsx b/src/core/components/Profile/ChangePass/Form.jsx new file mode 100644 index 0000000..0307f8c --- /dev/null +++ b/src/core/components/Profile/ChangePass/Form.jsx @@ -0,0 +1,65 @@ +"use client"; + +import { Chip, Divider, Grid, TextField } from "@mui/material"; +import StyledForm from "@/core/components/StyledForm"; +import { useForm } from "react-hook-form"; + +const Form = () => { + const defaultValues = { + old_password: "", + new_password: "", + repeat_new_password: "", + }; + + const { + control, + watch, + register, + handleSubmit, + setValue, + formState: { isSubmitting }, + } = useForm({ defaultValues: defaultValues }); + + return ( + <> + + + + + + + + + + + + + + + + + + ); +}; +export default Form; \ No newline at end of file diff --git a/src/core/components/Profile/ChangePass/index.jsx b/src/core/components/Profile/ChangePass/index.jsx index 31df662..10d4d78 100644 --- a/src/core/components/Profile/ChangePass/index.jsx +++ b/src/core/components/Profile/ChangePass/index.jsx @@ -1,46 +1,27 @@ "use client"; -import { - Box, - Button, - Dialog, - DialogActions, - DialogContent, - DialogTitle, - IconButton, - useMediaQuery, -} from "@mui/material"; +import { Button, Dialog, DialogActions, DialogContent } from "@mui/material"; import { useTheme } from "@mui/material/styles"; -import CloseIcon from "@mui/icons-material/Close"; +import Form from "./Form"; const ChangePass = ({ open, setOpen }) => { const theme = useTheme(); - const fullScreen = useMediaQuery(theme.breakpoints.down("sm")); return ( - { setOpen(false); }}> - - - تغییر رمز عبور - - { - setOpen(false); - }} - sx={{ color: (theme) => theme.palette.grey[500] }} - > - - - - تست +
- + + + + + + + + + + + + + + ( + { + onChange(newValue); + }} + options={degreeItems} + renderInput={(params) => ( + + )} + /> + )} + /> + + + + - - - - - + + ); }; export default Form; \ No newline at end of file diff --git a/src/core/components/Profile/Update/index.jsx b/src/core/components/Profile/Update/index.jsx index e4183ac..0353fcb 100644 --- a/src/core/components/Profile/Update/index.jsx +++ b/src/core/components/Profile/Update/index.jsx @@ -1,17 +1,7 @@ "use client"; -import { - Box, - Button, - Dialog, - DialogActions, - DialogContent, - DialogTitle, - IconButton, - useMediaQuery, -} from "@mui/material"; +import { Button, Dialog, DialogActions, DialogContent, useMediaQuery } from "@mui/material"; import { useTheme } from "@mui/material/styles"; -import CloseIcon from "@mui/icons-material/Close"; import Form from "./form"; const Update = ({ open, setOpen }) => { @@ -23,25 +13,16 @@ const Update = ({ open, setOpen }) => { onClose={() => { setOpen(false); }}> - - - ویرایش پروفایل - - { - setOpen(false); - }} - sx={{ color: (theme) => theme.palette.grey[500] }} - > - - - - +