diff --git a/.eslintrc.json b/.eslintrc.json
index bffb357..121cefd 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,3 +1,3 @@
{
- "extends": "next/core-web-vitals"
+ "extends": ["next/core-web-vitals","prettier"]
}
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000..434e674
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,12 @@
+{
+ "printWidth": 120,
+ "tabWidth": 4,
+ "useTabs": false,
+ "semi": true,
+ "singleQuote": false,
+ "trailingComma": "es5",
+ "bracketSpacing": true,
+ "jsxBracketSameLine": false,
+ "arrowParens": "always",
+ "endOfLine": "crlf"
+}
diff --git a/package.json b/package.json
index 14fe115..7044cfd 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,8 @@
"build:publish": "npm i && npm run build && pm2 restart ecosystem.config.js",
"start": "next start",
"publish-3001": "next start -p 3001",
- "lint": "next lint"
+ "lint": "next lint",
+ "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,html,css,scss}\""
},
"dependencies": {
"@emotion/react": "^11.10.6",
@@ -32,6 +33,7 @@
"next-intl": "^2.13.1",
"next-useragent": "^2.8.0",
"nextjs-progressbar": "^0.0.16",
+ "prettier": "^3.3.3",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
@@ -47,4 +49,4 @@
"@faker-js/faker": "^7.6.0",
"eslint-config-next": "^13.3.0"
}
-}
\ No newline at end of file
+}
diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json
index 8460e70..33ac84b 100644
--- a/public/locales/fa/app.json
+++ b/public/locales/fa/app.json
@@ -320,7 +320,7 @@
"text_field_shenasname_serial": "سریال پشت کارت ملی",
"text_field_national_trackin_code": "کد رهگیری کارت ملی",
"text_field_national_id": "کد ملی",
- "text_field_boss_national_id": "کد ملی رییس شرکت",
+ "text_field_boss_national_id": "کد ملی مدیر عامل",
"text_field_register_number": "شماره ثبت شرکت",
"text_field_postal_code": "کد پستی",
"text_field_national_serial_number": "سریال پشت کارت ملی",
diff --git a/src/components/dashboard/first/index.jsx b/src/components/dashboard/first/index.jsx
index 7b42ef9..9d39d5e 100644
--- a/src/components/dashboard/first/index.jsx
+++ b/src/components/dashboard/first/index.jsx
@@ -1,46 +1,41 @@
-import {
- CenterLayout,
- FullPageLayout,
- NextLinkComposed,
- useUser,
-} from "@witel/webapp-builder";
+import { CenterLayout, FullPageLayout, NextLinkComposed, useUser } from "@witel/webapp-builder";
import { Button, Typography } from "@mui/material";
import { useTranslations } from "next-intl";
const FirstComponent = () => {
- const { user } = useUser();
- const t = useTranslations();
- return (
-
-
- {user.permissions.includes("can_request_navgan_loan") ? (
- <>
- {t("Dashboard.go_to_add_request_loan")}
-
- >
- ) : (
- <>
- {t("Dashboard.go_to_followUp-loan")}
-
- >
- )}
-
-
- );
+ const { user } = useUser();
+ const t = useTranslations();
+ return (
+
+
+ {user.permissions.includes("can_request_navgan_loan") ? (
+ <>
+ {t("Dashboard.go_to_add_request_loan")}
+
+ >
+ ) : (
+ <>
+ {t("Dashboard.go_to_followUp-loan")}
+
+ >
+ )}
+
+
+ );
};
-export default FirstComponent;
\ No newline at end of file
+export default FirstComponent;
diff --git a/src/components/dashboard/navgan/add-request-loan/forms/AddForm.jsx b/src/components/dashboard/navgan/add-request-loan/forms/AddForm.jsx
index f83a954..74cf7a8 100644
--- a/src/components/dashboard/navgan/add-request-loan/forms/AddForm.jsx
+++ b/src/components/dashboard/navgan/add-request-loan/forms/AddForm.jsx
@@ -1,64 +1,58 @@
-import {
- Button,
- Grid,
- Stack,
- ToggleButton,
- ToggleButtonGroup,
- Typography
-} from "@mui/material";
-import {useTranslations} from "next-intl";
-import {CenterLayout} from "@witel/webapp-builder";
-import {useState} from "react";
-import DoneIcon from '@mui/icons-material/Done';
-import {NextLinkComposed} from "@witel/webapp-builder/dist/utils/linkRouting";
+import { Button, Grid, Stack, ToggleButton, ToggleButtonGroup, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { CenterLayout } from "@witel/webapp-builder";
+import { useState } from "react";
+import DoneIcon from "@mui/icons-material/Done";
+import { NextLinkComposed } from "@witel/webapp-builder/dist/utils/linkRouting";
import SvgDone from "@/core/components/svgs/SvgDone";
import RealPersonForm from "@/components/dashboard/navgan/add-request-loan/forms/RealPersonForm";
import LegalPersonForm from "@/components/dashboard/navgan/add-request-loan/forms/LegalPersonForm";
const AddFormComponent = () => {
const t = useTranslations();
- const [finishLoanRequest, setFinishLoanRequest] = useState(false)
- const [personType, setPersonType] = useState("real")
+ const [finishLoanRequest, setFinishLoanRequest] = useState(false);
+ const [personType, setPersonType] = useState("real");
- return (<>
- {finishLoanRequest ? (
-
-
- {t("LoanRequest.finish_loan_request")}
-
-
-
- ) : (
- <>
-
- {
- if (value === null) return
- setPersonType(value)
- }}
- >
-
- {t("LoanRequest.real_person")}
-
-
- {t("LoanRequest.legal_person")}
-
-
-
- {
- personType === "real" ? :
-
- }
- >
- )}
- >);
+ return (
+ <>
+ {finishLoanRequest ? (
+
+
+
+
+ {t("LoanRequest.finish_loan_request")}
+
+
+
+
+
+ ) : (
+ <>
+
+ {
+ if (value === null) return;
+ setPersonType(value);
+ }}
+ >
+ {t("LoanRequest.real_person")}
+ {t("LoanRequest.legal_person")}
+
+
+ {personType === "real" ? (
+
+ ) : (
+
+ )}
+ >
+ )}
+ >
+ );
};
export default AddFormComponent;
diff --git a/src/components/dashboard/navgan/add-request-loan/forms/LegalPersonForm.jsx b/src/components/dashboard/navgan/add-request-loan/forms/LegalPersonForm.jsx
index 3ed42a1..1d98b62 100644
--- a/src/components/dashboard/navgan/add-request-loan/forms/LegalPersonForm.jsx
+++ b/src/components/dashboard/navgan/add-request-loan/forms/LegalPersonForm.jsx
@@ -8,7 +8,7 @@ import {
ToggleButton,
ToggleButtonGroup,
} from "@mui/material";
-import {useTranslations} from "next-intl";
+import { useTranslations } from "next-intl";
import useCities from "@/lib/app/hooks/useCities";
import UseEducations from "@/lib/app/hooks/useEducations";
import useOccupations from "@/lib/app/hooks/useOccupations";
@@ -16,28 +16,28 @@ import * as React from "react";
import SelectBox from "@/core/components/SelectBox";
import useLimitedProvince from "@/lib/app/hooks/useLimitedProvince";
import PlateNumber from "@/core/components/PlateNumber";
-import {useRouter} from "next/router";
-import {useRequest, useUser} from "@witel/webapp-builder";
+import { useRouter } from "next/router";
+import { useRequest, useUser } from "@witel/webapp-builder";
import * as Yup from "yup";
-import {SEND_LOAN_REQUEST_NAVGAN} from "@/core/data/apiRoutes";
+import { SEND_LOAN_REQUEST_NAVGAN } from "@/core/data/apiRoutes";
import DataSaverOnIcon from "@mui/icons-material/DataSaverOn";
-import {useFormik} from "formik";
+import { useFormik } from "formik";
import useProjectTitle from "@/lib/app/hooks/useProjectTitle";
import useActivityType from "@/lib/app/hooks/useActivityType";
import MuiDatePicker from "@/core/components/MuiDatePicker";
import LegalPersonDatePicker from "@/core/components/LegalPersonDatePicker";
-const LegalPersonForm = ({setFinishLoanRequest}) => {
+const LegalPersonForm = ({ setFinishLoanRequest }) => {
const t = useTranslations();
const router = useRouter();
const requestServer = useRequest();
- const {getUser, changeUser} = useUser();
- const {cityTextField, cityList, setProvinceID, isLoadingCityList} = useCities();
- const {provinceList, isLoadingProvinceList, errorProvinceList} = useLimitedProvince();
- const {educationsList, isLoadingEducationsList, errorEducationsList} = UseEducations();
- const {occupationsList, isLoadingOccupationsList, errorOccupationsList} = useOccupations();
- const {activityType, isLoadingActivityType, errorActivityType} = useActivityType();
- const {projectTitle, isLoadingProjectTitle, errorProjectTitle} = useProjectTitle();
+ const { getUser, changeUser } = useUser();
+ const { cityTextField, cityList, setProvinceID, isLoadingCityList } = useCities();
+ const { provinceList, isLoadingProvinceList, errorProvinceList } = useLimitedProvince();
+ const { educationsList, isLoadingEducationsList, errorEducationsList } = UseEducations();
+ const { occupationsList, isLoadingOccupationsList, errorOccupationsList } = useOccupations();
+ const { activityType, isLoadingActivityType, errorActivityType } = useActivityType();
+ const { projectTitle, isLoadingProjectTitle, errorProjectTitle } = useProjectTitle();
const initialValues = {
person_type: "legal",
@@ -118,35 +118,41 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
national_number: Yup.mixed().when("person_type", ([person_type], schema) => {
return person_type === "legal"
? schema
- .test("is-number", `${t("LoanRequest.national_number_number")}`, (value) => !isNaN(value))
- .test("positive", `${t("LoanRequest.national_number_positive")}`, (value) => value >= 0)
- .test(
- "max",
- `${t("LoanRequest.national_number_max")}`,
- (value) => value && value.toString().length === 11
- )
- .required(t("LoanRequest.error_message_national_number"))
+ .test("is-number", `${t("LoanRequest.national_number_number")}`, (value) => !isNaN(value))
+ .test("positive", `${t("LoanRequest.national_number_positive")}`, (value) => value >= 0)
+ .test(
+ "max",
+ `${t("LoanRequest.national_number_max")}`,
+ (value) => value && value.toString().length === 11
+ )
+ .required(t("LoanRequest.error_message_national_number"))
: schema;
}),
- boss_national_serial_number: Yup.string()
- .when("national_serial_number_or_tracking_code", ([national_serial_number_or_tracking_code], schema) => {
+ boss_national_serial_number: Yup.string().when(
+ "national_serial_number_or_tracking_code",
+ ([national_serial_number_or_tracking_code], schema) => {
return national_serial_number_or_tracking_code === "national_serial_number"
- ? schema.test(
- "max",
- `${t("LoanRequest.boss_national_serial_number_max")}`,
- (value) => value && value.toString().length === 10
- ).required(t("LoanRequest.error_message_boss_shenasname_serial"))
+ ? schema
+ .test(
+ "max",
+ `${t("LoanRequest.boss_national_serial_number_max")}`,
+ (value) => value && value.toString().length === 10
+ )
+ .required(t("LoanRequest.error_message_boss_shenasname_serial"))
: schema;
- }),
+ }
+ ),
boss_national_card_tracking_code: Yup.string().when(
"national_serial_number_or_tracking_code",
([national_serial_number_or_tracking_code], schema) => {
return national_serial_number_or_tracking_code === "national_card_tracking_code"
- ? schema.test(
- "max",
- `${t("LoanRequest.national_boss_tracking_code_max")}`,
- (value) => value && value.toString().length === 10
- ).required(t("LoanRequest.error_message_boss_national_card_tracking_code"))
+ ? schema
+ .test(
+ "max",
+ `${t("LoanRequest.national_boss_tracking_code_max")}`,
+ (value) => value && value.toString().length === 10
+ )
+ .required(t("LoanRequest.error_message_boss_national_card_tracking_code"))
: schema;
}
),
@@ -157,18 +163,18 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
let _national_number =
values.person_type === "legal"
? {
- shenase_meli: values.national_number,
- }
+ shenase_meli: values.national_number,
+ }
: {};
const _national_card =
values.national_serial_number_or_tracking_code === "national_serial_number"
? {
- national_serial_number: values.boss_national_serial_number,
- }
+ national_serial_number: values.boss_national_serial_number,
+ }
: {
- national_tracking_code: values.boss_national_card_tracking_code,
- };
+ national_tracking_code: values.boss_national_card_tracking_code,
+ };
let _data = {
is_legal_person: 1,
@@ -213,8 +219,7 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
changeUser(data);
});
})
- .catch(() => {
- })
+ .catch(() => {})
.finally(() => {
props.setSubmitting(false);
});
@@ -227,7 +232,7 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
});
return (
<>
-
+
{
isLoading={isLoadingProjectTitle}
errorEcured={errorProjectTitle}
selectors={projectTitle}
- schema={{value: "value", name: "name"}}
+ schema={{ value: "value", name: "name" }}
select={formik.values.navgan_plan_id}
value={formik.values.navgan_plan_id}
handleChange={(event) => {
@@ -258,7 +263,7 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
isLoading={isLoadingActivityType}
errorEcured={errorActivityType}
selectors={activityType}
- schema={{value: "value", name: "name"}}
+ schema={{ value: "value", name: "name" }}
select={formik.values.activity_type}
value={formik.values.activity_type}
handleChange={(event) => {
@@ -271,15 +276,15 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
/>
-
+
{
const inputValue = event.target.value;
@@ -303,7 +308,7 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
{
{
const inputValue = event.target.value;
@@ -347,14 +352,14 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
/>
-
+
{
const inputValue = event.target.value;
@@ -379,11 +384,11 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
{
@@ -415,7 +420,7 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
/>
-
+
{
isLoading={isLoadingProvinceList}
errorEcured={errorProvinceList}
selectors={provinceList}
- schema={{value: "value", name: "name"}}
+ schema={{ value: "value", name: "name" }}
select={formik.values.province_id}
value={formik.values.province_id}
handleChange={(event) => {
@@ -447,12 +452,12 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
isLoadingCityList
? `${t("LoanRequest.cityList_loading")}`
: cityList.length === 0
- ? `${t("LoanRequest.cityList_empty")}`
- : cityTextField
+ ? `${t("LoanRequest.cityList_empty")}`
+ : cityTextField
}
size="small"
selectType="city_id"
- schema={{value: "value", name: "name"}}
+ schema={{ value: "value", name: "name" }}
disabled={cityList.length === 0}
selectors={cityList}
select={formik.values.city_id}
@@ -465,15 +470,15 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
/>
-
+
{
const inputValue = event.target.value;
@@ -514,7 +519,7 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
name: "مرد",
},
]}
- schema={{value: "value", name: "name"}}
+ schema={{ value: "value", name: "name" }}
select={formik.values.boss_gender}
handleChange={(event) => {
formik.setFieldValue("boss_gender", event.target.value);
@@ -526,10 +531,10 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
/>
-
+
{
{
/>
-
+
{
{formik.values.national_serial_number_or_tracking_code === "national_serial_number" ? (
{
) : (
{
)}
{
/>
-
+
{
/>
-
+
-
+
{
selectors={educationsList}
select={formik.values.education_id}
value={formik.values.education_id}
- schema={{value: "id", name: "title"}}
+ schema={{ value: "id", name: "title" }}
handleChange={(event) => {
formik.setFieldValue("education_id", event.target.value);
}}
@@ -756,7 +761,7 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
isLoading={isLoadingOccupationsList}
errorEcured={errorOccupationsList}
selectType="occupation_id"
- schema={{value: "id", name: "title"}}
+ schema={{ value: "id", name: "title" }}
selectors={occupationsList}
select={formik.values.occupation_id}
value={formik.values.occupation_id}
@@ -770,12 +775,12 @@ const LegalPersonForm = ({setFinishLoanRequest}) => {
/>
-
+
{
/>
-
+
{
/>
-
+
{
+
+ )}
+
+ >
+ );
};
export default UpdateFormReal;
diff --git a/src/components/dashboard/navgan/show/form/index.jsx b/src/components/dashboard/navgan/show/form/index.jsx
index 84d5b99..f626390 100644
--- a/src/components/dashboard/navgan/show/form/index.jsx
+++ b/src/components/dashboard/navgan/show/form/index.jsx
@@ -1,37 +1,38 @@
-import {useEffect, useState} from "react";
-import {GET_LOAN_DETAILS} from "@/core/data/apiRoutes";
-import {useRouter} from "next/router";
-import {SvgLoading, useRequest} from "@witel/webapp-builder";
-import {Stack, Typography} from "@mui/material";
-import {useTranslations} from "next-intl";
+import { useEffect, useState } from "react";
+import { GET_LOAN_DETAILS } from "@/core/data/apiRoutes";
+import { useRouter } from "next/router";
+import { SvgLoading, useRequest } from "@witel/webapp-builder";
+import { Stack, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
import UpdateFormReal from "@/components/dashboard/navgan/show/form/UpdateFormReal";
import UpdateFormLegal from "@/components/dashboard/navgan/show/form/UpdateFormLegal";
const ShowLoanForm = () => {
const t = useTranslations();
- const {query} = useRouter();
- const requestServer = useRequest({auth: true, notification: false});
+ const { query } = useRouter();
+ const requestServer = useRequest({ auth: true, notification: false });
const [LoanDetails, setLoanDetails] = useState({});
useEffect(() => {
- requestServer(GET_LOAN_DETAILS + query.id, 'get', {auth: true, notification: false}).then(({data}) => {
- setLoanDetails(data.data);
- }).catch(() => {
- })
+ requestServer(GET_LOAN_DETAILS + query.id, "get", { auth: true, notification: false })
+ .then(({ data }) => {
+ setLoanDetails(data.data);
+ })
+ .catch(() => {});
}, []);
if (Object.keys(LoanDetails).length === 0) {
return (
-
-
+
+
{t("ShowLoan.loading_show_component")}
);
}
return LoanDetails.is_legal_person === 1 ? (
-
+
) : (
-
- )
+
+ );
};
-export default ShowLoanForm;
\ No newline at end of file
+export default ShowLoanForm;
diff --git a/src/components/dashboard/navgan/show/index.jsx b/src/components/dashboard/navgan/show/index.jsx
index b9c73ed..6dfeda9 100644
--- a/src/components/dashboard/navgan/show/index.jsx
+++ b/src/components/dashboard/navgan/show/index.jsx
@@ -1,14 +1,14 @@
-import {useTranslations} from "next-intl";
-import {CenterLayout, useUser} from "@witel/webapp-builder";
+import { useTranslations } from "next-intl";
+import { CenterLayout, useUser } from "@witel/webapp-builder";
import ShowLoanForm from "@/components/dashboard/navgan/show/form";
const ShowLoan = () => {
const t = useTranslations();
- const {user} = useUser();
+ const { user } = useUser();
return (
-
+
);
};
diff --git a/src/components/errors/403.jsx b/src/components/errors/403.jsx
index 8d410ed..c20f89d 100644
--- a/src/components/errors/403.jsx
+++ b/src/components/errors/403.jsx
@@ -1,18 +1,18 @@
-import {Button, Typography} from "@mui/material";
-import {useTranslations} from "next-intl";
+import { Button, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
import TitlePage from "@/core/components/TitlePage";
import Svg403 from "@/core/components/svgs/Svg403";
-import {CenterLayout, FullPageLayout, NextLinkComposed} from "@witel/webapp-builder";
+import { CenterLayout, FullPageLayout, NextLinkComposed } from "@witel/webapp-builder";
const UnAuthorizedComponent = () => {
const t = useTranslations();
return (
<>
-
-
+
+
-
+
{t("ErrorPage.custom_403")}
@@ -23,8 +23,7 @@ const UnAuthorizedComponent = () => {
pathname: "/",
}}
>
- {t("ErrorPage.link_routing_back_to")}{" "}
- {t("ErrorPage.link_routing_main_page")}
+ {t("ErrorPage.link_routing_back_to")} {t("ErrorPage.link_routing_main_page")}
diff --git a/src/components/errors/404.jsx b/src/components/errors/404.jsx
index 15a394c..25395e5 100644
--- a/src/components/errors/404.jsx
+++ b/src/components/errors/404.jsx
@@ -1,18 +1,18 @@
-import {Button, Typography} from "@mui/material";
-import {useTranslations} from "next-intl";
+import { Button, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
import TitlePage from "@/core/components/TitlePage";
import Svg404 from "@/core/components/svgs/Svg404";
-import {CenterLayout, FullPageLayout, NextLinkComposed} from "@witel/webapp-builder";
+import { CenterLayout, FullPageLayout, NextLinkComposed } from "@witel/webapp-builder";
const NotFoundComponent = () => {
const t = useTranslations();
return (
<>
-
-
+
+
-
+
{t("ErrorPage.custom_404")}
@@ -23,8 +23,7 @@ const NotFoundComponent = () => {
pathname: "/",
}}
>
- {t("ErrorPage.link_routing_back_to")}{" "}
- {t("ErrorPage.link_routing_main_page")}
+ {t("ErrorPage.link_routing_back_to")} {t("ErrorPage.link_routing_main_page")}
diff --git a/src/components/errors/500.jsx b/src/components/errors/500.jsx
index 5527a39..e9bd09c 100644
--- a/src/components/errors/500.jsx
+++ b/src/components/errors/500.jsx
@@ -1,18 +1,18 @@
-import {Button, Typography} from "@mui/material";
-import {useTranslations} from "next-intl";
+import { Button, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
import TitlePage from "@/core/components/TitlePage";
import Svg500 from "@/core/components/svgs/Svg500";
-import {CenterLayout, FullPageLayout, NextLinkComposed} from "@witel/webapp-builder";
+import { CenterLayout, FullPageLayout, NextLinkComposed } from "@witel/webapp-builder";
const ServerErrorComponent = () => {
const t = useTranslations();
return (
<>
-
-
+
+
-
+
{t("ErrorPage.custom_500")}
@@ -23,8 +23,7 @@ const ServerErrorComponent = () => {
pathname: "/",
}}
>
- {t("ErrorPage.link_routing_back_to")}{" "}
- {t("ErrorPage.link_routing_main_page")}
+ {t("ErrorPage.link_routing_back_to")} {t("ErrorPage.link_routing_main_page")}
diff --git a/src/components/first/Banner.jsx b/src/components/first/Banner.jsx
index 0c4ef35..ee60dcc 100644
--- a/src/components/first/Banner.jsx
+++ b/src/components/first/Banner.jsx
@@ -1,14 +1,18 @@
-import {Box, Container} from "@mui/material";
-import {useConfig} from "@witel/webapp-builder";
+import { Box, Container } from "@mui/material";
+import { useConfig } from "@witel/webapp-builder";
const Banner = () => {
- const {config} = useConfig();
+ const { config } = useConfig();
const bannerHTML = config.banner;
- return (
- {config.banner && config.banner !== "" && (
-
- )}
- );
+ return (
+
+ {config.banner && config.banner !== "" && (
+
+
+
+ )}
+
+ );
};
export default Banner;
diff --git a/src/components/first/FooterDetails.jsx b/src/components/first/FooterDetails.jsx
index f456c14..fa2ba17 100644
--- a/src/components/first/FooterDetails.jsx
+++ b/src/components/first/FooterDetails.jsx
@@ -1,37 +1,39 @@
-import {Box, Button, Container, Grid, Stack, Typography} from "@mui/material";
-import {useTranslations} from "next-intl";
-import {LinkRouting} from "@witel/webapp-builder";
+import { Box, Button, Container, Grid, Stack, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { LinkRouting } from "@witel/webapp-builder";
const FooterDetails = () => {
const t = useTranslations();
return (
-
-
-
+
+
+
- کلیه حقوق محفوظ و متعلق به سازمان راهداری و حمل و نقل جاده ای می
- باشد
+
+ کلیه حقوق محفوظ و متعلق به سازمان راهداری و حمل و نقل جاده ای می باشد
+
-
+
{t("powered_by_witel")}
-
v{process.env.NEXT_PUBLIC_API_VERSION}
@@ -40,6 +42,6 @@ const FooterDetails = () => {
- )
-}
-export default FooterDetails
\ No newline at end of file
+ );
+};
+export default FooterDetails;
diff --git a/src/components/first/HeaderDetails.jsx b/src/components/first/HeaderDetails.jsx
index 5e5f8e9..74d8174 100644
--- a/src/components/first/HeaderDetails.jsx
+++ b/src/components/first/HeaderDetails.jsx
@@ -1,16 +1,16 @@
-import {Box, Button, Container, Grid} from "@mui/material";
+import { Box, Button, Container, Grid } from "@mui/material";
const HeaderDetails = () => {
return (
-
+
- }/>
+ } />
- )
-}
-export default HeaderDetails
\ No newline at end of file
+ );
+};
+export default HeaderDetails;
diff --git a/src/components/first/LoanCondition.jsx b/src/components/first/LoanCondition.jsx
index 5fbe813..ea58bbf 100644
--- a/src/components/first/LoanCondition.jsx
+++ b/src/components/first/LoanCondition.jsx
@@ -1,48 +1,59 @@
-import {Box, Button, Chip, Container, Grid, Link, Typography} from "@mui/material";
-import {useTranslations} from "next-intl";
-import DownloadIcon from '@mui/icons-material/Download';
+import { Box, Button, Chip, Container, Grid, Link, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
+import DownloadIcon from "@mui/icons-material/Download";
const LoanCondition = () => {
const t = useTranslations();
return (
-
+
-
-
- قوانین دریافت وام
-
-
-
-
-
+
+ قوانین دریافت وام
+
+
+
+
-
- این وام برای اتوبوس تا سقف 700 میلیون تومان
- و برای مینی بوس تا سقف 200 میلیون تومان در
- نظر گرفته شده است. مبلغ نهایی با توجه به امتیاز و روند کارشناسی در ادارات مربوطه مشخص
- میشود. برای اطلاع از شرایط کامل این وام فایل پیوست را مطالعه بفرمایید.
+
+ این وام برای اتوبوس تا سقف{" "}
+
+ 700
+ {" "}
+ میلیون تومان و برای مینی بوس تا سقف{" "}
+
+ 200
+ {" "}
+ میلیون تومان در نظر گرفته شده است. مبلغ نهایی با توجه به امتیاز و روند کارشناسی در
+ ادارات مربوطه مشخص میشود. برای اطلاع از شرایط کامل این وام فایل پیوست را مطالعه
+ بفرمایید.
-
+
- }>
+ }>
دریافت فایل های راهنما
@@ -52,6 +63,6 @@ const LoanCondition = () => {
- )
-}
-export default LoanCondition
\ No newline at end of file
+ );
+};
+export default LoanCondition;
diff --git a/src/components/first/LoanDescription/TimeLineDetails.jsx b/src/components/first/LoanDescription/TimeLineDetails.jsx
index ec274bf..ce1f3e2 100644
--- a/src/components/first/LoanDescription/TimeLineDetails.jsx
+++ b/src/components/first/LoanDescription/TimeLineDetails.jsx
@@ -1,37 +1,37 @@
-import {useEffect, useState} from "react";
+import { useEffect, useState } from "react";
import TimelineManager from "@/core/components/timelines/timelineManager";
import moment from "jalali-moment";
-import {Timeline} from "@mui/lab";
-import {useConfig} from "@witel/webapp-builder";
+import { Timeline } from "@mui/lab";
+import { useConfig } from "@witel/webapp-builder";
const TimeLineDetails = () => {
- const {config} = useConfig()
- const [timeLineList, setTimeLineList] = useState([])
+ const { config } = useConfig();
+ const [timeLineList, setTimeLineList] = useState([]);
- const deadlines = Object.keys(config.deadlines).map(key => ({
+ const deadlines = Object.keys(config.deadlines).map((key) => ({
type: key,
- ...config.deadlines[key]
+ ...config.deadlines[key],
}));
useEffect(() => {
- let tempArr = []
+ let tempArr = [];
for (const timeLine of deadlines) {
- let temp = {}
- temp['label'] = timeLine.timeline_label
- temp['date'] = moment(timeLine.date.from, 'jYYYY/jMM/jDD').locale('fa').format('jD jMMMM')
- const fromDate = moment(timeLine.date.from, 'jYYYY/jMM/jDD')
- const toDate = moment(timeLine.date.to, 'jYYYY/jMM/jDD')
- const today = moment()
- if (today.isBetween(fromDate, toDate, null, '[]')) {
- temp['status'] = 'in progress'
+ let temp = {};
+ temp["label"] = timeLine.timeline_label;
+ temp["date"] = moment(timeLine.date.from, "jYYYY/jMM/jDD").locale("fa").format("jD jMMMM");
+ const fromDate = moment(timeLine.date.from, "jYYYY/jMM/jDD");
+ const toDate = moment(timeLine.date.to, "jYYYY/jMM/jDD");
+ const today = moment();
+ if (today.isBetween(fromDate, toDate, null, "[]")) {
+ temp["status"] = "in progress";
} else if (today.isAfter(toDate, null)) {
- temp['status'] = 'done'
+ temp["status"] = "done";
} else if (today.isBefore(fromDate, null)) {
- temp['status'] = 'open'
+ temp["status"] = "open";
}
- tempArr.push(temp)
+ tempArr.push(temp);
}
- setTimeLineList(tempArr)
+ setTimeLineList(tempArr);
}, []);
return (
@@ -43,11 +43,10 @@ const TimeLineDetails = () => {
date={timeLine.date}
primaryLabel={timeLine.label.primary}
secondaryLabel={timeLine.label.secondary}
- position={index === (timeLineList.length - 1) ? 'end' : ''}
+ position={index === timeLineList.length - 1 ? "end" : ""}
/>
- ))
- }
+ ))}
- )
-}
-export default TimeLineDetails
\ No newline at end of file
+ );
+};
+export default TimeLineDetails;
diff --git a/src/components/first/LoanDescription/index.jsx b/src/components/first/LoanDescription/index.jsx
index a0afd67..3a7c211 100644
--- a/src/components/first/LoanDescription/index.jsx
+++ b/src/components/first/LoanDescription/index.jsx
@@ -1,46 +1,55 @@
-import {Box, Container, Grid, Typography} from "@mui/material";
-import {useTranslations} from "next-intl";
+import { Box, Container, Grid, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
import TimeLineDetails from "@/components/first/LoanDescription/TimeLineDetails";
const LoanDescription = () => {
const t = useTranslations();
return (
-
-
+
+
وام نوسازی ناوگان
-
+
-
- این وام براساس تبصره 18 قانون بودجه می باشد. در
- قانون
- بودجه این تبصره اینگونه بیان شده است:
- به منظور رشد و پیشرفت استان های کشور از طریق ارتقای بهره وری و توسعه، سرمایه گذاری ها،
- تکمیل واحدهای نیمه تمام و ظرفیت های خالی بنگاه های تولیدی بر پایه آمایش سرزمین و همچنین
- حمایت از طرح(پروژهای) دانش بنیان و پیشران و بسط و عدالت سرزمینی منابع زیر جهت ایجاد و افزایش
- تولید، اشتغال و کارآفرینی و ارتقای رشد اقتصادی اختصاص می یابد.
+
+ این وام براساس{" "}
+
+ تبصره 18
+ {" "}
+ قانون بودجه می باشد. در قانون بودجه این تبصره اینگونه بیان شده است: به منظور رشد و پیشرفت
+ استان های کشور از طریق ارتقای بهره وری و توسعه، سرمایه گذاری ها، تکمیل واحدهای نیمه تمام و
+ ظرفیت های خالی بنگاه های تولیدی بر پایه آمایش سرزمین و همچنین حمایت از طرح(پروژهای) دانش
+ بنیان و پیشران و بسط و عدالت سرزمینی منابع زیر جهت ایجاد و افزایش تولید، اشتغال و کارآفرینی
+ و ارتقای رشد اقتصادی اختصاص می یابد.
-
+
در این راستا سازمان راهداری و حمل و نقل جاده ای به منظور بهبود کیفیت حمل و نقل بین شهری و
- افزایش ظرفیت ترابری اقدام به اعطای وام به ناوگان های
- مسافربری برای
- بازسازی و تعمیرات میکند.
+ افزایش ظرفیت ترابری اقدام به اعطای وام به{" "}
+
+ ناوگان های مسافربری
+ {" "}
+ برای بازسازی و تعمیرات میکند.
-
+
- )
-}
-export default LoanDescription
\ No newline at end of file
+ );
+};
+export default LoanDescription;
diff --git a/src/components/first/LoanRegister.jsx b/src/components/first/LoanRegister.jsx
index 810c5da..d5c7a47 100644
--- a/src/components/first/LoanRegister.jsx
+++ b/src/components/first/LoanRegister.jsx
@@ -1,20 +1,20 @@
-import {Box, Container, Grid, Stack, Typography} from "@mui/material";
-import {useTranslations} from "next-intl";
-import {LinkRouting} from "@witel/webapp-builder";
+import { Box, Container, Grid, Stack, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { LinkRouting } from "@witel/webapp-builder";
const LoanRegister = () => {
const t = useTranslations();
return (
-
-
-
+
+
+
{t("app_name")}
-
-
+
+
-
-
+
+
وام نوسازی ناوگان به هدف رشد و پیشرفت استان های کشور از طریق ارتقای بهره وری و توسعه
اعطا میشود. برای استفاده از تسهیلات این سامانه و درخواست وام می بایست ابتدا وارد
سامانه شوید.
@@ -22,17 +22,18 @@ const LoanRegister = () => {
-
-
-
-
- {t("firstPage.register_button")}
-
+
+
+
+ {t("firstPage.register_button")}
@@ -41,6 +42,6 @@ const LoanRegister = () => {
- )
-}
-export default LoanRegister
\ No newline at end of file
+ );
+};
+export default LoanRegister;
diff --git a/src/components/first/index.jsx b/src/components/first/index.jsx
index 77214bf..e24b35c 100644
--- a/src/components/first/index.jsx
+++ b/src/components/first/index.jsx
@@ -1,11 +1,11 @@
-import {Stack} from "@mui/material";
-import {useTranslations} from "next-intl";
+import { Stack } from "@mui/material";
+import { useTranslations } from "next-intl";
import LoanRegister from "@/components/first/LoanRegister";
import LoanCondition from "@/components/first/LoanCondition";
import FooterDetails from "@/components/first/FooterDetails";
import HeaderDetails from "@/components/first/HeaderDetails";
import LoanDescription from "@/components/first/LoanDescription";
-import {FullPageLayout} from "@witel/webapp-builder";
+import { FullPageLayout } from "@witel/webapp-builder";
import Banner from "@/components/first/Banner";
const FirstComponent = () => {
@@ -14,12 +14,12 @@ const FirstComponent = () => {
return (
-
-
-
-
-
-
+
+
+
+
+
+
);
diff --git a/src/components/login/SendToken.jsx b/src/components/login/SendToken.jsx
index 85cb0e3..f1e4a01 100644
--- a/src/components/login/SendToken.jsx
+++ b/src/components/login/SendToken.jsx
@@ -1,53 +1,47 @@
import ResendToken from "@/core/components/ResendToken";
import StyledForm from "@/core/components/StyledForm";
-import {LOGIN} from "@/core/data/apiRoutes";
+import { LOGIN } from "@/core/data/apiRoutes";
import ChangeCircleIcon from "@mui/icons-material/ChangeCircle";
import LoginIcon from "@mui/icons-material/Login";
-import {Box, Button, Container, Grid, Paper, Stack, TextField, Typography,} from "@mui/material";
-import {Field, Formik} from "formik";
-import {useTranslations} from "next-intl";
+import { Box, Button, Container, Grid, Paper, Stack, TextField, Typography } from "@mui/material";
+import { Field, Formik } from "formik";
+import { useTranslations } from "next-intl";
import * as Yup from "yup";
import SvgLogin from "@/core/components/svgs/SvgLogin";
import AutoSubmit from "@/core/components/AutoSubmit";
-import {CenterLayout, FullPageLayout, useRequest, useUser} from "@witel/webapp-builder";
+import { CenterLayout, FullPageLayout, useRequest, useUser } from "@witel/webapp-builder";
-const SendTokenComponent = ({
- PhoneNumber,
- setOtpToken,
- timer,
- setTimer,
- initialTimerValue,
- }) => {
+const SendTokenComponent = ({ PhoneNumber, setOtpToken, timer, setTimer, initialTimerValue }) => {
const t = useTranslations();
const requestServer = useRequest();
- const {setToken} = useUser();
+ const { setToken } = useUser();
const initialValues = {
phone_number: PhoneNumber,
verification_code: "",
};
const validationSchema = Yup.object().shape({
- verification_code: Yup.string().required(
- t("LoginPage.error_message_verification_code")
- ),
+ verification_code: Yup.string().required(t("LoginPage.error_message_verification_code")),
});
const handleSubmit = (values, props) => {
requestServer(LOGIN, "post", {
- auth: false, data: {
+ auth: false,
+ data: {
phone_number: values.phone_number,
verification_code: values.verification_code,
- }
+ },
})
.then(function (response) {
setToken(response.data.token);
- }).catch(function (error) {
- props.setSubmitting(false);
- });
+ })
+ .catch(function (error) {
+ props.setSubmitting(false);
+ });
};
return (
-
+
@@ -57,35 +51,32 @@ const SendTokenComponent = ({
validationSchema={validationSchema}
>
{(props) => (
-
-
-
+
+
+
{t("login")}
-
-
+
+
-
+
{t("LoginPage.sent_token_to")}: {PhoneNumber}
}
+ startIcon={}
variant="outlined"
onClick={() => setOtpToken(false)}
- sx={{whiteSpace: "nowrap", my: {xs: 1, sm: 0}}}
+ sx={{ whiteSpace: "nowrap", my: { xs: 1, sm: 0 } }}
>
{t("LoginPage.change_phone_number")}
@@ -95,9 +86,7 @@ const SendTokenComponent = ({
name="verification_code"
variant="outlined"
label={t("LoginPage.text_field_verification_code")}
- placeholder={t(
- "LoginPage.text_field_enter_your_verification_code"
- )}
+ placeholder={t("LoginPage.text_field_enter_your_verification_code")}
value={props.values.verification_code}
type={"tel"}
onChange={(event) => {
@@ -113,7 +102,10 @@ const SendTokenComponent = ({
});
}}
error={
- !!(props.touched.verification_code && props.errors.verification_code)
+ !!(
+ props.touched.verification_code &&
+ props.errors.verification_code
+ )
}
fullWidth
helperText={
@@ -122,7 +114,7 @@ const SendTokenComponent = ({
: null
}
/>
-
+
}
+ endIcon={}
disabled={props.isSubmitting}
>
{t("LoginPage.button_submit")}
diff --git a/src/components/login/SendUserData.jsx b/src/components/login/SendUserData.jsx
index 846f6d8..f5fb1ce 100644
--- a/src/components/login/SendUserData.jsx
+++ b/src/components/login/SendUserData.jsx
@@ -1,22 +1,15 @@
import StyledForm from "@/core/components/StyledForm";
-import {SEND_OTP_TOKEN} from "@/core/data/apiRoutes";
+import { SEND_OTP_TOKEN } from "@/core/data/apiRoutes";
import FingerprintIcon from "@mui/icons-material/Fingerprint";
-import {Button, Container, Grid, Paper, Stack, TextField, Typography,} from "@mui/material";
-import {Field, Formik} from "formik";
-import {useTranslations} from "next-intl";
-import {useSearchParams} from "next/navigation";
+import { Button, Container, Grid, Paper, Stack, TextField, Typography } from "@mui/material";
+import { Field, Formik } from "formik";
+import { useTranslations } from "next-intl";
+import { useSearchParams } from "next/navigation";
import * as Yup from "yup";
import SvgLogin from "@/core/components/svgs/SvgLogin";
-import {CenterLayout, FullPageLayout, LinkRouting, useRequest} from "@witel/webapp-builder";
+import { CenterLayout, FullPageLayout, LinkRouting, useRequest } from "@witel/webapp-builder";
-
-const SendUserDataComponent = ({
- setOtpToken,
- setPhoneNumber,
- PhoneNumber,
- setTimer,
- initialTimerValue,
- }) => {
+const SendUserDataComponent = ({ setOtpToken, setPhoneNumber, PhoneNumber, setTimer, initialTimerValue }) => {
const t = useTranslations();
const requestServer = useRequest();
@@ -30,28 +23,30 @@ const SendUserDataComponent = ({
phone_number: Yup.mixed()
.test("max", `${t("LoginPage.phone_number_max")}`, (value) => {
const stringValue = String(value);
- return stringValue.length === 11
+ return stringValue.length === 11;
})
.required(t("LoginPage.error_message_phone_number")),
});
const handleSubmit = (values, props) => {
requestServer(SEND_OTP_TOKEN, "post", {
- auth: false, data: {
+ auth: false,
+ data: {
phone_number: values.phone_number,
- }
+ },
})
.then(function (response) {
setPhoneNumber(values.phone_number);
setOtpToken(true);
setTimer(initialTimerValue);
- }).catch(function (error) {
- props.setSubmitting(false);
- });
+ })
+ .catch(function (error) {
+ props.setSubmitting(false);
+ });
};
return (
-
+
@@ -61,26 +56,21 @@ const SendUserDataComponent = ({
validationSchema={validationSchema}
>
{(props) => (
-
-
-
+
+
+
{t("Titles.title_login_page")}
-
-
+
+
{
@@ -95,21 +85,17 @@ const SendUserDataComponent = ({
},
});
}}
- error={
- !!(props.touched.phone_number && props.errors.phone_number)
- }
+ error={!!(props.touched.phone_number && props.errors.phone_number)}
fullWidth
helperText={
- props.touched.phone_number
- ? props.errors.phone_number
- : null
+ props.touched.phone_number ? props.errors.phone_number : null
}
/>
}
+ endIcon={}
disabled={props.isSubmitting}
>
{t("LoginPage.button_request_verification")}
@@ -133,10 +119,8 @@ const SendUserDataComponent = ({
{t("LoginPage.link_routing_back_to")}{" "}
{backUrlDecodedPath
diff --git a/src/components/login/index.jsx b/src/components/login/index.jsx
index deaa2cc..adda88c 100644
--- a/src/components/login/index.jsx
+++ b/src/components/login/index.jsx
@@ -1,4 +1,4 @@
-import {useState} from "react";
+import { useState } from "react";
import SendTokenComponent from "./SendToken";
import SendUserDataComponent from "./SendUserData";
diff --git a/src/core/components/AutoSubmit.jsx b/src/core/components/AutoSubmit.jsx
index 9dddfca..84eac12 100644
--- a/src/core/components/AutoSubmit.jsx
+++ b/src/core/components/AutoSubmit.jsx
@@ -1,8 +1,8 @@
-import {useFormikContext} from "formik";
-import {useEffect} from "react";
+import { useFormikContext } from "formik";
+import { useEffect } from "react";
const AutoSubmit = () => {
- const {values, submitForm} = useFormikContext()
+ const { values, submitForm } = useFormikContext();
useEffect(() => {
if (values.verification_code.length === 6) {
submitForm();
diff --git a/src/core/components/Config.jsx b/src/core/components/Config.jsx
index 15f1a31..7048e21 100644
--- a/src/core/components/Config.jsx
+++ b/src/core/components/Config.jsx
@@ -1,35 +1,35 @@
-import {useEffect, useState} from "react";
+import { useEffect, useState } from "react";
import axios from "axios";
-import {GET_CONFIG} from "@/core/data/apiRoutes";
-import {ConfigProvider} from "@witel/webapp-builder";
-import {useRouter} from "next/router";
-import {isValidJson} from "@/core/utils/isValidJson";
+import { GET_CONFIG } from "@/core/data/apiRoutes";
+import { ConfigProvider } from "@witel/webapp-builder";
+import { useRouter } from "next/router";
+import { isValidJson } from "@/core/utils/isValidJson";
-const ConfigApp = ({children}) => {
- const router = useRouter()
- const [error, setError] = useState(false)
- const [config, setConfig] = useState()
+const ConfigApp = ({ children }) => {
+ const router = useRouter();
+ const [error, setError] = useState(false);
+ const [config, setConfig] = useState();
useEffect(() => {
const fetchConfig = async () => {
try {
- const response = await axios(GET_CONFIG)
- let _config = {}
- response.data.data.forEach(item => {
- _config[item.name] = isValidJson(item.value) ? JSON.parse(item.value) : item.value
- })
- setConfig(_config)
+ const response = await axios(GET_CONFIG);
+ let _config = {};
+ response.data.data.forEach((item) => {
+ _config[item.name] = isValidJson(item.value) ? JSON.parse(item.value) : item.value;
+ });
+ setConfig(_config);
} catch (error) {
- setError(true)
+ setError(true);
}
- }
-
- fetchConfig()
+ };
+ fetchConfig();
}, [router]);
return (
- {error ? <>Error request config> : config && children})
-}
+ {error ? <>Error request config> : config && children}
+ );
+};
-export default ConfigApp
\ No newline at end of file
+export default ConfigApp;
diff --git a/src/core/components/GlobalHead.jsx b/src/core/components/GlobalHead.jsx
index 002199d..966d207 100644
--- a/src/core/components/GlobalHead.jsx
+++ b/src/core/components/GlobalHead.jsx
@@ -3,46 +3,26 @@ import Head from "next/head";
const GlobalHead = () => {
return (
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
- )
-}
+ );
+};
-export default GlobalHead
\ No newline at end of file
+export default GlobalHead;
diff --git a/src/core/components/LegalPersonDatePicker.jsx b/src/core/components/LegalPersonDatePicker.jsx
index de5f006..7e6381e 100644
--- a/src/core/components/LegalPersonDatePicker.jsx
+++ b/src/core/components/LegalPersonDatePicker.jsx
@@ -24,8 +24,7 @@ function ButtonField(props) {
sx={{ width: "100%", padding: 0.8 }}
variant="outlined"
color={
- props.slotProps.formik.touched.company_date &&
- Boolean(props.slotProps.formik.errors.company_date)
+ props.slotProps.formik.touched.company_date && Boolean(props.slotProps.formik.errors.company_date)
? "error"
: "primary"
}
@@ -51,9 +50,7 @@ function ButtonDatePicker(props) {
formik: props.formik,
field: { setOpen },
textField: {
- helperText: props.formik.errors.company_date
- ? `${t("company_date")}`
- : null,
+ helperText: props.formik.errors.company_date ? `${t("company_date")}` : null,
},
}}
{...props}
@@ -80,11 +77,7 @@ const LegalPersonDatePicker = ({ formik, disabled }) => {
formik.values.company_date !== "" &&
formik.values.company_date?.locale("fa").format("YYYY/MM/DD")
}
- value={
- formik.values.company_date !== ""
- ? formik.values.company_date?.toDate()
- : null
- }
+ value={formik.values.company_date !== "" ? formik.values.company_date?.toDate() : null}
formik={formik}
disabled={disabled}
onChange={(newValue) => {
@@ -92,10 +85,8 @@ const LegalPersonDatePicker = ({ formik, disabled }) => {
}}
/>
-
- {formik.touched.company_date && formik.errors.company_date}
-
+ {formik.touched.company_date && formik.errors.company_date}
);
-}
-export default LegalPersonDatePicker
\ No newline at end of file
+};
+export default LegalPersonDatePicker;
diff --git a/src/core/components/PasswordField.jsx b/src/core/components/PasswordField.jsx
index d109b73..9aa4197 100644
--- a/src/core/components/PasswordField.jsx
+++ b/src/core/components/PasswordField.jsx
@@ -1,7 +1,7 @@
-import {useState} from "react";
-import {IconButton, InputAdornment, TextField} from "@mui/material";
-import {Visibility, VisibilityOff} from "@mui/icons-material";
-import {Field} from "formik";
+import { useState } from "react";
+import { IconButton, InputAdornment, TextField } from "@mui/material";
+import { Visibility, VisibilityOff } from "@mui/icons-material";
+import { Field } from "formik";
const PasswordField = (props) => {
const [showPassword, setShowPassword] = useState(false);
@@ -21,7 +21,7 @@ const PasswordField = (props) => {
endAdornment: (
- {showPassword ? : }
+ {showPassword ? : }
),
diff --git a/src/core/components/PlateNumber.jsx b/src/core/components/PlateNumber.jsx
index 8bafa0f..1ff78df 100644
--- a/src/core/components/PlateNumber.jsx
+++ b/src/core/components/PlateNumber.jsx
@@ -1,215 +1,216 @@
-import {Box, Button, Drawer, FormHelperText, Stack, TextField} from "@mui/material";
-import {useTranslations} from "next-intl";
-import AccessibleIcon from '@mui/icons-material/Accessible';
-import {useState} from "react";
+import { Box, Button, Drawer, FormHelperText, Stack, TextField } from "@mui/material";
+import { useTranslations } from "next-intl";
+import AccessibleIcon from "@mui/icons-material/Accessible";
+import { useState } from "react";
const plate_words = [
{
id: 1,
value: "الف",
- name: "الف"
+ name: "الف",
},
{
id: 2,
value: "ب",
- name: "ب"
+ name: "ب",
},
{
id: 3,
value: "پ",
- name: "پ"
+ name: "پ",
},
{
id: 4,
value: "ت",
- name: "ت"
+ name: "ت",
},
{
id: 5,
value: "ث",
- name: "ث"
+ name: "ث",
},
{
id: 6,
value: "ج",
- name: "ج"
+ name: "ج",
},
{
id: 7,
value: "د",
- name: "د"
+ name: "د",
},
{
id: 8,
value: "ز",
- name: "ز"
+ name: "ز",
},
{
id: 9,
value: "س",
- name: "س"
+ name: "س",
},
{
id: 10,
value: "ش",
- name: "ش"
+ name: "ش",
},
{
id: 11,
value: "ص",
- name: "ص"
+ name: "ص",
},
{
id: 12,
value: "ط",
- name: "ط"
+ name: "ط",
},
{
id: 13,
value: "ع",
- name: "ع"
+ name: "ع",
},
{
id: 14,
value: "ف",
- name: "ف"
+ name: "ف",
},
{
id: 15,
value: "ق",
- name: "ق"
+ name: "ق",
},
{
id: 16,
value: "ک",
- name: "گ"
+ name: "گ",
},
{
id: 17,
value: "ل",
- name: "ل"
+ name: "ل",
},
{
id: 18,
value: "م",
- name: "م"
+ name: "م",
},
{
id: 19,
value: "ن",
- name: "ن"
+ name: "ن",
},
{
id: 20,
value: "و",
- name: "و"
+ name: "و",
},
{
id: 21,
value: "ه",
- name: "ه"
+ name: "ه",
},
{
id: 22,
value: "ی",
- name: "ی"
+ name: "ی",
},
{
id: 23,
value: "*",
- name:
+ name: ,
},
-]
-const PlateNumber = ({formik, disabled}) => {
+];
+const PlateNumber = ({ formik, disabled }) => {
const t = useTranslations();
const [plateDrawer, setPlateDrawer] = useState(false);
- const isErrorPlate = Boolean(formik.errors.plate_part1 || formik.errors.plate_part3 || formik.errors.plate_part4)
- const isTouched = (formik.touched.plate_part1 || formik.touched.plate_part3 || formik.touched.plate_part4)
+ const isErrorPlate = Boolean(formik.errors.plate_part1 || formik.errors.plate_part3 || formik.errors.plate_part4);
+ const isTouched = formik.touched.plate_part1 || formik.touched.plate_part3 || formik.touched.plate_part4;
return (
<>
-
+
{
if (isNaN(Number(event.target.value))) {
return;
}
- event.target.value.length <= 2 ? formik.setFieldValue("plate_part4", event.target.value) : null
+ event.target.value.length <= 2 ? formik.setFieldValue("plate_part4", event.target.value) : null;
}}
onBlur={formik.handleBlur}
error={formik.touched.plate_part4 && Boolean(formik.errors.plate_part4)}
/>
{
if (isNaN(Number(event.target.value))) {
return;
}
- event.target.value.length <= 3 ? formik.setFieldValue("plate_part3", event.target.value) : null
+ event.target.value.length <= 3 ? formik.setFieldValue("plate_part3", event.target.value) : null;
}}
onBlur={formik.handleBlur}
error={formik.touched.plate_part3 && Boolean(formik.errors.plate_part3)}
/>
-
+
setPlateDrawer(true)}
- sx={{height: '100%', borderRadius: 0, borderColor: 'divider'}}
- size={'small'}
+ sx={{ height: "100%", borderRadius: 0, borderColor: "divider" }}
+ size={"small"}
data-selected-word={formik.values.plate_part2}
disabled={disabled}
fullWidth
>
- {plate_words.find(p => p.value === formik.values.plate_part2)?.name}
+ {plate_words.find((p) => p.value === formik.values.plate_part2)?.name}
- setPlateDrawer(false)}
- >
-
+ setPlateDrawer(false)}>
+
{plate_words.map((item) => (
{
- formik.setFieldValue("plate_part2", item.value)
+ formik.setFieldValue("plate_part2", item.value);
setPlateDrawer(false);
}}
sx={{
- width: "fit-content"
+ width: "fit-content",
}}
variant="contained"
>
@@ -219,33 +220,33 @@ const PlateNumber = ({formik, disabled}) => {
{
if (isNaN(Number(event.target.value))) {
return;
}
- event.target.value.length <= 2 ? formik.setFieldValue("plate_part1", event.target.value) : null
+ event.target.value.length <= 2 ? formik.setFieldValue("plate_part1", event.target.value) : null;
}}
onBlur={formik.handleBlur}
error={true}
/>
-
-
-
-
+
+
+
+
- {(isTouched && isErrorPlate) ? `${t("LoanRequest.error_message_plate_number")}` : null}
+
+ {isTouched && isErrorPlate ? `${t("LoanRequest.error_message_plate_number")}` : null}
+
>
-
- )
-}
-export default PlateNumber
\ No newline at end of file
+ );
+};
+export default PlateNumber;
diff --git a/src/core/components/ResendToken.jsx b/src/core/components/ResendToken.jsx
index 2216c99..6ca6ee5 100644
--- a/src/core/components/ResendToken.jsx
+++ b/src/core/components/ResendToken.jsx
@@ -1,12 +1,12 @@
-import {Button} from "@mui/material";
-import {useTranslations} from "next-intl";
-import {useEffect} from "react";
-import {LOGIN, SEND_OTP_TOKEN} from "../data/apiRoutes";
-import {useDirection, useRequest} from "@witel/webapp-builder";
+import { Button } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { useEffect } from "react";
+import { LOGIN, SEND_OTP_TOKEN } from "../data/apiRoutes";
+import { useDirection, useRequest } from "@witel/webapp-builder";
-const ResendToken = ({initialTimerValue, timer, setTimer, PhoneNumber, disabled}) => {
+const ResendToken = ({ initialTimerValue, timer, setTimer, PhoneNumber, disabled }) => {
const t = useTranslations();
- const {directionApp} = useDirection();
+ const { directionApp } = useDirection();
const requestServer = useRequest();
// Countdown Timer
useEffect(() => {
@@ -27,14 +27,15 @@ const ResendToken = ({initialTimerValue, timer, setTimer, PhoneNumber, disabled}
const handleResendClick = () => {
if (timer != 0) return;
requestServer(SEND_OTP_TOKEN, "post", {
- auth: false, data: {
+ auth: false,
+ data: {
phone_number: PhoneNumber,
- }
+ },
})
.then(function (response) {
setTimer(initialTimerValue);
- }).catch(function (error) {
- });
+ })
+ .catch(function (error) {});
};
// End Handle Resend Token
@@ -44,16 +45,15 @@ const ResendToken = ({initialTimerValue, timer, setTimer, PhoneNumber, disabled}
- {t("Resend_code_in")} {timer} {" "}
- {t("seconds_later")}
+ {t("Resend_code_in")} {timer} {t("seconds_later")}
) : (
diff --git a/src/core/components/SelectBox.jsx b/src/core/components/SelectBox.jsx
index e9fb2e0..133258f 100644
--- a/src/core/components/SelectBox.jsx
+++ b/src/core/components/SelectBox.jsx
@@ -1,31 +1,24 @@
-import {FormControl, FormHelperText, InputLabel, MenuItem, Select,} from "@mui/material";
-import {useTranslations} from "next-intl";
+import { FormControl, FormHelperText, InputLabel, MenuItem, Select } from "@mui/material";
+import { useTranslations } from "next-intl";
function SelectBox({
- select,
- name,
- selectors,
- label,
- handleChange,
- error,
- onBlur,
- schema,
- disabled,
- helperText,
- isLoading,
- errorEcured,
- variant = "outlined"
- }) {
+ select,
+ name,
+ selectors,
+ label,
+ handleChange,
+ error,
+ onBlur,
+ schema,
+ disabled,
+ helperText,
+ isLoading,
+ errorEcured,
+ variant = "outlined",
+}) {
const t = useTranslations();
-
return (
-
+
{label}
+ ) : (
+ ""
+ )}
+ {helperText}
);
};
diff --git a/src/core/components/svgs/Svg403.jsx b/src/core/components/svgs/Svg403.jsx
index 720828c..226a2ae 100644
--- a/src/core/components/svgs/Svg403.jsx
+++ b/src/core/components/svgs/Svg403.jsx
@@ -1,131 +1,295 @@
-import {useTheme} from "@mui/material";
+import { useTheme } from "@mui/material";
-const Svg403 = ({width, height}) => {
- const theme = useTheme()
- const fillColor = theme.palette.primary.main
+const Svg403 = ({ width, height }) => {
+ const theme = useTheme();
+ const fillColor = theme.palette.primary.main;
return (
-