From baac69985faed6726b8ebb7943a08a5c68d1e703 Mon Sep 17 00:00:00 2001 From: Witel Company Date: Sat, 23 Dec 2023 10:16:04 +0000 Subject: [PATCH] fixed bugs in dashboard first page --- package.json | 2 +- public/locales/fa/app.json | 6 ++-- src/components/dashboard/first/index.jsx | 45 ++++++++++++++++++++++-- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c6ff3c8..93eb689 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@mui/lab": "^5.0.0-alpha.152", "@mui/material": "^5.12.0", "@mui/x-date-pickers": "^6.18.5", - "@witel/webapp-builder": "^1.3.1", + "@witel/webapp-builder": "^1.3.2", "axios": "^1.4.0", "colord": "^2.9.3", "date-fns-jalali": "^2.13.0-0", diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index 0785888..9c263be 100644 --- a/public/locales/fa/app.json +++ b/public/locales/fa/app.json @@ -127,7 +127,9 @@ "complete_information": "مشخصات" }, "Dashboard": { - "dashboard_page": "داشبورد" + "dashboard_page": "داشبورد", + "go_to_add_request_loan": "درخواست تسهیلات نوسازی ناوگان", + "go_to_followUp-loan": "پیگیری وضعیت تسهیلات نوسازی ناوگان" }, "LoanFollowUp": { "loan_follow_up_page": "پیگیری درخواست", @@ -259,4 +261,4 @@ "EditLoanRequest": { "edit_loan_request_page": "ویرایش درخواست وام" } -} +} \ No newline at end of file diff --git a/src/components/dashboard/first/index.jsx b/src/components/dashboard/first/index.jsx index 0e3c800..7b42ef9 100644 --- a/src/components/dashboard/first/index.jsx +++ b/src/components/dashboard/first/index.jsx @@ -1,5 +1,46 @@ +import { + CenterLayout, + FullPageLayout, + NextLinkComposed, + useUser, +} from "@witel/webapp-builder"; +import { Button, Typography } from "@mui/material"; +import { useTranslations } from "next-intl"; + const FirstComponent = () => { - return <>; + 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; +export default FirstComponent; \ No newline at end of file