diff --git a/src/components/dashboard/change-password/index.jsx b/src/components/dashboard/change-password/index.jsx
index b6337d4..c62d127 100644
--- a/src/components/dashboard/change-password/index.jsx
+++ b/src/components/dashboard/change-password/index.jsx
@@ -1,17 +1,14 @@
import CenterLayout from "@/layouts/CenterLayout";
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Container} from "@mui/material";
import ChangePasswordForm from "@/components/dashboard/change-password/change-password-form";
const DashboardChangePasswordComponent = () => {
return (
-
-
-
-
-
-
-
+
+
+
+
+
);
};
export default DashboardChangePasswordComponent;
diff --git a/src/components/dashboard/commercial-chief/index.jsx b/src/components/dashboard/commercial-chief/index.jsx
index 546bd73..9caaa36 100644
--- a/src/components/dashboard/commercial-chief/index.jsx
+++ b/src/components/dashboard/commercial-chief/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_COMMERCIAL_CHIEF} from "@/core/data/apiRoutes";
@@ -126,30 +125,28 @@ function DashboardCommercialChiefComponent() {
);
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/development-assistant/index.jsx b/src/components/dashboard/development-assistant/index.jsx
index 2c09de2..53c25bd 100644
--- a/src/components/dashboard/development-assistant/index.jsx
+++ b/src/components/dashboard/development-assistant/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_DEVELOPMENT_ASSISTANT} from "@/core/data/apiRoutes";
@@ -125,32 +124,30 @@ function DashboardDevelopmentAssistantComponent() {
],
[]
);
-
+
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/edit-profile/index.jsx b/src/components/dashboard/edit-profile/index.jsx
index 3018aa3..1187057 100644
--- a/src/components/dashboard/edit-profile/index.jsx
+++ b/src/components/dashboard/edit-profile/index.jsx
@@ -1,6 +1,5 @@
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, Container, Grid, Paper, Stack, TextField, Typography,} from "@mui/material";
import * as Yup from "yup";
@@ -54,169 +53,167 @@ const DashboardEditProfile = () => {
const validationSchema = Yup.object().shape({});
return (
-
-
-
-
- {(props) => (
- {
- e.preventDefault();
- props.handleSubmit();
- }}
- >
-
-
-
- {t("UpdateProfile.typography_edit_profile")}
-
-
-
+
+
+ {(props) => (
+ {
+ e.preventDefault();
+ props.handleSubmit();
+ }}
+ >
+
+
+
+ {t("UpdateProfile.typography_edit_profile")}
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )}
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+
+
+
);
};
diff --git a/src/components/dashboard/expert-management/index.jsx b/src/components/dashboard/expert-management/index.jsx
index a69a550..f8caab7 100644
--- a/src/components/dashboard/expert-management/index.jsx
+++ b/src/components/dashboard/expert-management/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_EXPERT_MANAGEMENT} from "@/core/data/apiRoutes";
@@ -138,33 +137,31 @@ function DashboardExpertManagementComponent() {
],
[]
);
-
+
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/first/index.jsx b/src/components/dashboard/first/index.jsx
index d78e9a3..919bb14 100644
--- a/src/components/dashboard/first/index.jsx
+++ b/src/components/dashboard/first/index.jsx
@@ -1,7 +1,5 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
-
const DashboardFirstComponent = () => {
- return
+ return <>>
};
export default DashboardFirstComponent;
diff --git a/src/components/dashboard/inspector-expert/index.jsx b/src/components/dashboard/inspector-expert/index.jsx
index 137775f..9ee841d 100644
--- a/src/components/dashboard/inspector-expert/index.jsx
+++ b/src/components/dashboard/inspector-expert/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_INSPECTOR_EXPERT} from "@/core/data/apiRoutes";
@@ -124,32 +123,30 @@ function DashboardInspectorExpertComponent() {
],
[]
);
-
+
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/machinary-office/index.jsx b/src/components/dashboard/machinary-office/index.jsx
index 2dfbbb1..820519e 100644
--- a/src/components/dashboard/machinary-office/index.jsx
+++ b/src/components/dashboard/machinary-office/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_MACHINARY_OFFICE} from "@/core/data/apiRoutes";
@@ -156,30 +155,28 @@ function DashboardMachinaryOfficeComponent() {
[]
);
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/navgan-loan-management/index.jsx b/src/components/dashboard/navgan-loan-management/index.jsx
index 3664ccb..83aeffb 100644
--- a/src/components/dashboard/navgan-loan-management/index.jsx
+++ b/src/components/dashboard/navgan-loan-management/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_LOAN_MANAGEMENT_NAVGAN} from "@/core/data/apiRoutes";
@@ -134,32 +133,30 @@ function DashboardNavganLoanManagementComponent() {
],
[]
);
-
+
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/navgan-province-manager/index.jsx b/src/components/dashboard/navgan-province-manager/index.jsx
index 4ca0e0b..e0e6a39 100644
--- a/src/components/dashboard/navgan-province-manager/index.jsx
+++ b/src/components/dashboard/navgan-province-manager/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_NAVGAN_PROVINCE_MANAGER} from "@/core/data/apiRoutes";
@@ -156,32 +155,30 @@ function DashboardNavganProvinceManagerComponent() {
],
[]
);
-
+
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/passenger-boss/index.jsx b/src/components/dashboard/passenger-boss/index.jsx
index 392cac3..c338f6e 100644
--- a/src/components/dashboard/passenger-boss/index.jsx
+++ b/src/components/dashboard/passenger-boss/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_PASSENGER_BOSS} from "@/core/data/apiRoutes";
@@ -157,30 +156,28 @@ function DashboardPassengerOfficeComponent() {
[]
);
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/passenger-office/index.jsx b/src/components/dashboard/passenger-office/index.jsx
index 7d9e39a..b8292a0 100644
--- a/src/components/dashboard/passenger-office/index.jsx
+++ b/src/components/dashboard/passenger-office/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_PASSENGER_OFFICE} from "@/core/data/apiRoutes";
@@ -157,30 +156,28 @@ function DashboardPassengerOfficeComponent() {
[]
);
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/province-head-expert/index.jsx b/src/components/dashboard/province-head-expert/index.jsx
index a647af9..56bf5f8 100644
--- a/src/components/dashboard/province-head-expert/index.jsx
+++ b/src/components/dashboard/province-head-expert/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_PROVINCE_HEAD_EXPERT} from "@/core/data/apiRoutes";
@@ -126,30 +125,28 @@ function DashboardProvinceHeadExpertComponent() {
[]
);
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/refahi-loan-management/index.jsx b/src/components/dashboard/refahi-loan-management/index.jsx
index 3125654..11cd469 100644
--- a/src/components/dashboard/refahi-loan-management/index.jsx
+++ b/src/components/dashboard/refahi-loan-management/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_LOAN_MANAGEMENT_REFAHI} from "@/core/data/apiRoutes";
@@ -134,32 +133,30 @@ function DashboardRefahiLoanManagementComponent() {
],
[]
);
-
+
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/refahi-province-manager/index.jsx b/src/components/dashboard/refahi-province-manager/index.jsx
index b7c13ce..88be38d 100644
--- a/src/components/dashboard/refahi-province-manager/index.jsx
+++ b/src/components/dashboard/refahi-province-manager/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_REFAHI_PROVINCE_MANAGER} from "@/core/data/apiRoutes";
@@ -125,32 +124,30 @@ function DashboardRefahiProvinceManagerComponent() {
],
[]
);
-
+
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/role-management/index.jsx b/src/components/dashboard/role-management/index.jsx
index 5d55575..335d741 100644
--- a/src/components/dashboard/role-management/index.jsx
+++ b/src/components/dashboard/role-management/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_ROLE_MANAGEMENT} from "@/core/data/apiRoutes";
@@ -66,7 +65,7 @@ function DashboardRoleManagementComponent() {
datatype: "numeric",
Cell: ({renderedCellValue}) => ({renderedCellValue}),
}], []);
- return (
+ return (
- );
+ );
}
export default DashboardRoleManagementComponent;
diff --git a/src/components/dashboard/transportation-assistance/index.jsx b/src/components/dashboard/transportation-assistance/index.jsx
index 0786159..473837c 100644
--- a/src/components/dashboard/transportation-assistance/index.jsx
+++ b/src/components/dashboard/transportation-assistance/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_TRANSPORTATION_ASSISTANCE} from "@/core/data/apiRoutes";
@@ -157,30 +156,28 @@ function DashboardTransportationAssistanceComponent() {
[]
);
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/src/components/dashboard/user-management/index.jsx b/src/components/dashboard/user-management/index.jsx
index ddf9099..6f06eed 100644
--- a/src/components/dashboard/user-management/index.jsx
+++ b/src/components/dashboard/user-management/index.jsx
@@ -1,4 +1,3 @@
-import DashboardLayouts from "@/layouts/dashboardLayouts";
import {Box, FormControl, FormHelperText, IconButton, MenuItem, Select, Stack, Typography} from "@mui/material";
import {useMemo} from "react";
import {GET_USER_MANAGEMENT} from "@/core/data/apiRoutes";
@@ -113,7 +112,7 @@ function DashboardUserManagementComponent() {
)
}
},], []);
- return (
+ return (
- );
+ );
}
export default DashboardUserManagementComponent;
diff --git a/src/layouts/dashboardLayouts/breadcrumbs/BreadcrumbItem.jsx b/src/components/layouts/Dashboard/Breadcrumbs/BreadcrumbItem.jsx
similarity index 100%
rename from src/layouts/dashboardLayouts/breadcrumbs/BreadcrumbItem.jsx
rename to src/components/layouts/Dashboard/Breadcrumbs/BreadcrumbItem.jsx
diff --git a/src/layouts/dashboardLayouts/breadcrumbs/index.jsx b/src/components/layouts/Dashboard/Breadcrumbs/index.jsx
similarity index 100%
rename from src/layouts/dashboardLayouts/breadcrumbs/index.jsx
rename to src/components/layouts/Dashboard/Breadcrumbs/index.jsx
diff --git a/src/layouts/dashboardLayouts/header/ProfileData.jsx b/src/components/layouts/Dashboard/Header/ProfileData.jsx
similarity index 100%
rename from src/layouts/dashboardLayouts/header/ProfileData.jsx
rename to src/components/layouts/Dashboard/Header/ProfileData.jsx
diff --git a/src/layouts/dashboardLayouts/header/ProfileMenu.jsx b/src/components/layouts/Dashboard/Header/ProfileMenu.jsx
similarity index 100%
rename from src/layouts/dashboardLayouts/header/ProfileMenu.jsx
rename to src/components/layouts/Dashboard/Header/ProfileMenu.jsx
diff --git a/src/layouts/dashboardLayouts/header/ProfileOptionLogOut.jsx b/src/components/layouts/Dashboard/Header/ProfileOptionLogOut.jsx
similarity index 100%
rename from src/layouts/dashboardLayouts/header/ProfileOptionLogOut.jsx
rename to src/components/layouts/Dashboard/Header/ProfileOptionLogOut.jsx
diff --git a/src/layouts/dashboardLayouts/header/ProfileOptions.jsx b/src/components/layouts/Dashboard/Header/ProfileOptions.jsx
similarity index 100%
rename from src/layouts/dashboardLayouts/header/ProfileOptions.jsx
rename to src/components/layouts/Dashboard/Header/ProfileOptions.jsx
diff --git a/src/layouts/dashboardLayouts/header/index.jsx b/src/components/layouts/Dashboard/Header/index.jsx
similarity index 100%
rename from src/layouts/dashboardLayouts/header/index.jsx
rename to src/components/layouts/Dashboard/Header/index.jsx
diff --git a/src/layouts/dashboardLayouts/sidebar/SidebarDrawer.jsx b/src/components/layouts/Dashboard/Sidebar/SidebarDrawer.jsx
similarity index 100%
rename from src/layouts/dashboardLayouts/sidebar/SidebarDrawer.jsx
rename to src/components/layouts/Dashboard/Sidebar/SidebarDrawer.jsx
diff --git a/src/layouts/dashboardLayouts/sidebar/SidebarList.jsx b/src/components/layouts/Dashboard/Sidebar/SidebarList.jsx
similarity index 100%
rename from src/layouts/dashboardLayouts/sidebar/SidebarList.jsx
rename to src/components/layouts/Dashboard/Sidebar/SidebarList.jsx
diff --git a/src/layouts/dashboardLayouts/sidebar/SidebarListItem.jsx b/src/components/layouts/Dashboard/Sidebar/SidebarListItem.jsx
similarity index 100%
rename from src/layouts/dashboardLayouts/sidebar/SidebarListItem.jsx
rename to src/components/layouts/Dashboard/Sidebar/SidebarListItem.jsx
diff --git a/src/layouts/dashboardLayouts/sidebar/SidebarListSubItem.jsx b/src/components/layouts/Dashboard/Sidebar/SidebarListSubItem.jsx
similarity index 100%
rename from src/layouts/dashboardLayouts/sidebar/SidebarListSubItem.jsx
rename to src/components/layouts/Dashboard/Sidebar/SidebarListSubItem.jsx
diff --git a/src/layouts/dashboardLayouts/sidebar/index.jsx b/src/components/layouts/Dashboard/Sidebar/index.jsx
similarity index 100%
rename from src/layouts/dashboardLayouts/sidebar/index.jsx
rename to src/components/layouts/Dashboard/Sidebar/index.jsx
diff --git a/src/layouts/dashboardLayouts/index.jsx b/src/components/layouts/Dashboard/index.jsx
similarity index 78%
rename from src/layouts/dashboardLayouts/index.jsx
rename to src/components/layouts/Dashboard/index.jsx
index fae51d2..f54a894 100644
--- a/src/layouts/dashboardLayouts/index.jsx
+++ b/src/components/layouts/Dashboard/index.jsx
@@ -1,9 +1,10 @@
import {useState} from "react";
-import FullPageLayout from "../FullPageLayout";
import Header from "./header";
import Sidebar from "./sidebar";
import {Toolbar} from "@mui/material";
import BreadCrumbs from "./breadcrumbs";
+import FullPageLayout from "@/layouts/FullPageLayout";
+import RolePermissionMiddleware from "@/middlewares/RolePermission";
const drawerWidth = 240;
@@ -34,8 +35,10 @@ const DashboardLayouts = (props) => {
>
-
- {props.children}
+
+
+ {props.children}
+
diff --git a/src/layouts/DashboardLayout.jsx b/src/layouts/DashboardLayout.jsx
new file mode 100644
index 0000000..149f4f4
--- /dev/null
+++ b/src/layouts/DashboardLayout.jsx
@@ -0,0 +1,12 @@
+import WithAuthMiddleware from "@/middlewares/WithAuth";
+import Dashboard from "@/components/layouts/Dashboard";
+
+const DashboardLayout = (props) => {
+ return (
+
+
+
+ );
+};
+
+export default DashboardLayout;
\ No newline at end of file
diff --git a/src/layouts/index.jsx b/src/layouts/index.jsx
new file mode 100644
index 0000000..1506661
--- /dev/null
+++ b/src/layouts/index.jsx
@@ -0,0 +1,20 @@
+import DashboardLayout from "@/layouts/DashboardLayout";
+import {Fragment} from "react";
+
+const layoutList = {
+ DashboardLayout
+}
+
+const Layout = ({layout = {}, children}) => {
+
+ const Component = layoutList[layout?.name] || Fragment
+ const props = layout.props || {}
+
+ return (
+
+ {children}
+
+ )
+}
+
+export default Layout
\ No newline at end of file
diff --git a/src/middlewares/RolePermission.jsx b/src/middlewares/RolePermission.jsx
index 4b1cc8a..c546220 100644
--- a/src/middlewares/RolePermission.jsx
+++ b/src/middlewares/RolePermission.jsx
@@ -1,14 +1,14 @@
import useUser from "@/lib/app/hooks/useUser";
import RolePermissionComponent from "@/core/components/Middleware/RolePermissionComponent";
-const RolePermissionMiddleware = ({children, requiredPermissions}) => {
+const RolePermissionMiddleware = ({children, requiredPermissions = []}) => {
const {user} = useUser();
- const hasPermission = requiredPermissions.some((permission) =>
+ const hasPermission = requiredPermissions.length === 0 ? true : requiredPermissions.some((permission) =>
user?.permissions?.includes(permission)
);
- return !hasPermission ? : <>{children}>;
+ return !hasPermission ? : <>{children}>;
};
export default RolePermissionMiddleware;
diff --git a/src/pages/_app.jsx b/src/pages/_app.jsx
index 29ec464..342f2a4 100644
--- a/src/pages/_app.jsx
+++ b/src/pages/_app.jsx
@@ -7,6 +7,7 @@ import {UserProvider} from "@/lib/app/contexts/user";
import "moment/locale/fa";
import {NextIntlProvider} from "next-intl";
import TitlePage from "@/core/components/TitlePage";
+import Layout from "@/layouts";
const App = ({Component, pageProps}) => {
@@ -19,7 +20,9 @@ const App = ({Component, pageProps}) => {
{pageProps.messages ? : ''}
-
+
+
+
diff --git a/src/pages/dashboard/change-password/index.jsx b/src/pages/dashboard/change-password/index.jsx
index 670e184..d23721d 100644
--- a/src/pages/dashboard/change-password/index.jsx
+++ b/src/pages/dashboard/change-password/index.jsx
@@ -1,12 +1,9 @@
import DashboardChangePasswordComponent from "@/components/dashboard/change-password";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
export default function LoanFollowUp() {
return (
-
-
-
+
);
}
@@ -17,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.change_password",
isBot,
+ layout: {name: 'DashboardLayout'}
},
};
}
diff --git a/src/pages/dashboard/commercial-chief/index.jsx b/src/pages/dashboard/commercial-chief/index.jsx
index 841d668..e5dc96c 100644
--- a/src/pages/dashboard/commercial-chief/index.jsx
+++ b/src/pages/dashboard/commercial-chief/index.jsx
@@ -1,16 +1,9 @@
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
import DashboardCommercialChiefComponent from "@/components/dashboard/commercial-chief";
-const requiredPermissions = ["manage_commercial_refahi"];
export default function CommercialChief() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.commercial_chief_page",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_commercial_refahi"]}}
},
};
}
diff --git a/src/pages/dashboard/development-assistant/index.jsx b/src/pages/dashboard/development-assistant/index.jsx
index aaaea39..6f1a0ff 100644
--- a/src/pages/dashboard/development-assistant/index.jsx
+++ b/src/pages/dashboard/development-assistant/index.jsx
@@ -1,16 +1,9 @@
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
import DashboardDevelopmentAssistantComponent from "@/components/dashboard/development-assistant";
-const requiredPermissions = ["manage_development_refahi"];
export default function DevelopmentAssistant() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.development_assistant_page",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_development_refahi"]}}
},
};
}
diff --git a/src/pages/dashboard/edit-profile/index.jsx b/src/pages/dashboard/edit-profile/index.jsx
index 9460506..dede28e 100644
--- a/src/pages/dashboard/edit-profile/index.jsx
+++ b/src/pages/dashboard/edit-profile/index.jsx
@@ -1,12 +1,9 @@
import DashboardEditProfile from "@/components/dashboard/edit-profile";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
export default function LoanFollowUp() {
return (
-
-
-
+
);
}
@@ -17,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.edit_profile",
isBot,
+ layout: {name: 'DashboardLayout'}
},
};
}
diff --git a/src/pages/dashboard/expert-management/index.jsx b/src/pages/dashboard/expert-management/index.jsx
index ce91ee6..eab73fc 100644
--- a/src/pages/dashboard/expert-management/index.jsx
+++ b/src/pages/dashboard/expert-management/index.jsx
@@ -1,16 +1,9 @@
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
import DashboardExpertManagementComponent from "@/components/dashboard/expert-management";
-const requiredPermissions = ["manage_transportation_navgan"];
export default function ExpertManagement() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.expert_management",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_transportation_navgan"]}}
},
};
}
diff --git a/src/pages/dashboard/index.jsx b/src/pages/dashboard/index.jsx
index af824d5..f3cf481 100644
--- a/src/pages/dashboard/index.jsx
+++ b/src/pages/dashboard/index.jsx
@@ -1,12 +1,9 @@
import DashboardFirstComponent from "@/components/dashboard/first";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
export default function Dashboard() {
return (
-
-
-
+
);
}
@@ -17,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.dashboard_page",
isBot,
+ layout: {name: 'DashboardLayout'}
},
};
}
diff --git a/src/pages/dashboard/inspector-expert/index.jsx b/src/pages/dashboard/inspector-expert/index.jsx
index 902a7ec..f953f30 100644
--- a/src/pages/dashboard/inspector-expert/index.jsx
+++ b/src/pages/dashboard/inspector-expert/index.jsx
@@ -1,16 +1,9 @@
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
import DashboardInspectorExpertComponent from "@/components/dashboard/inspector-expert";
-const requiredPermissions = ["manage_inspector_refahi"];
export default function InspectorExpert() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.inspector_expert_page",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_inspector_refahi"]}}
},
};
}
diff --git a/src/pages/dashboard/machinery-expert/index.jsx b/src/pages/dashboard/machinery-expert/index.jsx
index fc0c248..5b2f945 100644
--- a/src/pages/dashboard/machinery-expert/index.jsx
+++ b/src/pages/dashboard/machinery-expert/index.jsx
@@ -1,16 +1,9 @@
import DashboardMachineryOfficeComponent from "@/components/dashboard/machinary-office";
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
-const requiredPermissions = ["manage_machinery_navgan"];
export default function PassengerOffice() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.machinary_office_page",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_machinery_navgan"]}}
},
};
}
diff --git a/src/pages/dashboard/navgan-loan-management/index.jsx b/src/pages/dashboard/navgan-loan-management/index.jsx
index 86fb592..61922ad 100644
--- a/src/pages/dashboard/navgan-loan-management/index.jsx
+++ b/src/pages/dashboard/navgan-loan-management/index.jsx
@@ -1,16 +1,9 @@
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
import DashboardNavganLoanManagementComponent from "@/components/dashboard/navgan-loan-management";
-const requiredPermissions = ["manage_navgan_loan"];
export default function NavganLoanManagement() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.loan_management_page",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_navgan_loan"]}}
},
};
}
diff --git a/src/pages/dashboard/navgan-province-manager/index.jsx b/src/pages/dashboard/navgan-province-manager/index.jsx
index fde7e8c..b0c0be6 100644
--- a/src/pages/dashboard/navgan-province-manager/index.jsx
+++ b/src/pages/dashboard/navgan-province-manager/index.jsx
@@ -1,16 +1,9 @@
import DashboardNavganProvinceManagerComponent from "src/components/dashboard/navgan-province-manager";
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
-const requiredPermissions = ["manage_province_affairs_navgan"];
export default function PassengerOffice() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.province_manager_page",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_province_affairs_navgan"]}}
},
};
}
diff --git a/src/pages/dashboard/passenger-boss/index.jsx b/src/pages/dashboard/passenger-boss/index.jsx
index 839488e..a549f74 100644
--- a/src/pages/dashboard/passenger-boss/index.jsx
+++ b/src/pages/dashboard/passenger-boss/index.jsx
@@ -1,16 +1,9 @@
import DashboardPassengerBossComponent from "@/components/dashboard/passenger-boss";
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
-const requiredPermissions = ["manage_province_working_group_navgan"];
export default function PassengerBoss() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.passenger_boss_page",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_province_working_group_navgan"]}}
},
};
}
diff --git a/src/pages/dashboard/passenger-office-chief/index.jsx b/src/pages/dashboard/passenger-office-chief/index.jsx
index f92ae2f..03aa612 100644
--- a/src/pages/dashboard/passenger-office-chief/index.jsx
+++ b/src/pages/dashboard/passenger-office-chief/index.jsx
@@ -1,16 +1,9 @@
import DashboardPassengerOfficeComponent from "@/components/dashboard/passenger-office";
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
-const requiredPermissions = ["manage_passenger_office_navgan"];
export default function PassengerOffice() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.passenger_office_page",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_passenger_office_navgan"]}}
},
};
}
diff --git a/src/pages/dashboard/province-head-expert/index.jsx b/src/pages/dashboard/province-head-expert/index.jsx
index e288c37..64bffb1 100644
--- a/src/pages/dashboard/province-head-expert/index.jsx
+++ b/src/pages/dashboard/province-head-expert/index.jsx
@@ -1,16 +1,9 @@
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
import DashboardProvinceHeadExpertComponent from "@/components/dashboard/province-head-expert";
-const requiredPermissions = ["manage_province_headquarter_refahi"];
export default function ProvinceHeadExpertOffice() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.province_head_expert",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_province_headquarter_refahi"]}}
},
};
}
diff --git a/src/pages/dashboard/refahi-loan-management/index.jsx b/src/pages/dashboard/refahi-loan-management/index.jsx
index e513af3..1ae6954 100644
--- a/src/pages/dashboard/refahi-loan-management/index.jsx
+++ b/src/pages/dashboard/refahi-loan-management/index.jsx
@@ -1,16 +1,9 @@
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
import DashboardRefahiLoanManagementComponent from "@/components/dashboard/refahi-loan-management";
-const requiredPermissions = ["manage_refahi_loan"];
export default function RefahiLoanManagement() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.loan_management_page",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_refahi_loan"]}}
},
};
}
diff --git a/src/pages/dashboard/refahi-province-manager/index.jsx b/src/pages/dashboard/refahi-province-manager/index.jsx
index baac91b..9922b50 100644
--- a/src/pages/dashboard/refahi-province-manager/index.jsx
+++ b/src/pages/dashboard/refahi-province-manager/index.jsx
@@ -1,16 +1,9 @@
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
import DashboardRefahiProvinceManagerComponent from "@/components/dashboard/refahi-province-manager";
-const requiredPermissions = ["manage_province_affairs_refahi"];
export default function RefahiProvinceManager() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.province_manager_page",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_province_affairs_refahi"]}}
},
};
}
diff --git a/src/pages/dashboard/role-management/index.jsx b/src/pages/dashboard/role-management/index.jsx
index c309729..97238db 100644
--- a/src/pages/dashboard/role-management/index.jsx
+++ b/src/pages/dashboard/role-management/index.jsx
@@ -1,16 +1,9 @@
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
import DashboardRoleManagementComponent from "@/components/dashboard/role-management";
-const requiredPermissions = ["manage_roles"];
export default function RoleManagement() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.role_management_page",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_roles"]}}
},
};
}
diff --git a/src/pages/dashboard/transportation-assistant/index.jsx b/src/pages/dashboard/transportation-assistant/index.jsx
index ea58847..eccb330 100644
--- a/src/pages/dashboard/transportation-assistant/index.jsx
+++ b/src/pages/dashboard/transportation-assistant/index.jsx
@@ -1,16 +1,9 @@
import DashboardTransportationAssistanceComponent from "@/components/dashboard/transportation-assistance";
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
-const requiredPermissions = ["manage_transportation_navgan"];
export default function TransportationAssistance() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.transportation_assistance",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_transportation_navgan"]}}
},
};
}
diff --git a/src/pages/dashboard/user-management/index.jsx b/src/pages/dashboard/user-management/index.jsx
index 5a43454..f0f9b24 100644
--- a/src/pages/dashboard/user-management/index.jsx
+++ b/src/pages/dashboard/user-management/index.jsx
@@ -1,16 +1,9 @@
-import RolePermissionMiddleware from "@/middlewares/RolePermission";
-import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
import DashboardUserManagementComponent from "@/components/dashboard/user-management";
-const requiredPermissions = ["manage_users"];
export default function UserManagement() {
return (
-
-
-
-
-
+
);
}
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.user_management_page",
isBot,
+ layout: {name: 'DashboardLayout', props: {permissions: ["manage_users"]}}
},
};
}