@ebubekirylmaz/link-test 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +3 -0
- package/.browserslistrc +1 -0
- package/.env +2 -0
- package/.eslintignore +3 -0
- package/.eslintrc.json +58 -0
- package/.gitattributes +1 -0
- package/.github/workflows/publish.yml +66 -0
- package/.prettierignore +1 -0
- package/.prettierrc +10 -0
- package/.storybook/main.js +15 -0
- package/.storybook/preview.js +17 -0
- package/.storybook/vitest.setup.js +6 -0
- package/README.md +1 -0
- package/cypress.config.js +11 -0
- package/index.js +1 -0
- package/package.json +111 -0
- package/project/.eslintrc.cjs +22 -0
- package/project/config.js +18 -0
- package/project/config.menu.js +39 -0
- package/project/config.template.js +31 -0
- package/project/cypress/e2e/layouts.cy.js +170 -0
- package/project/cypress/e2e/login.cy.js +35 -0
- package/project/cypress/e2e/selectbar.cy.js +80 -0
- package/project/cypress/fixtures/CONFIG/MENU_CONFIG.js +39 -0
- package/project/cypress/fixtures/EMPEROR/EMPERORS_GET.json +51 -0
- package/project/cypress/fixtures/EMPEROR/EMPERORS_POST.json +9 -0
- package/project/cypress/fixtures/OAUTH/GITHUB/user.json +46 -0
- package/project/cypress/fixtures/example.json +5 -0
- package/project/cypress/support/commands.js +104 -0
- package/project/cypress/support/e2e.js +1 -0
- package/project/cypress.config.js +10 -0
- package/project/index.html +12 -0
- package/project/media/ProjectIcons/3d.png +0 -0
- package/project/media/ProjectIcons/box.png +0 -0
- package/project/media/ProjectIcons/cafe.png +0 -0
- package/project/media/ProjectIcons/cargo.png +0 -0
- package/project/media/ProjectIcons/cloud.png +0 -0
- package/project/media/ProjectIcons/code.png +0 -0
- package/project/media/ProjectIcons/company.png +0 -0
- package/project/media/ProjectIcons/conversation.png +0 -0
- package/project/media/ProjectIcons/distributed.png +0 -0
- package/project/media/ProjectIcons/fingerprint.png +0 -0
- package/project/media/ProjectIcons/forest.png +0 -0
- package/project/media/ProjectIcons/headphones.png +0 -0
- package/project/media/ProjectIcons/office.png +0 -0
- package/project/media/ProjectIcons/path.png +0 -0
- package/project/media/ProjectIcons/printer.png +0 -0
- package/project/media/ProjectIcons/project.png +0 -0
- package/project/media/ProjectIcons/resume.png +0 -0
- package/project/media/ProjectIcons/rocket.png +0 -0
- package/project/media/ProjectIcons/rtruck.png +0 -0
- package/project/media/ProjectIcons/sign.png +0 -0
- package/project/media/ProjectIcons/site.png +0 -0
- package/project/media/ProjectIcons/truck.png +0 -0
- package/project/media/logo.png +0 -0
- package/project/package-lock.json +22434 -0
- package/project/package.json +42 -0
- package/project/public/assets/background/overlay_2.jpg +0 -0
- package/project/public/assets/illustrations/illustration_dashboard.png +0 -0
- package/project/public/media/largeLogo.png +0 -0
- package/project/public/media/logo.png +0 -0
- package/project/public/vite.svg +1 -0
- package/project/routes.jsx +47 -0
- package/project/server/mock.json +110 -0
- package/project/server/oauthMock.js +27 -0
- package/project/server/package-lock.json +1505 -0
- package/project/server/package.json +20 -0
- package/project/server/server.js +127 -0
- package/project/src/Container.jsx +7 -0
- package/project/src/components/ActionButton.jsx +18 -0
- package/project/src/hooks/useEmperor.jsx +21 -0
- package/project/src/http/index.js +39 -0
- package/project/src/main.jsx +10 -0
- package/project/src/pages/Battles.jsx +16 -0
- package/project/src/pages/Emperor.jsx +50 -0
- package/project/src/pages/index.jsx +33 -0
- package/project/src/theme.js +151 -0
- package/project/src/widgets/ActionButton.jsx +68 -0
- package/project/src/widgets/AddNewEmperor.jsx +120 -0
- package/project/src/widgets/ProjectContainer.jsx +27 -0
- package/project/vite.config.js +6 -0
- package/project/vite.config.js.timestamp-1709564450418-45fdd27900806.mjs +341 -0
- package/public/assets/background/overlay_2.jpg +0 -0
- package/public/assets/illustrations/illustration_dashboard.png +0 -0
- package/public/vite.svg +1 -0
- package/src/ContextProvider/ContextProvider.jsx +19 -0
- package/src/GlobalSnackMessage/GlobalSnackMessage.jsx +45 -0
- package/src/GlobalSnackMessage/index.js +1 -0
- package/src/GlobalSnackMessage/styles.js +3 -0
- package/src/Platform.jsx +76 -0
- package/src/RouteManager/RouteManager.jsx +56 -0
- package/src/RouteManager/index.js +1 -0
- package/src/assets/illustrations/avatar-shape.jsx +31 -0
- package/src/assets/illustrations/background-shape.jsx +37 -0
- package/src/assets/illustrations/booking-illustration.jsx +335 -0
- package/src/assets/illustrations/check-in-illustration.jsx +96 -0
- package/src/assets/illustrations/check-out-illustration.jsx +69 -0
- package/src/assets/illustrations/coming-soon-illustration.jsx +125 -0
- package/src/assets/illustrations/forbidden-illustration.jsx +95 -0
- package/src/assets/illustrations/index.js +2 -0
- package/src/assets/illustrations/maintenance-illustration.jsx +228 -0
- package/src/assets/illustrations/motivation-illustration.jsx +74 -0
- package/src/assets/illustrations/order-complete-illustration.jsx +126 -0
- package/src/assets/illustrations/page-not-found-illustration.jsx +81 -0
- package/src/assets/illustrations/seo-illustration.jsx +244 -0
- package/src/assets/illustrations/sever-error-illustration.jsx +152 -0
- package/src/assets/illustrations/upgrade-storage-illustration.jsx +161 -0
- package/src/assets/illustrations/upload-illustration.jsx +622 -0
- package/src/components/Iconify/Iconify.jsx +18 -0
- package/src/components/Iconify/index.js +1 -0
- package/src/components/MiniTopBar/MiniTopBar.jsx +25 -0
- package/src/components/MiniTopBar/index.js +1 -0
- package/src/components/MiniTopBar/styles.js +6 -0
- package/src/components/NucleoidLoginForm/NucleoidLoginForm.jsx +69 -0
- package/src/components/NucleoidLoginForm/index.js +1 -0
- package/src/components/NucleoidLoginForm/styles.js +3 -0
- package/src/components/Sidebar/Sidebar.jsx +76 -0
- package/src/components/Sidebar/index.js +1 -0
- package/src/components/Sidebar/styles.js +25 -0
- package/src/components/SocialLoginButtons/SocialLoginButtons.jsx +55 -0
- package/src/components/SocialLoginButtons/index.js +1 -0
- package/src/components/SocialLoginButtons/styles.js +3 -0
- package/src/components/TopNavBar/TopNavBar.jsx +186 -0
- package/src/components/TopNavBar/index.js +1 -0
- package/src/components/TopNavBar/styles.js +7 -0
- package/src/components/animate/index.js +4 -0
- package/src/components/animate/motion-container.jsx +38 -0
- package/src/components/animate/motion-lazy.jsx +11 -0
- package/src/components/animate/motion-viewport.jsx +30 -0
- package/src/components/animate/variants/actions.js +4 -0
- package/src/components/animate/variants/background.js +97 -0
- package/src/components/animate/variants/bounce.js +107 -0
- package/src/components/animate/variants/container.js +20 -0
- package/src/components/animate/variants/fade.js +127 -0
- package/src/components/animate/variants/flip.js +54 -0
- package/src/components/animate/variants/index.js +12 -0
- package/src/components/animate/variants/path.js +12 -0
- package/src/components/animate/variants/rotate.js +33 -0
- package/src/components/animate/variants/scale.js +54 -0
- package/src/components/animate/variants/slide.js +65 -0
- package/src/components/animate/variants/transition.js +20 -0
- package/src/components/animate/variants/zoom.js +130 -0
- package/src/components/chart/chart.js +69 -0
- package/src/components/chart/index.js +5 -0
- package/src/components/chart/use-chart.js +215 -0
- package/src/components/custom-popover/custom-popover.jsx +46 -0
- package/src/components/custom-popover/index.js +3 -0
- package/src/components/custom-popover/styles.js +84 -0
- package/src/components/custom-popover/use-popover.js +22 -0
- package/src/components/custom-popover/utils.js +100 -0
- package/src/components/file-thumbnail/download-button.jsx +39 -0
- package/src/components/file-thumbnail/file-thumbnail.jsx +72 -0
- package/src/components/file-thumbnail/index.js +5 -0
- package/src/components/file-thumbnail/utils.js +148 -0
- package/src/components/image/image.jsx +119 -0
- package/src/components/image/index.js +1 -0
- package/src/components/image/utils.js +15 -0
- package/src/components/label/index.js +1 -0
- package/src/components/label/label.jsx +51 -0
- package/src/components/label/styles.js +78 -0
- package/src/components/loading-screen/index.js +2 -0
- package/src/components/loading-screen/loading-screen.jsx +23 -0
- package/src/components/loading-screen/splash-screen.jsx +95 -0
- package/src/components/logo/index.js +1 -0
- package/src/components/logo/logo.jsx +61 -0
- package/src/components/logo/styles.js +17 -0
- package/src/components/nav-section/horizontal/index.js +1 -0
- package/src/components/nav-section/horizontal/nav-item.jsx +224 -0
- package/src/components/nav-section/horizontal/nav-list.jsx +113 -0
- package/src/components/nav-section/horizontal/nav-section-horizontal.jsx +41 -0
- package/src/components/nav-section/index.js +3 -0
- package/src/components/nav-section/mini/index.js +1 -0
- package/src/components/nav-section/mini/nav-item.jsx +242 -0
- package/src/components/nav-section/mini/nav-list.jsx +107 -0
- package/src/components/nav-section/mini/nav-section-mini.jsx +35 -0
- package/src/components/nav-section/vertical/index.js +1 -0
- package/src/components/nav-section/vertical/nav-item.jsx +294 -0
- package/src/components/nav-section/vertical/nav-list.jsx +66 -0
- package/src/components/nav-section/vertical/nav-section-vertical.jsx +74 -0
- package/src/components/scrollbar/index.js +1 -0
- package/src/components/scrollbar/scrollbar.jsx +39 -0
- package/src/components/scrollbar/styles.js +27 -0
- package/src/components/search-not-found/index.js +1 -0
- package/src/components/search-not-found/search-not-found.jsx +29 -0
- package/src/components/settings/context/index.js +2 -0
- package/src/components/settings/context/settings-context.js +14 -0
- package/src/components/settings/context/settings-provider.jsx +46 -0
- package/src/components/settings/drawer/base-option.jsx +52 -0
- package/src/components/settings/drawer/fullscreen-option.jsx +58 -0
- package/src/components/settings/drawer/index.js +1 -0
- package/src/components/settings/drawer/layout-options.jsx +144 -0
- package/src/components/settings/drawer/presets-options.jsx +53 -0
- package/src/components/settings/drawer/settings-drawer.jsx +189 -0
- package/src/components/settings/drawer/stretch-options.jsx +67 -0
- package/src/components/settings/index.js +3 -0
- package/src/components/svg-color/index.js +1 -0
- package/src/components/svg-color/svg-color.jsx +23 -0
- package/src/config/config.js +48 -0
- package/src/config/schemas.js +148 -0
- package/src/context/reducer.js +52 -0
- package/src/global.css +2 -0
- package/src/hooks/index.js +2 -0
- package/src/hooks/use-boolean.js +27 -0
- package/src/hooks/use-event-listener.js +34 -0
- package/src/hooks/use-local-storage.js +89 -0
- package/src/hooks/use-off-set-top.js +37 -0
- package/src/hooks/use-responsive.js +47 -0
- package/src/hooks/use-scroll-to-top.js +14 -0
- package/src/hooks/use-user.js +58 -0
- package/src/hooks/useApi.js +25 -0
- package/src/hooks/useItemsState.js +23 -0
- package/src/hooks/useProjects.js +24 -0
- package/src/hooks/useSettings.jsx +51 -0
- package/src/http/index.js +155 -0
- package/src/http/oauth.js +27 -0
- package/src/http/user.js +110 -0
- package/src/layouts/AppLayout.jsx +113 -0
- package/src/layouts/CompactLayout/CompactLayout.jsx +32 -0
- package/src/layouts/CompactLayout/index.js +1 -0
- package/src/layouts/DashboardLayout/DashboardLayout.jsx +87 -0
- package/src/layouts/DashboardLayout/config-navigation.jsx +0 -0
- package/src/layouts/DashboardLayout/header.jsx +104 -0
- package/src/layouts/DashboardLayout/index.js +2 -0
- package/src/layouts/DashboardLayout/main.jsx +64 -0
- package/src/layouts/DashboardLayout/nav-horizontal.jsx +62 -0
- package/src/layouts/DashboardLayout/nav-mini.jsx +99 -0
- package/src/layouts/DashboardLayout/nav-vertical.jsx +201 -0
- package/src/layouts/FullScreenLayout/FullScreenLayout.jsx +101 -0
- package/src/layouts/FullScreenLayout/index.js +1 -0
- package/src/layouts/FullScreenLayout/nav-horizontal.jsx +50 -0
- package/src/layouts/FullScreenLayout/nav-vertical.jsx +136 -0
- package/src/layouts/MainLayout/MainLayout.jsx +21 -0
- package/src/layouts/MainLayout/footer.jsx +153 -0
- package/src/layouts/MainLayout/header.jsx +81 -0
- package/src/layouts/MainLayout/index.js +1 -0
- package/src/layouts/MainLayout/nav/desktop/index.jsx +20 -0
- package/src/layouts/MainLayout/nav/desktop/nav-item.jsx +186 -0
- package/src/layouts/MainLayout/nav/desktop/nav-list.jsx +145 -0
- package/src/layouts/MainLayout/nav/mobile/index.jsx +60 -0
- package/src/layouts/MainLayout/nav/mobile/nav-item.jsx +90 -0
- package/src/layouts/MainLayout/nav/mobile/nav-list.jsx +72 -0
- package/src/layouts/Page.jsx +16 -0
- package/src/layouts/SimpleLayout/SimpleLayout.jsx +8 -0
- package/src/layouts/SimpleLayout/index.js +1 -0
- package/src/layouts/TwoSideLayout/TwoSideLayout.jsx +31 -0
- package/src/layouts/TwoSideLayout/index.js +1 -0
- package/src/layouts/auth/classic.jsx +95 -0
- package/src/layouts/auth/modern-compact.jsx +51 -0
- package/src/layouts/auth/modern.jsx +94 -0
- package/src/layouts/common/ProjectBar/index.jsx +325 -0
- package/src/layouts/common/ProjectBar/result-item.jsx +90 -0
- package/src/layouts/common/ProjectBar/utils.js +86 -0
- package/src/layouts/common/account-popover.jsx +116 -0
- package/src/layouts/common/header-shadow.jsx +26 -0
- package/src/layouts/common/header-sim.jsx +52 -0
- package/src/layouts/common/header-simple.jsx +76 -0
- package/src/layouts/common/nav-toggle-button.jsx +57 -0
- package/src/layouts/common/notifications-popover/index.jsx +177 -0
- package/src/layouts/common/notifications-popover/notification-item.jsx +252 -0
- package/src/layouts/common/settings-button.jsx +48 -0
- package/src/layouts/config-layout.js +12 -0
- package/src/layouts/index.js +7 -0
- package/src/lib/AddItemWizard/AddItemWizard.jsx +211 -0
- package/src/lib/AddItemWizard/index.js +1 -0
- package/src/lib/CustomBreadcrumbs/CustomBreadcrumbs.jsx +88 -0
- package/src/lib/CustomBreadcrumbs/index.js +1 -0
- package/src/lib/CustomBreadcrumbs/link-item.jsx +58 -0
- package/src/lib/CustomPopover/CustomPopover.jsx +46 -0
- package/src/lib/CustomPopover/index.js +3 -0
- package/src/lib/CustomPopover/styles.js +82 -0
- package/src/lib/CustomPopover/usePopover.js +20 -0
- package/src/lib/CustomPopover/utils.js +100 -0
- package/src/lib/Flow/connectors/DynamicConnector.jsx +247 -0
- package/src/lib/Flow/core/Flow.jsx +79 -0
- package/src/lib/Flow/core/FlowNode.jsx +68 -0
- package/src/lib/Flow/core/FlowViewport.jsx +259 -0
- package/src/lib/Flow/graph/FloatingGraph.jsx +44 -0
- package/src/lib/Flow/hooks/useGraphOperations.js +362 -0
- package/src/lib/Flow/hooks/useNodeStyle.js +56 -0
- package/src/lib/Flow/index.js +1 -0
- package/src/lib/Flow/layouts/ActionNode.jsx +78 -0
- package/src/lib/Flow/layouts/AnimatedNode.jsx +22 -0
- package/src/lib/Flow/layouts/CardLayout.jsx +397 -0
- package/src/lib/Flow/layouts/InfoNode.jsx +255 -0
- package/src/lib/Flow/layouts/LoadingNode.jsx +37 -0
- package/src/lib/Flow/nodes/DefaultCard.jsx +107 -0
- package/src/lib/Flow/nodes/DraggableNode.jsx +162 -0
- package/src/lib/Flow/nodes/FlowNodeView.jsx +214 -0
- package/src/lib/Flow/selection/SelectionContext.jsx +259 -0
- package/src/lib/Flow/selection/SelectionOverlay.jsx +31 -0
- package/src/lib/Flow/styles.js +154 -0
- package/src/lib/Flow/utils/flowUtils.js +268 -0
- package/src/lib/FormProvider/FormProvider.jsx +16 -0
- package/src/lib/FormProvider/index.js +1 -0
- package/src/lib/IconSelector/IconSelector.jsx +89 -0
- package/src/lib/Iconify/Iconify.jsx +17 -0
- package/src/lib/Iconify/index.js +1 -0
- package/src/lib/Image/Image.jsx +116 -0
- package/src/lib/Image/index.js +1 -0
- package/src/lib/Image/utils.js +15 -0
- package/src/lib/ItemSummary/ItemSummary.jsx +77 -0
- package/src/lib/ItemSummary/ItemsSummary.jsx +163 -0
- package/src/lib/Label/Label.jsx +51 -0
- package/src/lib/Label/index.js +1 -0
- package/src/lib/Label/styles.js +76 -0
- package/src/lib/ProjectWizard.jsx +137 -0
- package/src/lib/RHFTextfield/RHFTextfield.jsx +39 -0
- package/src/lib/RHFTextfield/index.js +1 -0
- package/src/lib/Scrollbar/Scrollbar.jsx +39 -0
- package/src/lib/Scrollbar/index.js +1 -0
- package/src/lib/Scrollbar/styles.js +27 -0
- package/src/lib/SearchNotFound/SearchNotFound.jsx +29 -0
- package/src/lib/SearchNotFound/index.js +1 -0
- package/src/lib/SparkleInput/SparkleInput.jsx +51 -0
- package/src/lib/StepComponent/StepComponent.jsx +98 -0
- package/src/lib/SvgColor/SvgColor.jsx +28 -0
- package/src/lib/SvgColor/index.js +1 -0
- package/src/lib/TableHeadCustom/TableHeadCustom.jsx +87 -0
- package/src/lib/TableHeadCustom/index.js +1 -0
- package/src/lib/TableSelectedAction/TableSelectedAction.jsx +72 -0
- package/src/lib/TableSelectedAction/index.js +1 -0
- package/src/lib/index.js +36 -0
- package/src/lib/lib/Icons.js +40 -0
- package/src/lib/lib/context.json +272 -0
- package/src/lib/useChart/useChart.js +179 -0
- package/src/lib/useTable/useTable.js +121 -0
- package/src/pages/404.jsx +17 -0
- package/src/pages/Callback.jsx +126 -0
- package/src/pages/ConfigError.jsx +49 -0
- package/src/pages/LoginPage.jsx +43 -0
- package/src/routes/components/index.js +1 -0
- package/src/routes/components/router-link.jsx +11 -0
- package/src/routes/hooks/index.js +4 -0
- package/src/routes/hooks/use-active-link.js +15 -0
- package/src/routes/hooks/use-pathname.js +10 -0
- package/src/routes/hooks/use-router.js +21 -0
- package/src/stories/FlowChart.stories.jsx +333 -0
- package/src/stories/Iconify.stories.jsx +183 -0
- package/src/stories/Label.stories.jsx +447 -0
- package/src/stories/Navbar.stories.jsx +588 -0
- package/src/theme/css.js +152 -0
- package/src/theme/custom-shadows.js +47 -0
- package/src/theme/index.jsx +100 -0
- package/src/theme/options/contrast.js +34 -0
- package/src/theme/options/presets.js +89 -0
- package/src/theme/options/right-to-left.jsx +26 -0
- package/src/theme/overrides/components/accordion.js +43 -0
- package/src/theme/overrides/components/alert.js +69 -0
- package/src/theme/overrides/components/appbar.js +13 -0
- package/src/theme/overrides/components/autocomplete.js +44 -0
- package/src/theme/overrides/components/avatar.js +111 -0
- package/src/theme/overrides/components/backdrop.js +18 -0
- package/src/theme/overrides/components/badge.js +90 -0
- package/src/theme/overrides/components/breadcrumbs.js +21 -0
- package/src/theme/overrides/components/button-group.js +90 -0
- package/src/theme/overrides/components/button.js +145 -0
- package/src/theme/overrides/components/card.js +30 -0
- package/src/theme/overrides/components/checkbox.js +13 -0
- package/src/theme/overrides/components/chip.js +129 -0
- package/src/theme/overrides/components/css-baseline.js +48 -0
- package/src/theme/overrides/components/data-grid.js +94 -0
- package/src/theme/overrides/components/date-picker.jsx +94 -0
- package/src/theme/overrides/components/dialog.js +49 -0
- package/src/theme/overrides/components/drawer.js +39 -0
- package/src/theme/overrides/components/fab.js +165 -0
- package/src/theme/overrides/components/list.js +33 -0
- package/src/theme/overrides/components/loading-button.js +30 -0
- package/src/theme/overrides/components/menu.js +15 -0
- package/src/theme/overrides/components/pagination.js +81 -0
- package/src/theme/overrides/components/paper.js +18 -0
- package/src/theme/overrides/components/popover.js +20 -0
- package/src/theme/overrides/components/progress.js +40 -0
- package/src/theme/overrides/components/radio.js +22 -0
- package/src/theme/overrides/components/rating.js +40 -0
- package/src/theme/overrides/components/select.js +26 -0
- package/src/theme/overrides/components/skeleton.js +16 -0
- package/src/theme/overrides/components/slider.js +30 -0
- package/src/theme/overrides/components/stepper.js +13 -0
- package/src/theme/overrides/components/svg-icon.js +15 -0
- package/src/theme/overrides/components/switch.js +66 -0
- package/src/theme/overrides/components/table.js +79 -0
- package/src/theme/overrides/components/tabs.js +39 -0
- package/src/theme/overrides/components/textfield.js +146 -0
- package/src/theme/overrides/components/timeline.js +20 -0
- package/src/theme/overrides/components/toggle-button.js +70 -0
- package/src/theme/overrides/components/tooltip.js +18 -0
- package/src/theme/overrides/components/tree-view.js +16 -0
- package/src/theme/overrides/components/typography.js +16 -0
- package/src/theme/overrides/default-props.jsx +238 -0
- package/src/theme/overrides/index.js +100 -0
- package/src/theme/palette.js +144 -0
- package/src/theme/shadows.js +41 -0
- package/src/theme/typography.js +107 -0
- package/src/utils/flatten-array.js +16 -0
- package/src/utils/format-number.js +37 -0
- package/src/utils/format-time.js +27 -0
- package/src/utils/storage-available.js +24 -0
- package/src/widgets/Login/CognitoLogin.jsx +43 -0
- package/src/widgets/Login/Login.jsx +58 -0
- package/src/widgets/Login/cognitoAuth.jsx +26 -0
- package/src/widgets/LoginForm/LoginForm.jsx +87 -0
- package/src/widgets/LoginForm/LoginFormStyles.js +43 -0
- package/src/widgets/LoginForm/index.js +1 -0
- package/src/widgets/SettingsDialog.jsx +308 -0
- package/src/widgets/error/index.js +1 -0
- package/src/widgets/error/not-found-view.jsx +42 -0
- package/vite/vite.js +77 -0
- package/vite.config.js +7 -0
- package/vitest.config.js +32 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import AppBar from "@mui/material/AppBar";
|
|
2
|
+
import { HEADER } from "../config-layout";
|
|
3
|
+
import HeaderShadow from "../common/header-shadow";
|
|
4
|
+
import { NavSectionHorizontal } from "../../components/nav-section";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import Scrollbar from "../../components/scrollbar";
|
|
7
|
+
import Toolbar from "@mui/material/Toolbar";
|
|
8
|
+
import { bgBlur } from "../../theme/css";
|
|
9
|
+
import config from "../../config/config";
|
|
10
|
+
import { memo } from "react";
|
|
11
|
+
import { useTheme } from "@mui/material/styles";
|
|
12
|
+
import { useUser } from "../../hooks/use-user";
|
|
13
|
+
|
|
14
|
+
// ----------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
function NavHorizontal() {
|
|
17
|
+
const theme = useTheme();
|
|
18
|
+
|
|
19
|
+
const { user } = useUser();
|
|
20
|
+
|
|
21
|
+
const { sideMenu } = config().menu;
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<AppBar
|
|
25
|
+
data-cy="dashboard-layout-nav-horizontal"
|
|
26
|
+
component="div"
|
|
27
|
+
sx={{
|
|
28
|
+
top: HEADER.H_DESKTOP_OFFSET,
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
<Toolbar
|
|
32
|
+
sx={{
|
|
33
|
+
...bgBlur({
|
|
34
|
+
color: theme.palette.background.default,
|
|
35
|
+
}),
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
<Scrollbar
|
|
39
|
+
sx={{
|
|
40
|
+
"& .simplebar-content": {
|
|
41
|
+
display: "flex",
|
|
42
|
+
},
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
<NavSectionHorizontal
|
|
46
|
+
data={sideMenu}
|
|
47
|
+
slotProps={{
|
|
48
|
+
currentRole: user?.role,
|
|
49
|
+
}}
|
|
50
|
+
sx={{
|
|
51
|
+
...theme.mixins.toolbar,
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
54
|
+
</Scrollbar>
|
|
55
|
+
</Toolbar>
|
|
56
|
+
|
|
57
|
+
<HeaderShadow />
|
|
58
|
+
</AppBar>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default memo(NavHorizontal);
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import Box from "@mui/material/Box";
|
|
2
|
+
import Button from "@mui/material/Button";
|
|
3
|
+
import Iconify from "../../components/Iconify";
|
|
4
|
+
import Logo from "../../components/logo";
|
|
5
|
+
import { NAV } from "../config-layout";
|
|
6
|
+
import { NavSectionMini } from "../../components/nav-section";
|
|
7
|
+
import NavToggleButton from "../common/nav-toggle-button";
|
|
8
|
+
import SettingsDialog from "../../widgets/SettingsDialog";
|
|
9
|
+
import Stack from "@mui/material/Stack";
|
|
10
|
+
import config from "../../config/config";
|
|
11
|
+
import { hideScroll } from "../../theme/css";
|
|
12
|
+
import { useResponsive } from "../../hooks/use-responsive";
|
|
13
|
+
import { useUser } from "../../hooks/use-user";
|
|
14
|
+
|
|
15
|
+
import React, { useState } from "react";
|
|
16
|
+
|
|
17
|
+
export default function NavMini({ only }) {
|
|
18
|
+
const { user } = useUser();
|
|
19
|
+
const { sideMenu, actionButtons } = config().menu;
|
|
20
|
+
const [openSettings, setOpenSettings] = useState(false);
|
|
21
|
+
const lgUp = useResponsive("up", "lg");
|
|
22
|
+
const handleCloseSettings = () => {
|
|
23
|
+
setOpenSettings(false);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Box
|
|
28
|
+
data-cy="nav-mini"
|
|
29
|
+
sx={{
|
|
30
|
+
flexShrink: { lg: 0 },
|
|
31
|
+
width: { lg: NAV.W_MINI },
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
{!only && (
|
|
35
|
+
<NavToggleButton
|
|
36
|
+
sx={{
|
|
37
|
+
top: 22,
|
|
38
|
+
left: NAV.W_MINI - 12,
|
|
39
|
+
}}
|
|
40
|
+
/>
|
|
41
|
+
)}
|
|
42
|
+
|
|
43
|
+
<Stack
|
|
44
|
+
sx={{
|
|
45
|
+
pb: 2,
|
|
46
|
+
height: 1,
|
|
47
|
+
position: "fixed",
|
|
48
|
+
width: NAV.W_MINI,
|
|
49
|
+
borderRight: (theme) => `dashed 1px ${theme.palette.divider}`,
|
|
50
|
+
...hideScroll.x,
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
<Logo sx={{ mx: "auto", my: 2 }} />
|
|
54
|
+
<NavSectionMini
|
|
55
|
+
data={sideMenu}
|
|
56
|
+
slotProps={{
|
|
57
|
+
currentRole: user?.role,
|
|
58
|
+
}}
|
|
59
|
+
/>
|
|
60
|
+
<Box sx={{ flexGrow: 1 }} />
|
|
61
|
+
<Stack
|
|
62
|
+
direction={"column"}
|
|
63
|
+
alignItems={"center"}
|
|
64
|
+
justifyItems={"center"}
|
|
65
|
+
sx={{
|
|
66
|
+
marginBottom: 0,
|
|
67
|
+
position: lgUp ? "static" : "fixed",
|
|
68
|
+
bottom: lgUp ? "auto" : 66,
|
|
69
|
+
width: "100%",
|
|
70
|
+
}}
|
|
71
|
+
gap={2}
|
|
72
|
+
>
|
|
73
|
+
{actionButtons &&
|
|
74
|
+
actionButtons.map((Action, index) => (
|
|
75
|
+
<Box key={index} component={Action}></Box>
|
|
76
|
+
))}
|
|
77
|
+
<Button
|
|
78
|
+
onClick={() => setOpenSettings(true)}
|
|
79
|
+
sx={{
|
|
80
|
+
position: lgUp ? "static" : "fixed",
|
|
81
|
+
bottom: lgUp ? "auto" : 16,
|
|
82
|
+
width: "100%",
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
<Iconify
|
|
86
|
+
icon={"ic:baseline-settings"}
|
|
87
|
+
sx={{
|
|
88
|
+
width: 32,
|
|
89
|
+
height: 32,
|
|
90
|
+
color: "text.secondary",
|
|
91
|
+
}}
|
|
92
|
+
/>
|
|
93
|
+
</Button>
|
|
94
|
+
</Stack>
|
|
95
|
+
<SettingsDialog open={openSettings} handleClose={handleCloseSettings} />
|
|
96
|
+
</Stack>
|
|
97
|
+
</Box>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import Box from "@mui/material/Box";
|
|
2
|
+
import Drawer from "@mui/material/Drawer";
|
|
3
|
+
import Iconify from "../../components/Iconify";
|
|
4
|
+
import { Link } from "react-router-dom";
|
|
5
|
+
import Logo from "../../components/logo";
|
|
6
|
+
import { NAV } from "../config-layout";
|
|
7
|
+
import { NavSectionVertical } from "../../components/nav-section";
|
|
8
|
+
import NavToggleButton from "../common/nav-toggle-button";
|
|
9
|
+
import React from "react";
|
|
10
|
+
import Scrollbar from "../../components/scrollbar";
|
|
11
|
+
import SettingsDialog from "../../widgets/SettingsDialog";
|
|
12
|
+
import Stack from "@mui/material/Stack";
|
|
13
|
+
import config from "../../config/config";
|
|
14
|
+
import styles from "../../components/logo/styles";
|
|
15
|
+
import { useEvent } from "@nucleoidai/react-event";
|
|
16
|
+
import { usePathname } from "../../routes/hooks/use-pathname";
|
|
17
|
+
import { useResponsive } from "../../hooks/use-responsive";
|
|
18
|
+
import { useUser } from "../../hooks/use-user";
|
|
19
|
+
|
|
20
|
+
import { Button, Typography } from "@mui/material";
|
|
21
|
+
import { useEffect, useState } from "react";
|
|
22
|
+
|
|
23
|
+
// ----------------------------------------------------------------------
|
|
24
|
+
|
|
25
|
+
export default function NavVertical({ openNav, onCloseNav }) {
|
|
26
|
+
const { user } = useUser();
|
|
27
|
+
const pathname = usePathname();
|
|
28
|
+
const [openSettings, setOpenSettings] = useState(false);
|
|
29
|
+
const [hideSubheader] = useEvent("PAGE_CHANGED", { subheader: "" });
|
|
30
|
+
const { sideMenu, actionButtons } = config().menu;
|
|
31
|
+
const lgUp = useResponsive("up", "lg");
|
|
32
|
+
const { beta, name } = config();
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const index = sideMenu.findIndex(
|
|
36
|
+
(item) => item.subheader === hideSubheader.subheader
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
if (index !== -1) {
|
|
40
|
+
sideMenu.splice(index, 1);
|
|
41
|
+
}
|
|
42
|
+
}, [hideSubheader]);
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (openNav) {
|
|
46
|
+
onCloseNav();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
|
+
}, [pathname]);
|
|
51
|
+
|
|
52
|
+
const handleCloseSettings = () => {
|
|
53
|
+
setOpenSettings(false);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const renderContent = (
|
|
57
|
+
<Scrollbar
|
|
58
|
+
sx={{
|
|
59
|
+
height: 1,
|
|
60
|
+
"& .simplebar-content": {
|
|
61
|
+
height: 1,
|
|
62
|
+
display: "flex",
|
|
63
|
+
flexDirection: "column",
|
|
64
|
+
},
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
{beta ? (
|
|
68
|
+
<Box
|
|
69
|
+
sx={{
|
|
70
|
+
display: "flex",
|
|
71
|
+
alignItems: "center",
|
|
72
|
+
ml: 1,
|
|
73
|
+
mt: 3,
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
<Logo sx={{ ml: 4, mb: 1 }} />
|
|
77
|
+
<Link to="/" style={{ textDecoration: "none", color: "white" }}>
|
|
78
|
+
<Typography
|
|
79
|
+
sx={{
|
|
80
|
+
ml: 1,
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
{name}
|
|
84
|
+
</Typography>
|
|
85
|
+
</Link>
|
|
86
|
+
<Typography
|
|
87
|
+
sx={{
|
|
88
|
+
...styles.neon,
|
|
89
|
+
position: "relative",
|
|
90
|
+
bottom: -10,
|
|
91
|
+
ml: 1,
|
|
92
|
+
fontSize: 12,
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
95
|
+
Beta
|
|
96
|
+
</Typography>
|
|
97
|
+
</Box>
|
|
98
|
+
) : (
|
|
99
|
+
<Box
|
|
100
|
+
sx={{
|
|
101
|
+
display: "flex",
|
|
102
|
+
alignItems: "center",
|
|
103
|
+
ml: 1,
|
|
104
|
+
mt: 3,
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
<Logo sx={{ ml: 4, mb: 1 }} />
|
|
108
|
+
<Typography
|
|
109
|
+
sx={{
|
|
110
|
+
ml: 1,
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
{name}
|
|
114
|
+
</Typography>
|
|
115
|
+
</Box>
|
|
116
|
+
)}
|
|
117
|
+
<NavSectionVertical
|
|
118
|
+
data={sideMenu}
|
|
119
|
+
slotProps={{
|
|
120
|
+
currentRole: user?.role,
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
<Box sx={{ flexGrow: 1 }} />
|
|
124
|
+
<Stack
|
|
125
|
+
direction={"column"}
|
|
126
|
+
alignItems={"center"}
|
|
127
|
+
justifyItems={"center"}
|
|
128
|
+
sx={{
|
|
129
|
+
marginBottom: lgUp ? 3 : 0,
|
|
130
|
+
position: lgUp ? "static" : "fixed",
|
|
131
|
+
bottom: lgUp ? "auto" : 66,
|
|
132
|
+
width: "100%",
|
|
133
|
+
}}
|
|
134
|
+
gap={2}
|
|
135
|
+
>
|
|
136
|
+
{actionButtons &&
|
|
137
|
+
actionButtons?.map((Action, index) => (
|
|
138
|
+
<Box key={index} component={Action}></Box>
|
|
139
|
+
))}
|
|
140
|
+
</Stack>
|
|
141
|
+
|
|
142
|
+
<Button
|
|
143
|
+
data-cy="end-item"
|
|
144
|
+
fullWidth={true}
|
|
145
|
+
onClick={() => setOpenSettings(true)}
|
|
146
|
+
sx={{
|
|
147
|
+
position: lgUp ? "static" : "fixed",
|
|
148
|
+
bottom: lgUp ? "auto" : 16,
|
|
149
|
+
width: "100%",
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
<Iconify
|
|
153
|
+
icon={"ic:baseline-settings"}
|
|
154
|
+
sx={{
|
|
155
|
+
width: 32,
|
|
156
|
+
height: 32,
|
|
157
|
+
color: "text.secondary",
|
|
158
|
+
mx: "auto",
|
|
159
|
+
}}
|
|
160
|
+
/>
|
|
161
|
+
</Button>
|
|
162
|
+
<SettingsDialog open={openSettings} handleClose={handleCloseSettings} />
|
|
163
|
+
</Scrollbar>
|
|
164
|
+
);
|
|
165
|
+
return (
|
|
166
|
+
<Box
|
|
167
|
+
data-cy="nav-vertical"
|
|
168
|
+
sx={{
|
|
169
|
+
flexShrink: { lg: 0 },
|
|
170
|
+
width: { lg: NAV.W_VERTICAL },
|
|
171
|
+
}}
|
|
172
|
+
>
|
|
173
|
+
<NavToggleButton />
|
|
174
|
+
|
|
175
|
+
{lgUp ? (
|
|
176
|
+
<Stack
|
|
177
|
+
sx={{
|
|
178
|
+
height: 1,
|
|
179
|
+
position: "fixed",
|
|
180
|
+
width: NAV.W_VERTICAL,
|
|
181
|
+
borderRight: (theme) => `dashed 1px ${theme.palette.divider}`,
|
|
182
|
+
}}
|
|
183
|
+
>
|
|
184
|
+
{renderContent}
|
|
185
|
+
</Stack>
|
|
186
|
+
) : (
|
|
187
|
+
<Drawer
|
|
188
|
+
open={openNav}
|
|
189
|
+
onClose={onCloseNav}
|
|
190
|
+
PaperProps={{
|
|
191
|
+
sx: {
|
|
192
|
+
width: NAV.W_VERTICAL,
|
|
193
|
+
},
|
|
194
|
+
}}
|
|
195
|
+
>
|
|
196
|
+
{renderContent}
|
|
197
|
+
</Drawer>
|
|
198
|
+
)}
|
|
199
|
+
</Box>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import Box from "@mui/material/Box";
|
|
2
|
+
import NavHorizontal from "./nav-horizontal";
|
|
3
|
+
import NavMini from "../DashboardLayout/nav-mini";
|
|
4
|
+
import NavVertical from "./nav-vertical";
|
|
5
|
+
import { Outlet } from "react-router";
|
|
6
|
+
import Stack from "@mui/material/Stack";
|
|
7
|
+
import config from "../../config/config";
|
|
8
|
+
import { useEvent } from "@nucleoidai/react-event";
|
|
9
|
+
import { useResponsive } from "../../hooks/use-responsive";
|
|
10
|
+
|
|
11
|
+
import React, { useEffect, useState } from "react";
|
|
12
|
+
|
|
13
|
+
// ----------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
export default function FullScreenLayout() {
|
|
16
|
+
const { fullScreenLayout } = config().menu;
|
|
17
|
+
|
|
18
|
+
const renderNavMini = <NavMini only={true} />;
|
|
19
|
+
const renderHorizontal = <NavHorizontal />;
|
|
20
|
+
|
|
21
|
+
const lgUp = useResponsive("up", "lg");
|
|
22
|
+
|
|
23
|
+
const [nav, setNav] = useState(false);
|
|
24
|
+
|
|
25
|
+
const [openNav] = useEvent("PLATFORM_NAV_OPENED", { layout: null });
|
|
26
|
+
const [closeNav] = useEvent("PLATFORM_NAV_CLOSED", { layout: null });
|
|
27
|
+
|
|
28
|
+
console.log(openNav, closeNav);
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (openNav.layout === "fullScreen") {
|
|
32
|
+
setNav(true);
|
|
33
|
+
}
|
|
34
|
+
}, [openNav]);
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (closeNav.layout === "fullScreen") {
|
|
38
|
+
setNav(false);
|
|
39
|
+
}
|
|
40
|
+
}, [closeNav]);
|
|
41
|
+
|
|
42
|
+
const renderNavVertical = (
|
|
43
|
+
<NavVertical openNav={nav} onCloseNav={() => setNav(false)} />
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const render = () => {
|
|
47
|
+
switch (fullScreenLayout) {
|
|
48
|
+
case "right":
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<Outlet />
|
|
52
|
+
{renderNavMini}
|
|
53
|
+
</>
|
|
54
|
+
);
|
|
55
|
+
case "left":
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
{renderNavMini}
|
|
59
|
+
<Outlet />
|
|
60
|
+
</>
|
|
61
|
+
);
|
|
62
|
+
case "top":
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
{renderHorizontal}
|
|
66
|
+
<Stack width={"100%"} sx={{ mt: 7 }}>
|
|
67
|
+
<Outlet />
|
|
68
|
+
</Stack>
|
|
69
|
+
</>
|
|
70
|
+
);
|
|
71
|
+
default:
|
|
72
|
+
return (
|
|
73
|
+
<>
|
|
74
|
+
{renderNavMini}
|
|
75
|
+
<Outlet />
|
|
76
|
+
</>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<>
|
|
83
|
+
<Box
|
|
84
|
+
sx={{
|
|
85
|
+
minHeight: 1,
|
|
86
|
+
display: "flex",
|
|
87
|
+
flexDirection: { xs: "column", lg: "row" },
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
{lgUp ? (
|
|
91
|
+
render()
|
|
92
|
+
) : (
|
|
93
|
+
<>
|
|
94
|
+
{renderNavVertical}
|
|
95
|
+
<Outlet />
|
|
96
|
+
</>
|
|
97
|
+
)}
|
|
98
|
+
</Box>
|
|
99
|
+
</>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./FullScreenLayout";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import AppBar from "@mui/material/AppBar";
|
|
2
|
+
import HeaderShadow from "../common/header-shadow";
|
|
3
|
+
import { NavSectionHorizontal } from "../../components/nav-section";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import Toolbar from "@mui/material/Toolbar";
|
|
6
|
+
import { bgBlur } from "../../theme/css";
|
|
7
|
+
import config from "../../config/config";
|
|
8
|
+
import { memo } from "react";
|
|
9
|
+
import { useTheme } from "@mui/material/styles";
|
|
10
|
+
import { useUser } from "../../hooks/use-user";
|
|
11
|
+
|
|
12
|
+
// ----------------------------------------------------------------------
|
|
13
|
+
|
|
14
|
+
function NavHorizontal() {
|
|
15
|
+
const theme = useTheme();
|
|
16
|
+
|
|
17
|
+
const { user } = useUser();
|
|
18
|
+
|
|
19
|
+
const { sideMenu, actionButtons } = config().menu;
|
|
20
|
+
return (
|
|
21
|
+
<AppBar component="div" data-cy="nav-horizontal">
|
|
22
|
+
<Toolbar
|
|
23
|
+
sx={{
|
|
24
|
+
...bgBlur({
|
|
25
|
+
color: theme.palette.background.default,
|
|
26
|
+
}),
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
<NavSectionHorizontal
|
|
30
|
+
data={sideMenu}
|
|
31
|
+
slotProps={{
|
|
32
|
+
currentRole: user?.role,
|
|
33
|
+
}}
|
|
34
|
+
sx={{
|
|
35
|
+
...theme.mixins.toolbar,
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
{actionButtons &&
|
|
40
|
+
actionButtons.map((Action, index) => (
|
|
41
|
+
<Box key={index} component={Action}></Box>
|
|
42
|
+
))}
|
|
43
|
+
</Toolbar>
|
|
44
|
+
|
|
45
|
+
<HeaderShadow />
|
|
46
|
+
</AppBar>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default memo(NavHorizontal);
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import Box from "@mui/material/Box";
|
|
2
|
+
import Button from "@mui/material/Button";
|
|
3
|
+
import Drawer from "@mui/material/Drawer";
|
|
4
|
+
import Iconify from "../../components/Iconify";
|
|
5
|
+
import Logo from "../../components/logo";
|
|
6
|
+
import { NAV } from "../config-layout";
|
|
7
|
+
import { NavSectionVertical } from "../../components/nav-section";
|
|
8
|
+
import NavToggleButton from "../common/nav-toggle-button";
|
|
9
|
+
import Scrollbar from "../../components/scrollbar";
|
|
10
|
+
import SettingsDialog from "../../widgets/SettingsDialog";
|
|
11
|
+
import Stack from "@mui/material/Stack";
|
|
12
|
+
import config from "../../config/config";
|
|
13
|
+
import { useEffect } from "react";
|
|
14
|
+
import { usePathname } from "../../routes/hooks/use-pathname";
|
|
15
|
+
import { useResponsive } from "../../hooks/use-responsive";
|
|
16
|
+
import { useUser } from "../../hooks/use-user";
|
|
17
|
+
|
|
18
|
+
import React, { useState } from "react";
|
|
19
|
+
|
|
20
|
+
// ----------------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
export default function NavVertical({ openNav, onCloseNav }) {
|
|
23
|
+
const { user } = useUser();
|
|
24
|
+
|
|
25
|
+
const pathname = usePathname();
|
|
26
|
+
|
|
27
|
+
const lgUp = useResponsive("up", "lg");
|
|
28
|
+
|
|
29
|
+
const { sideMenu, actionButtons } = config().menu;
|
|
30
|
+
|
|
31
|
+
const [openSettings, setOpenSettings] = useState(false);
|
|
32
|
+
|
|
33
|
+
const handleCloseSettings = () => {
|
|
34
|
+
setOpenSettings(false);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (openNav) {
|
|
39
|
+
onCloseNav();
|
|
40
|
+
}
|
|
41
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
+
}, [pathname]);
|
|
43
|
+
|
|
44
|
+
const renderContent = (
|
|
45
|
+
<Scrollbar
|
|
46
|
+
sx={{
|
|
47
|
+
height: 1,
|
|
48
|
+
"& .simplebar-content": {
|
|
49
|
+
height: 1,
|
|
50
|
+
display: "flex",
|
|
51
|
+
flexDirection: "column",
|
|
52
|
+
},
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
<Logo sx={{ mt: 3, ml: 4, mb: 1 }} />
|
|
56
|
+
<NavSectionVertical
|
|
57
|
+
data={sideMenu}
|
|
58
|
+
slotProps={{
|
|
59
|
+
currentRole: user?.role,
|
|
60
|
+
}}
|
|
61
|
+
/>
|
|
62
|
+
<Box sx={{ flexGrow: 1 }} />
|
|
63
|
+
<Stack
|
|
64
|
+
direction={"column"}
|
|
65
|
+
alignItems={"center"}
|
|
66
|
+
justifyItems={"center"}
|
|
67
|
+
sx={{
|
|
68
|
+
marginBottom: lgUp ? 3 : 0,
|
|
69
|
+
position: lgUp ? "static" : "fixed",
|
|
70
|
+
bottom: lgUp ? "auto" : 66,
|
|
71
|
+
width: "100%",
|
|
72
|
+
}}
|
|
73
|
+
gap={2}
|
|
74
|
+
>
|
|
75
|
+
{actionButtons &&
|
|
76
|
+
actionButtons.map((Action, index) => (
|
|
77
|
+
<Box key={index} component={Action}></Box>
|
|
78
|
+
))}
|
|
79
|
+
<Button
|
|
80
|
+
onClick={() => setOpenSettings(true)}
|
|
81
|
+
sx={{
|
|
82
|
+
position: lgUp ? "static" : "fixed",
|
|
83
|
+
bottom: lgUp ? "auto" : 16,
|
|
84
|
+
width: "100%",
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
<Iconify
|
|
88
|
+
icon={"ic:baseline-settings"}
|
|
89
|
+
sx={{
|
|
90
|
+
width: 32,
|
|
91
|
+
height: 32,
|
|
92
|
+
color: "text.secondary",
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
</Button>
|
|
96
|
+
</Stack>
|
|
97
|
+
</Scrollbar>
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<Box
|
|
102
|
+
sx={{
|
|
103
|
+
flexShrink: { lg: 0 },
|
|
104
|
+
width: { lg: NAV.W_VERTICAL },
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
<NavToggleButton />
|
|
108
|
+
|
|
109
|
+
{lgUp ? (
|
|
110
|
+
<Stack
|
|
111
|
+
sx={{
|
|
112
|
+
height: 1,
|
|
113
|
+
position: "fixed",
|
|
114
|
+
width: NAV.W_VERTICAL,
|
|
115
|
+
borderRight: (theme) => `dashed 1px ${theme.palette.divider}`,
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
{renderContent}
|
|
119
|
+
</Stack>
|
|
120
|
+
) : (
|
|
121
|
+
<Drawer
|
|
122
|
+
open={openNav}
|
|
123
|
+
onClose={onCloseNav}
|
|
124
|
+
PaperProps={{
|
|
125
|
+
sx: {
|
|
126
|
+
width: NAV.W_VERTICAL,
|
|
127
|
+
},
|
|
128
|
+
}}
|
|
129
|
+
>
|
|
130
|
+
{renderContent}
|
|
131
|
+
</Drawer>
|
|
132
|
+
)}
|
|
133
|
+
<SettingsDialog open={openSettings} handleClose={handleCloseSettings} />
|
|
134
|
+
</Box>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Box from "@mui/material/Box";
|
|
2
|
+
import Header from "./header";
|
|
3
|
+
import { Outlet } from "react-router";
|
|
4
|
+
import React from "react";
|
|
5
|
+
|
|
6
|
+
export default function MainLayout() {
|
|
7
|
+
return (
|
|
8
|
+
<Box sx={{ display: "flex", flexDirection: "column", height: 1 }}>
|
|
9
|
+
<Header />
|
|
10
|
+
<Box
|
|
11
|
+
component="main"
|
|
12
|
+
sx={{
|
|
13
|
+
flexGrow: 1,
|
|
14
|
+
pt: { xs: 8, md: 10 },
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
<Outlet />
|
|
18
|
+
</Box>
|
|
19
|
+
</Box>
|
|
20
|
+
);
|
|
21
|
+
}
|