diff --git a/public/images/register.svg b/public/images/register.svg
new file mode 100644
index 0000000..f5184c9
--- /dev/null
+++ b/public/images/register.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json
index 9eb981a..07e2420 100644
--- a/public/locales/fa/app.json
+++ b/public/locales/fa/app.json
@@ -5,6 +5,7 @@
"first_page": "خوش آمدید",
"login": "ورود",
"login_navy": "ورود اعضای ناوگان",
+ "register_navy": "ثبت نام اعضای ناوگان",
"login_welfare_services": "ورود اعضای خدمات رفاهی",
"user_welfare_services": "خدمات رفاهی",
"user_navy": "ناوگان",
@@ -34,10 +35,8 @@
"typography_routing_dashbaord_page": "داشبورد..."
},
"LoginPage": {
- "text_field_user_name": "نام کاربری",
- "text_field_enter_your_username": "نام کاربری خود را وارد کنید",
- "text_field_password": "رمز عبور",
- "text_field_enter_your_password": "رمز عبور خود را وارد کنید",
+ "text_field_phone_number": "شماره تلفن",
+ "text_field_enter_your_phone_number": "شماره تلفن خود را وارد کنید",
"button_submit": "ورود",
"link_routing_back_to": "بازگشت به",
"link_routing_previuos_page": "صفحه قبل",
@@ -45,7 +44,45 @@
"error_message_required": "اجباری!",
"button_make_account": "ایجاد حساب"
},
- "dashboard": {
+ "RegisterPage": {
+ "link_routing_back_to": "بازگشت به",
+ "link_routing_login_navy": "صفحه ورود",
+ "text_field_phone_number": "شماره تلفن",
+ "text_field_enter_your_phone_number": "شماره تلفن خود را وارد کنید",
+ "text_field_national_id": "کد ملی",
+ "text_field_enter_your_national_id": "کد ملی خود را وارد کنید",
+ "text_field_navgan_id": "شماره ناوگان",
+ "text_field_enter_your_navgan_id": "شماره ناوگان خود را وارد کنید",
+ "error_message_required": "اجباری!",
+ "button_request_verification": "دریافت کد یکبارمصرف"
+ },
+ "Dashboard": {
"dashboard_page": "داشبورد"
+ },
+ "LoanFollowUp": {
+ "loan_follow_up_page": "پیگیری درخواست"
+ },
+ "LoanRequest": {
+ "loan_request_page": "فرم درخواست وام",
+ "error_message_required": "اجباری!",
+ "text_field_phone_number": "شماره تلفن",
+ "text_field_enter_your_phone_number": "شماره تلفن خود را وارد کنید",
+ "text_field_first_name": "نام",
+ "text_field_enter_your_first_name": "نام خود را وارد کنید",
+ "text_field_last_name": "نام خانوادگی",
+ "text_field_enter_your_last_name": "نام خانوادگی خود را وارد کنید",
+ "text_field_vehicle_type": "نام وسیله نقلیه",
+ "text_field_enter_your_vehicle_type": "نام وسیله نقلیه خود را وارد کنید",
+ "text_field_province": "استان",
+ "text_field_enter_your_province": "استان خود را وارد کنید",
+ "text_field_navgan_id": "شماره ناوگان",
+ "text_field_enter_your_navgan_id": "شماره ناوگان خود را وارد کنید",
+ "text_field_national_code": "کد ملی",
+ "text_field_enter_your_national_code": "کد ملی خود را وارد کنید",
+ "text_field_birth_certificate_id": "شماره شناسنامه",
+ "text_field_enter_your_birth_certificate_id": "شماره شناسنامه خود را وارد کنید",
+ "text_field_plate_number": "شماره پلاک",
+ "text_field_enter_your_plate_number": "شماره پلاک خود را وارد کنید",
+ "button_submit": "ثبت درخواست"
}
}
diff --git a/src/components/dashboard/loan-request/index.jsx b/src/components/dashboard/loan-request/index.jsx
index b13cf78..385d6dc 100644
--- a/src/components/dashboard/loan-request/index.jsx
+++ b/src/components/dashboard/loan-request/index.jsx
@@ -1,16 +1,453 @@
+import StyledForm from "@/core/components/StyledForm";
import CenterLayout from "@/layouts/CenterLayout";
import DashboardLayouts from "@/layouts/dashboardLayouts";
import useUser from "@/lib/app/hooks/useUser";
+import { Box, Button, Stack, TextField } from "@mui/material";
+import { Field, Formik } from "formik";
import { useTranslations } from "next-intl";
-import React from "react";
+import Image from "next/image";
+import DataSaverOnIcon from "@mui/icons-material/DataSaverOn";
+import * as Yup from "yup";
const DashboardLoanRequestComponent = () => {
const t = useTranslations();
const { token } = useUser();
+
+ const initialValues = {
+ first_name: "",
+ last_name: "",
+ phone_number: "",
+ vehicle_type: "",
+ plate_number: "",
+ province: "",
+ navgan_id: "",
+ national_code: "",
+ birth_certificate_id: "",
+ national_card_img: "",
+ birth_certificate_img: "",
+ };
+
+ const validationSchema = Yup.object().shape({
+ first_name: Yup.string().required(t("LoanRequest.error_message_required")),
+ last_name: Yup.string().required(t("LoanRequest.error_message_required")),
+ phone_number: Yup.string().required(
+ t("LoanRequest.error_message_required")
+ ),
+ vehicle_type: Yup.string().required(
+ t("LoanRequest.error_message_required")
+ ),
+ plate_number: Yup.string().required(
+ t("LoanRequest.error_message_required")
+ ),
+ province: Yup.string().required(t("LoanRequest.error_message_required")),
+ navgan_id: Yup.string().required(t("LoanRequest.error_message_required")),
+ national_code: Yup.string().required(
+ t("LoanRequest.error_message_required")
+ ),
+ birth_certificate_id: Yup.string().required(
+ t("LoanRequest.error_message_required")
+ ),
+ });
+
return (
- نکنه وامم میخوای؟؟؟
+
+ {(props) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ disabled={props.isSubmitting ? true : false}
+ >
+ {t("LoanRequest.button_submit")}
+
+
+
+
+ )}
+
);
diff --git a/src/components/first/index.jsx b/src/components/first/index.jsx
index 9a1be52..24ef6bb 100644
--- a/src/components/first/index.jsx
+++ b/src/components/first/index.jsx
@@ -4,7 +4,7 @@ import StyledImage from "@/core/components/StyledImage";
import CenterLayout from "@/layouts/CenterLayout";
import FullPageLayout from "@/layouts/FullPageLayout";
import useUser from "@/lib/app/hooks/useUser";
-import { Box, Button, Divider, Typography } from "@mui/material";
+import { Box, Button, Grid, Typography } from "@mui/material";
import { useTranslations } from "next-intl";
const FirstComponent = () => {
@@ -34,28 +34,42 @@ const FirstComponent = () => {
{t("dashboard")}
) : (
-
-
-
-
+
+
+
+
+
+
+
)}
diff --git a/src/components/login-navy/index.jsx b/src/components/login-navy/index.jsx
index 70abf0e..e3fd879 100644
--- a/src/components/login-navy/index.jsx
+++ b/src/components/login-navy/index.jsx
@@ -1,6 +1,5 @@
import LinkRouting from "@/core/components/LinkRouting";
// import Notifications from "@/core/components/notifications";
-import PasswordField from "@/core/components/PasswordField";
import StyledForm from "@/core/components/StyledForm";
// import { GET_USER_TOKEN } from "@/core/data/apiRoutes";
import CenterLayout from "@/layouts/CenterLayout";
@@ -13,6 +12,7 @@ import {
Box,
Button,
Container,
+ Grid,
Paper,
Stack,
TextField,
@@ -35,27 +35,24 @@ 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, {
+ // phone_number: values.phone_number,
+ // })
+ // .then(function (response) {
+ // setToken(response.data.token);
+ // })
+ // .catch(function (error) {
+ // Notifications(directionApp, error.response, t);
+ // props.setSubmitting(false);
+ // });
+ // };
const initialValues = {
- username: "",
- password: "",
+ phone_number: "",
};
const validationSchema = Yup.object().shape({
- username: Yup.string().required(t("LoginPage.error_message_required")),
- password: Yup.string().required(t("LoginPage.error_message_required")),
+ phone_number: Yup.string().required(t("LoginPage.error_message_required")),
});
return (
@@ -82,66 +79,60 @@ const LoginComponent = () => {
-
-
-
+
+
+ }
+ disabled={props.isSubmitting ? true : false}
+ >
+ {t("LoginPage.button_make_account")}
+
+
+
+
}
+ variant="contained"
+ size="large"
+ endIcon={}
disabled={props.isSubmitting ? true : false}
>
+ {t("LoginPage.button_submit")}
-
- {t("LoginPage.button_make_account")}
- }
- disabled={props.isSubmitting ? true : false}
- >
- {t("LoginPage.button_submit")}
-
-
+
+
diff --git a/src/components/login-welfare-services/index.jsx b/src/components/login-welfare-services/index.jsx
index 863f3aa..33dfa38 100644
--- a/src/components/login-welfare-services/index.jsx
+++ b/src/components/login-welfare-services/index.jsx
@@ -1,6 +1,5 @@
import LinkRouting from "@/core/components/LinkRouting";
// import Notifications from "@/core/components/notifications";
-import PasswordField from "@/core/components/PasswordField";
import StyledForm from "@/core/components/StyledForm";
// import { GET_USER_TOKEN } from "@/core/data/apiRoutes";
import CenterLayout from "@/layouts/CenterLayout";
@@ -13,6 +12,7 @@ import {
Box,
Button,
Container,
+ Grid,
Paper,
Stack,
TextField,
@@ -38,8 +38,7 @@ const LoginComponent = () => {
// const handleSubmit = async (values, props) => {
// await axios
// .post(GET_USER_TOKEN, {
- // username: values.username,
- // password: values.password,
+ // phone_number: values.phone_number
// })
// .then(function (response) {
// setToken(response.data.token);
@@ -50,12 +49,10 @@ const LoginComponent = () => {
// });
// };
const initialValues = {
- username: "",
- password: "",
+ phone_number: ""
};
const validationSchema = Yup.object().shape({
- username: Yup.string().required(t("LoginPage.error_message_required")),
- password: Yup.string().required(t("LoginPage.error_message_required")),
+ phone_number: Yup.string().required(t("LoginPage.error_message_required"))
});
return (
@@ -82,66 +79,57 @@ const LoginComponent = () => {
-
-
-
+
+
+ }
+ disabled={props.isSubmitting ? true : false}
+ >
+ {t("LoginPage.button_make_account")}
+
+
+
+
}
+ variant="contained"
+ size="large"
+ endIcon={}
disabled={props.isSubmitting ? true : false}
>
- {t("LoginPage.button_make_account")}
+ {t("LoginPage.button_submit")}
-
- }
- disabled={props.isSubmitting ? true : false}
- >
- {t("LoginPage.button_submit")}
-
-
+
+
diff --git a/src/components/register-navy/index.jsx b/src/components/register-navy/index.jsx
index e69de29..6aa2271 100644
--- a/src/components/register-navy/index.jsx
+++ b/src/components/register-navy/index.jsx
@@ -0,0 +1,191 @@
+import StyledForm from "@/core/components/StyledForm";
+import {
+ Box,
+ Button,
+ Container,
+ Paper,
+ Stack,
+ Typography,
+ TextField,
+} from "@mui/material";
+import { Field, Formik } from "formik";
+import Image from "next/image";
+import FingerprintIcon from "@mui/icons-material/Fingerprint";
+import FullPageLayout from "@/layouts/FullPageLayout";
+import CenterLayout from "@/layouts/CenterLayout";
+import { useTranslations } from "next-intl";
+import * as Yup from "yup";
+import LinkRouting from "@/core/components/LinkRouting";
+import { useSearchParams } from "next/navigation";
+import useDirection from "@/lib/app/hooks/useDirection";
+import useUser from "@/lib/app/hooks/useUser";
+// import { GET_USER_TOKEN } from "@/core/data/apiRoutes";
+// import axios from "axios";
+
+const RegisterNavyComponent = () => {
+ const t = useTranslations();
+
+ const { directionApp } = useDirection();
+ const { setToken } = useUser();
+
+ const searchParams = useSearchParams();
+ const backUrlDecodedPath = searchParams.get("back_url");
+
+ const initialValues = {
+ type_id: "1",
+ phone_number: "",
+ national_id: "",
+ navgan_id: "",
+ };
+ const validationSchema = Yup.object().shape({
+ phone_number: Yup.string().required(
+ t("RegisterPage.error_message_required")
+ ),
+ national_id: Yup.string().required(
+ t("RegisterPage.error_message_required")
+ ),
+ navgan_id: Yup.string().required(t("RegisterPage.error_message_required")),
+ });
+ // const handleSubmit = async (values, props) => {
+ // await axios
+ // .post(GET_USER_TOKEN, {
+ // type_id: values.type_id,
+ // national_id: values.national_id,
+ // navgan_id: values.navgan_id,
+ // phone_number: values.phone_number,
+ // })
+ // .then(function (response) {
+ // setToken(response.data.token);
+ // })
+ // .catch(function (error) {
+ // Notifications(directionApp, error.response, t);
+ // props.setSubmitting(false);
+ // });
+ // };
+
+ return (
+
+
+
+
+
+ {(props) => (
+
+
+
+
+
+ {t("register_navy")}
+
+
+
+
+
+
+ }
+ disabled={props.isSubmitting ? true : false}
+ >
+ {t("RegisterPage.button_request_verification")}
+
+
+
+
+ )}
+
+
+
+
+
+
+ {t("RegisterPage.link_routing_back_to")}{" "}
+ {t("RegisterPage.link_routing_login_navy")}
+
+
+
+ );
+};
+
+export default RegisterNavyComponent;
diff --git a/src/pages/dashboard/index.jsx b/src/pages/dashboard/index.jsx
index 5ebc479..806513c 100644
--- a/src/pages/dashboard/index.jsx
+++ b/src/pages/dashboard/index.jsx
@@ -6,7 +6,7 @@ import { parse } from "next-useragent";
export default function Dashboard() {
return (
-
+
);
diff --git a/src/pages/dashboard/loan-follow-up/index.jsx b/src/pages/dashboard/loan-follow-up/index.jsx
index fc299c4..46c9440 100644
--- a/src/pages/dashboard/loan-follow-up/index.jsx
+++ b/src/pages/dashboard/loan-follow-up/index.jsx
@@ -6,7 +6,7 @@ import { parse } from "next-useragent";
export default function LoanFollowUp() {
return (
-
+
);
diff --git a/src/pages/dashboard/loan-request/index.jsx b/src/pages/dashboard/loan-request/index.jsx
index b76f172..f66f9fb 100644
--- a/src/pages/dashboard/loan-request/index.jsx
+++ b/src/pages/dashboard/loan-request/index.jsx
@@ -6,7 +6,7 @@ import { parse } from "next-useragent";
export default function LoanRequest() {
return (
-
+
);
diff --git a/src/pages/register-navy.jsx b/src/pages/register-navy.jsx
index 822a82b..7a6512f 100644
--- a/src/pages/register-navy.jsx
+++ b/src/pages/register-navy.jsx
@@ -1,4 +1,4 @@
-import RegisterComponent from "@/components/register-navy";
+import RegisterNavyComponent from "@/components/register-navy";
import TitlePage from "@/core/components/TitlePage";
import WithoutAuthMiddleware from "@/middlewares/WithoutAuth";
import { parse } from "next-useragent";
@@ -11,7 +11,7 @@ export default function RegisterNavy() {
return (
-
+
{directionApp === "rtl" ? : }
);