first demo of login page

This commit is contained in:
2023-07-10 14:39:15 +03:30
parent fa21bf197a
commit 0ae316a72b
2 changed files with 17 additions and 29 deletions

View File

@@ -35,8 +35,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": "داشبورد"

View File

@@ -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}