Merge branch 'feature/login_design' into 'develop'
Feature/login design See merge request witel3/loan-facilities-expert!3
This commit is contained in:
@@ -40,8 +40,7 @@
|
||||
"link_routing_back_to": "بازگشت به",
|
||||
"link_routing_previuos_page": "صفحه قبل",
|
||||
"link_routing_main_page": "صفحه اصلی",
|
||||
"error_message_required": "اجباری!",
|
||||
"button_make_account": "ایجاد حساب"
|
||||
"error_message_required": "اجباری!"
|
||||
},
|
||||
"dashboard": {
|
||||
"dashboard_page": "داشبورد"
|
||||
|
||||
@@ -8,7 +8,6 @@ import FullPageLayout from "@/layouts/FullPageLayout";
|
||||
import useDirection from "@/lib/app/hooks/useDirection";
|
||||
import useUser from "@/lib/app/hooks/useUser";
|
||||
import LoginIcon from "@mui/icons-material/Login";
|
||||
import PersonAddIcon from "@mui/icons-material/PersonAdd";
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
@@ -27,7 +26,7 @@ import * as Yup from "yup";
|
||||
|
||||
const LoginComponent = () => {
|
||||
const t = useTranslations();
|
||||
const { directionApp } = useDirection();
|
||||
// const { directionApp } = useDirection(); // should delete because we dont have direction anymore
|
||||
const { setToken } = useUser(); // pass token to set token
|
||||
|
||||
// gettin url query
|
||||
@@ -35,20 +34,20 @@ const LoginComponent = () => {
|
||||
const backUrlDecodedPath = searchParams.get("back_url");
|
||||
|
||||
// formik properties
|
||||
// const handleSubmit = async (values, props) => {
|
||||
// await axios
|
||||
// .post(GET_USER_TOKEN, {
|
||||
// username: values.username,
|
||||
// password: values.password,
|
||||
// })
|
||||
// .then(function (response) {
|
||||
// setToken(response.data.token);
|
||||
// })
|
||||
// .catch(function (error) {
|
||||
// Notifications(directionApp, error.response, t);
|
||||
// props.setSubmitting(false);
|
||||
// });
|
||||
// };
|
||||
// const handleSubmit = async (values, props) => {
|
||||
// await axios
|
||||
// .post(GET_USER_TOKEN, {
|
||||
// username: values.username,
|
||||
// password: values.password,
|
||||
// })
|
||||
// .then(function (response) {
|
||||
// setToken(response.data.token);
|
||||
// })
|
||||
// .catch(function (error) {
|
||||
// Notifications(directionApp, error.response, t);
|
||||
// props.setSubmitting(false);
|
||||
// });
|
||||
// };
|
||||
const initialValues = {
|
||||
username: "",
|
||||
password: "",
|
||||
@@ -121,20 +120,10 @@ const LoginComponent = () => {
|
||||
justifyContent: "space-between",
|
||||
}}
|
||||
>
|
||||
<LinkRouting href={"/register-navy"}>
|
||||
<Button
|
||||
type="submit"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
endIcon={<PersonAddIcon />}
|
||||
disabled={props.isSubmitting ? true : false}
|
||||
>
|
||||
{t("LoginPage.button_make_account")}
|
||||
</Button>
|
||||
</LinkRouting>
|
||||
<Button
|
||||
type="submit"
|
||||
variant="contained"
|
||||
fullWidth
|
||||
size="medium"
|
||||
endIcon={<LoginIcon />}
|
||||
disabled={props.isSubmitting ? true : false}
|
||||
|
||||
Reference in New Issue
Block a user