diff --git a/example.env.local b/example.env.local index c547e86..70baea3 100644 --- a/example.env.local +++ b/example.env.local @@ -1,5 +1,5 @@ NEXT_PUBLIC_API_NAME = "Loan Facilities Dashboard" -NEXT_PUBLIC_API_VERSION = "1.25.2" +NEXT_PUBLIC_API_VERSION = "1.25.4" NEXT_PUBLIC_DEFAULT_LANGUAGE = "fa" NEXT_PUBLIC_DEFAULT_DIRECTION = "rtl" @@ -9,4 +9,6 @@ NEXT_PUBLIC_SECONDARY_MAIN = "#FF4E00" NEXT_PUBLIC_BASE_URL = "https://loan.witel.ir" NEXT_PUBLIC_POWERED_BY_URL = "https://witel.ir" +NEXT_PUBLIC_CONFIG_APP_URL = "http://localhost:3000/config.json" + NODE_ENV = "development" \ No newline at end of file diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index c6999fb..0785888 100644 --- a/public/locales/fa/app.json +++ b/public/locales/fa/app.json @@ -75,7 +75,8 @@ "dashboard": "داشبورد", "add-request-loan": "درخواست وام", "followUp-loan": "پیگیری درخواست", - "edit-request-loan": "ویرایش درخواست وام" + "edit-request-loan": "ویرایش درخواست وام", + "show": "نمایش" }, "Authorization": { "typography_your_login_is_valid_and_you_do_not_need_to_login_again": "شما دسترسی لازم به این صفحه را دارید نیاز به ورود مجدد نیست.", @@ -98,7 +99,8 @@ "button_make_account": "ایجاد حساب", "button_request_verification": "دریافت کد یکبارمصرف", "sent_token_to": "ارسال کد یکبار مصرف به شماره", - "change_phone_number": "تغییر شماره" + "change_phone_number": "تغییر شماره", + "phone_number_max": "شماره تلفن می بایست 11 رقم باشد" }, "RegisterPage": { "link_routing_back_to": "بازگشت به", @@ -210,6 +212,50 @@ "error_message_city_id": "لطفا شهر خود را وارد کنید!", "add_loan_request_permission": "اکنون امکان ثبت درخواست جدید برای شما مقدور نیست" }, + "ShowLoan": { + "show_loan_page": "نمایش وام | ناوگان", + "loading_show_component": "درحال دریافت اطلاعات درخواست...", + "tel_number_max": "شماره ثابت می بایست 11 رقم باشد", + "text_field_national_id": "کد ملی", + "text_field_postal_code": "کد پستی", + "text_field_national_serial_number": "سریال پشت کارت ملی", + "text_field_address": "آدرس", + "text_field_birthday": "تاریخ تولد", + "text_field_navgan_id": "کد ناوگان", + "text_field_province_id": "استان", + "text_field_education_id": "تحصیلات", + "text_field_occupation_id": "شغل", + "text_field_name": "نام کامل مالک", + "text_field_navgan_type": "نوع ناوگان", + "text_field_vehicle_type": "نوع وسیله", + "text_field_tel_number": "شماره ثابت (با پیش شماره استان)", + "text_field_enter_your_national_id": "کد ملی را وارد کنید", + "text_field_enter_your_postal_code": "کد پستی را وارد کنید", + "text_field_enter_your_national_serial_number": "سریال پشت کارت ملی را وارد کنید", + "text_field_enter_your_address": "آدرس را وارد کنید", + "text_field_enter_your_tel_number": "شماره ثابت (با پیش شماره استان) خود را وارد کنید", + "text_field_enter_your_birthday": "تاریخ تولد را وارد کنید", + "text_field_enter_your_navgan_id": "کد ناوگان را وارد کنید", + "text_field_enter_your_name": "نام کامل مالک را وارد کنید", + "postal_code_max": "کد پستی می بایست 10 رقم باشد", + "error_message_postal_code": "لطفا کد پستی را وارد کنید!", + "error_message_national_serial_number": "لطفا سریال پشت کارت ملی را وارد کنید!", + "error_message_address": "لطفا آدرس را وارد کنید!", + "error_message_birthday": "لطفا تاریخ تولد را وارد کنید!", + "error_message_navgan_id": "لطفا کد ناوگان را وارد کنید!", + "error_message_province_id": "لطفا استان را وارد کنید!", + "error_message_city_id": "لطفا شهر خود را وارد کنید!", + "error_message_name": "لطفا نام کامل مالک را وارد کنید!", + "error_message_date_of_birth": "لطفا تاریخ تولد خود را وارد کنید!", + "error_message_navgan_type": "لطفا نوع ناوگان را وارد کنید!", + "error_message_vehicle_type": "لطفا نوع وسیله را وارد کنید!", + "error_message_fixed_number": "لطفا تلفن ثابت را وارد کنید!", + "error_message_tel_number": "لطفا شماره ثابت (با پیش شماره استان) خود را وارد کنید!", + "error_message_occupation_id": "لطفا کد شغل (با توجه به مستندات ارائه شده) را به درستی وارد کنید!", + "error_message_education_id": "لطفا تحصیلات (با توجه به مستندات ارائه شده) را به درستی وارد کنید!", + "cityList_empty": "شهر یافت نشد", + "button_submit": "ویرایش" + }, "EditLoanRequest": { "edit_loan_request_page": "ویرایش درخواست وام" } 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 6d9f9bc..3392286 100644 --- a/src/components/dashboard/navgan/add-request-loan/forms/AddForm.jsx +++ b/src/components/dashboard/navgan/add-request-loan/forms/AddForm.jsx @@ -16,6 +16,7 @@ import DoneIcon from '@mui/icons-material/Done'; import {NextLinkComposed} from "@witel/webapp-builder/dist/utils/linkRouting"; import SvgDone from "@/core/components/svgs/SvgDone"; import {SEND_LOAN_REQUEST_NAVGAN} from "@/core/data/apiRoutes"; +import moment from "jalali-moment"; const AddFormComponent = () => { const t = useTranslations(); @@ -42,7 +43,7 @@ const AddFormComponent = () => { plate_part3: "", plate_part4: "", address: "", - birthday: "", + birthday: moment(), education_id: "", occupation_id: "", checkedBox: false @@ -169,9 +170,21 @@ const AddFormComponent = () => { name="national_id" variant="outlined" size="small" + value={formik.values.national_id} inputProps={{inputMode: 'numeric', pattern: '[0-9]*'}} type={'tel'} - onChange={formik.handleChange} + onChange={(event) => { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "national_id", + value: inputValue, + }, + }); + }} label={t("LoanRequest.text_field_national_code")} placeholder={t( "LoanRequest.text_field_enter_your_national_code" @@ -189,6 +202,7 @@ const AddFormComponent = () => { name="national_serial_number" variant="outlined" size="small" + value={formik.values.national_serial_number} label={t("LoanRequest.text_field_shenasname_serial")} placeholder={t( "LoanRequest.text_field_enter_your_shenasname_serial")} @@ -214,9 +228,21 @@ const AddFormComponent = () => { sx={{width: "100%"}} name="postal_code" variant="outlined" + value={formik.values.postal_code} inputProps={{inputMode: 'numeric', pattern: '[0-9]*'}} type={'tel'} - onChange={formik.handleChange} + onChange={(event) => { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "postal_code", + value: inputValue, + }, + }); + }} size="small" label={t("LoanRequest.text_field_postal_code")} placeholder={t("LoanRequest.text_field_enter_your_postal_code")} @@ -264,6 +290,7 @@ const AddFormComponent = () => { name="navgan_type" label={t("LoanRequest.text_field_navgan_type")} size="small" + value={formik.values.navgan_type} selectType="navgan_type" selectors={[ { @@ -300,6 +327,7 @@ const AddFormComponent = () => { variant="outlined" inputProps={{inputMode: 'numeric', pattern: '[0-9]*'}} type={'tel'} + value={formik.values.navgan_id} onChange={formik.handleChange} size="small" label={t("LoanRequest.text_field_navgan_id")} @@ -323,6 +351,7 @@ const AddFormComponent = () => { selectors={provinceList} schema={{value: 'value', name: 'name'}} select={formik.values.province_id} + value={formik.values.province_id} handleChange={(event) => { formik.setFieldValue('province_id', event.target.value); setProvinceID(event.target.value) @@ -345,6 +374,7 @@ const AddFormComponent = () => { disabled={cityList.length === 0} selectors={cityList} select={formik.values.city_id} + value={formik.values.city_id} handleChange={(event) => formik.setFieldValue('city_id', event.target.value)} setFieldTouched={formik.setFieldTouched} error={formik.touched.city_id && Boolean(formik.errors.city_id)} @@ -359,6 +389,7 @@ const AddFormComponent = () => { name="vehicle_type" label={t("LoanRequest.text_field_vehicle_type")} size="small" + value={formik.values.vehicle_type} schema={{value: 'value', name: 'name'}} selectType="vehicle_type" selectors={[ @@ -400,6 +431,7 @@ const AddFormComponent = () => { selectType="education_id" selectors={educationsList} select={formik.values.education_id} + value={formik.values.education_id} schema={{value: 'id', name: 'title'}} handleChange={(event) => { formik.setFieldValue('education_id', event.target.value) @@ -421,6 +453,7 @@ const AddFormComponent = () => { schema={{value: 'id', name: 'title'}} selectors={occupationsList} select={formik.values.occupation_id} + value={formik.values.occupation_id} handleChange={(event) => { formik.setFieldValue('occupation_id', event.target.value) }} @@ -443,6 +476,7 @@ const AddFormComponent = () => { label={t("LoanRequest.text_field_address")} placeholder={t("LoanRequest.text_field_enter_your_address")} fullWidth + value={formik.values.address} onChange={formik.handleChange} onBlur={formik.handleBlur("address")} error={formik.touched.address && Boolean(formik.errors.address)} diff --git a/src/components/dashboard/navgan/add-request-loan/index.jsx b/src/components/dashboard/navgan/add-request-loan/index.jsx index 395ede7..3e4cf0c 100644 --- a/src/components/dashboard/navgan/add-request-loan/index.jsx +++ b/src/components/dashboard/navgan/add-request-loan/index.jsx @@ -1,6 +1,7 @@ import {Box, Chip, Divider} from "@mui/material"; import {useTranslations} from "next-intl"; import AddFormComponent from "@/components/dashboard/navgan/add-request-loan/forms/AddForm"; +import {CenterLayout, useUser} from "@witel/webapp-builder"; const LoanRequestComponent = () => { const t = useTranslations(); diff --git a/src/components/dashboard/navgan/show/form/UpdateForm.jsx b/src/components/dashboard/navgan/show/form/UpdateForm.jsx new file mode 100644 index 0000000..871c9a2 --- /dev/null +++ b/src/components/dashboard/navgan/show/form/UpdateForm.jsx @@ -0,0 +1,683 @@ +import StyledForm from "@/core/components/StyledForm"; +import {Box, Button, Chip, Divider, Stack, TextField} from "@mui/material"; +import {Field, Formik} from "formik"; +import {useTranslations} from "next-intl"; +import EditIcon from '@mui/icons-material/Edit'; +import * as Yup from "yup"; +import SelectBox from "@/core/components/SelectBox"; +import PlateNumber from "@/core/components/PlateNumber"; +import MuiDatePicker from "@/core/components/MuiDatePicker"; +import moment from "jalali-moment"; +import useProvince from "@/lib/app/hooks/useProvince"; +import useCities from "@/lib/app/hooks/useCities"; +import UseEducations from "@/lib/app/hooks/useEducations"; +import useOccupations from "@/lib/app/hooks/useOccupations"; +import {UPDATE_LOAN} from "@/core/data/apiRoutes"; +import {useRequest} from "@witel/webapp-builder"; +import {useRouter} from "next/router"; +import {useEffect} from "react"; + +const UpdateForm = ({LoanDetails, LoanId}) => { + const t = useTranslations(); + const provinceStates = useProvince(); + const router = useRouter() + const citiesStates = useCities(); + const educationStates = UseEducations(); + const occupationStates = useOccupations(); + const requestServer = useRequest(); + + // initial values + const initialValues = { + national_id: LoanDetails.national_id, + postal_code: LoanDetails.postal_code, + national_serial_number: LoanDetails.national_serial_number, + address: LoanDetails.address, + birthday: moment(LoanDetails.birthday), + navgan_id: LoanDetails.navgan_id, + province_id: LoanDetails.province_id, + city_id: LoanDetails.city_id, + name: LoanDetails.name, + navgan_type: LoanDetails.navgan_type, + vehicle_type: LoanDetails.vehicle_type, + telephone_number: LoanDetails.telephone_number, + plate_part1: LoanDetails.plate_number.split("-")[0], + plate_part2: LoanDetails.plate_number.split("-")[1], + plate_part3: LoanDetails.plate_number.split("-")[2], + plate_part4: LoanDetails.plate_number.split("-")[3], + education_id: LoanDetails.education_id, + occupation_id: LoanDetails.occupation_id, + }; + // end initial values + + useEffect(() => { + citiesStates.setProvinceID(LoanDetails.province_id) + }, [LoanDetails.province_id]); + + // validation + const validationSchema = Yup.object().shape({ + postal_code: Yup.mixed() + .test("max", `${t("ShowLoan.postal_code_max")}`, (value) => value.toString().length === 10) + .required( + t("ShowLoan.error_message_postal_code") + ), + address: Yup.string().required(t("ShowLoan.error_message_address")), + province_id: Yup.string().required(t("ShowLoan.error_message_province_id")), + city_id: Yup.string().required(t("ShowLoan.error_message_city_id")), + telephone_number: Yup.mixed() + .test("max", `${t("ShowLoan.tel_number_max")}`, (value) => { + const stringValue = String(value); + return stringValue.length === 11 + }) + .required(t("ShowLoan.error_message_tel_number")), + occupation_id: Yup.string().required(t("ShowLoan.error_message_occupation_id")), + education_id: Yup.string().required(t("ShowLoan.error_message_education_id")), + birthday: Yup.string().required(t("ShowLoan.error_message_date_of_birth")), + national_serial_number: Yup.string().required(t("ShowLoan.error_message_national_serial_number")), + + }); + // end validation + + // submit + const handleSubmit = async (values, props) => { + props.setSubmitting(true) + const formData = new FormData(); + formData.append("postal_code", values.postal_code); + formData.append("address", values.address); + formData.append("province_id", values.province_id); + formData.append("city_id", values.city_id); + formData.append("telephone_number", values.telephone_number); + formData.append("occupation_id", values.occupation_id); + formData.append("education_id", values.education_id); + formData.append("national_serial_number", values.national_serial_number); + formData.append("birthday", values.birthday.locale('en').format("YYYY-MM-DD")); + await requestServer(UPDATE_LOAN + LoanId, "post", { + auth: true, notification: true, data: formData + }).then(() => { + router.push("/dashboard/navgan/followUp-loan") + }).catch(() => { + }).finally(() => { + props.setSubmitting(false) + }) + + }; + // end submit + + return ( + <> + + + + + + + {(props) => ( + + + + + + + + + + + + + + + + + { + props.setFieldValue('navgan_type', event.target.value) + }} + setFieldTouched={props.setFieldTouched} + error={props.touched.navgan_type && Boolean(props.errors.navgan_type)} + helperText={props.touched.navgan_type && props.errors.navgan_type} + onBlur={props.handleBlur("navgan_type")} + /> + + + + + + + + props.setFieldValue('vehicle_type', event.target.value)} + error={props.touched.vehicle_type && Boolean(props.errors.vehicle_type)} + helperText={props.touched.vehicle_type && props.errors.vehicle_type} + onBlur={props.handleBlur("vehicle_type")} + /> + + + + + + + + + + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + props.handleChange({ + target: { + name: "postal_code", + value: inputValue, + }, + }); + }} + error={!!(props.touched.postal_code && props.errors.postal_code)} + fullWidth + helperText={ + props.touched.postal_code + ? props.errors.postal_code + : null + } + /> + + + + + {provinceStates.provinceList.length !== 0 ? + { + props.setFieldValue('province_id', event.target.value); + citiesStates.setProvinceID(event.target.value) + props.setFieldTouched("city_id", false, false); + props.setFieldValue("city_id", "") + }} + setFieldTouched={props.setFieldTouched} + error={props.touched.province_id && Boolean(props.errors.province_id)} + helperText={props.touched.province_id && props.errors.province_id} + onBlur={props.handleBlur("province_id")} + /> : } + + + + {citiesStates.cityList.length !== 0 ? + props.setFieldValue('city_id', event.target.value)} + setFieldTouched={props.setFieldTouched} + error={props.touched.city_id && Boolean(props.errors.city_id)} + helperText={props.touched.city_id && props.errors.city_id} + onBlur={props.handleBlur("city_id")} + /> : } + + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + props.handleChange({ + target: { + name: "telephone_number", + value: inputValue, + }, + }); + }} + label={t("ShowLoan.text_field_tel_number")} + placeholder={t( + "ShowLoan.text_field_enter_your_tel_number" + )} + fullWidth + onBlur={props.handleBlur("telephone_number")} + error={props.touched.telephone_number && Boolean(props.errors.telephone_number)} + helperText={props.touched.telephone_number && props.errors.telephone_number} + /> + + + + + {educationStates.educationsList.length !== 0 ? + { + props.setFieldValue('education_id', event.target.value) + }} + setFieldTouched={props.setFieldTouched} + error={props.touched.education_id && Boolean(props.errors.education_id)} + helperText={props.touched.education_id && props.errors.education_id} + onBlur={props.handleBlur("education_id")} + /> : } + + + {occupationStates.occupationsList.length !== 0 ? + { + props.setFieldValue('occupation_id', event.target.value) + }} + setFieldTouched={props.setFieldTouched} + error={props.touched.occupation_id && Boolean(props.errors.occupation_id)} + helperText={props.touched.occupation_id && props.errors.occupation_id} + onBlur={props.handleBlur("occupation_id")} + /> : } + + + + + + + + + + + + + )} + + + ); +}; + +export default UpdateForm; diff --git a/src/components/dashboard/navgan/show/form/index.jsx b/src/components/dashboard/navgan/show/form/index.jsx new file mode 100644 index 0000000..7a6f74a --- /dev/null +++ b/src/components/dashboard/navgan/show/form/index.jsx @@ -0,0 +1,35 @@ +import UpdateForm from "@/components/dashboard/navgan/show/form/UpdateForm"; +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"; + +const ShowLoanForm = () => { + const t = useTranslations(); + 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(() => { + }) + }, []); + + if (Object.keys(LoanDetails).length === 0) { + return ( + + + {t("ShowLoan.loading_show_component")} + + ); + } + return ( + + ); +}; + +export default ShowLoanForm; diff --git a/src/components/dashboard/navgan/show/index.jsx b/src/components/dashboard/navgan/show/index.jsx new file mode 100644 index 0000000..b9c73ed --- /dev/null +++ b/src/components/dashboard/navgan/show/index.jsx @@ -0,0 +1,16 @@ +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(); + + return ( + + + + ); +}; + +export default ShowLoan; diff --git a/src/components/login/SendUserData.jsx b/src/components/login/SendUserData.jsx index 1f48025..19c7498 100644 --- a/src/components/login/SendUserData.jsx +++ b/src/components/login/SendUserData.jsx @@ -27,7 +27,12 @@ const SendUserDataComponent = ({ phone_number: PhoneNumber, }; const validationSchema = Yup.object().shape({ - phone_number: Yup.string().required(t("LoginPage.error_message_phone_number")), + phone_number: Yup.mixed() + .test("max", `${t("LoginPage.phone_number_max")}`, (value) => { + const stringValue = String(value); + return stringValue.length === 11 + }) + .required(t("LoginPage.error_message_phone_number")), }); const handleSubmit = (values, props) => { @@ -76,7 +81,19 @@ const SendUserDataComponent = ({ placeholder={t( "LoginPage.text_field_enter_your_phone_number" )} - type={"text"} + type={"tel"} + onChange={(event) => { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + props.handleChange({ + target: { + name: "phone_number", + value: inputValue, + }, + }); + }} error={ !!(props.touched.phone_number && props.errors.phone_number) } diff --git a/src/core/components/MuiDatePicker.jsx b/src/core/components/MuiDatePicker.jsx index accc7af..95df9e3 100644 --- a/src/core/components/MuiDatePicker.jsx +++ b/src/core/components/MuiDatePicker.jsx @@ -69,10 +69,10 @@ export default function PickerWithButtonField({formik, disabled}) { > { diff --git a/src/core/components/PlateNumber.jsx b/src/core/components/PlateNumber.jsx index 5d28fcb..85f38ae 100644 --- a/src/core/components/PlateNumber.jsx +++ b/src/core/components/PlateNumber.jsx @@ -142,7 +142,12 @@ const PlateNumber = ({formik, disabled}) => { size={'small'} placeholder={'xx'} sx={{flexGrow: 2, "& fieldset": {border: 'none'}}} inputProps={{sx: {textAlign: 'center'}}} - onChange={(event) => event.target.value.length <= 2 ? formik.setFieldValue("plate_part4", event.target.value) : null} + onChange={(event) => { + if (isNaN(Number(event.target.value))) { + return; + } + 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)} /> @@ -161,7 +166,12 @@ const PlateNumber = ({formik, disabled}) => { "& fieldset": {border: 'none'} }} inputProps={{sx: {textAlign: 'center'}}} - onChange={(event) => event.target.value.length <= 3 ? formik.setFieldValue("plate_part3", event.target.value) : null} + onChange={(event) => { + if (isNaN(Number(event.target.value))) { + return; + } + 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)} /> @@ -217,7 +227,12 @@ const PlateNumber = ({formik, disabled}) => { placeholder={'xx'} sx={{flexGrow: 2, "& fieldset": {border: 'none'}}} inputProps={{sx: {textAlign: 'center'}}} - onChange={(event) => event.target.value.length <= 2 ? formik.setFieldValue("plate_part1", event.target.value) : null} + onChange={(event) => { + if (isNaN(Number(event.target.value))) { + return; + } + event.target.value.length <= 2 ? formik.setFieldValue("plate_part1", event.target.value) : null + }} onBlur={formik.handleBlur} error={true} /> diff --git a/src/core/components/SelectBox.jsx b/src/core/components/SelectBox.jsx index 0ee7a47..6fc787c 100644 --- a/src/core/components/SelectBox.jsx +++ b/src/core/components/SelectBox.jsx @@ -13,14 +13,15 @@ function SelectBox({ disabled, helperText, isLoading, - errorEcured + errorEcured, + variant = "outlined" }) { const t = useTranslations(); return ( { const {isBot} = parse(req.headers["user-agent"]); + const responseConfig = await fetch(process.env.NEXT_PUBLIC_CONFIG_APP_URL); + return { - config: (await import(`&/config.json`)).default, + config: await responseConfig.json(), messages: (await import(`&/locales/${locale}/app.json`)).default, isBot, locale, diff --git a/src/layouts/dashboard.jsx b/src/layouts/dashboard.jsx index a814c9a..bc62f82 100644 --- a/src/layouts/dashboard.jsx +++ b/src/layouts/dashboard.jsx @@ -13,13 +13,13 @@ const DashboardLayout = (props) => { return ( <> diff --git a/src/pages/dashboard/navgan/[id]/show/index.jsx b/src/pages/dashboard/navgan/[id]/show/index.jsx new file mode 100644 index 0000000..701f417 --- /dev/null +++ b/src/pages/dashboard/navgan/[id]/show/index.jsx @@ -0,0 +1,20 @@ +import {parse} from "next-useragent"; +import ShowLoan from "@/components/dashboard/navgan/show"; +import {globalServerProps} from "@/core/utils/globalServerProps"; + +export default function ShowLoanRequest() { + return ( + + ); +} + +export async function getServerSideProps({req, locale}) { + const {isBot} = parse(req.headers["user-agent"]); + return { + props: { + ...await globalServerProps({req, locale}), + title: "ShowLoan.show_loan_page", + layout: {name: 'DashboardLayout'} + }, + }; +}