Base Template

This commit is contained in:
2022-06-15 15:15:49 +07:00
parent 077e678979
commit f18bb85b94
47 changed files with 2597 additions and 1172 deletions

View File

@@ -6,6 +6,7 @@ import { Box, Divider, Typography, Stack, MenuItem, Avatar } from '@mui/material
import MenuPopover from '../../../components/MenuPopover';
import { IconButtonAnimate } from '../../../components/animate';
import { useNavigate } from "react-router-dom";
import useAuth from '../../../hooks/useAuth';
// ----------------------------------------------------------------------
@@ -29,6 +30,7 @@ const MENU_OPTIONS = [
export default function AccountPopover() {
const [open, setOpen] = useState<HTMLElement | null>(null);
const navigate = useNavigate();
const { logout } = useAuth();
const handleOpen = (event: React.MouseEvent<HTMLElement>) => {
setOpen(event.currentTarget);
@@ -39,6 +41,7 @@ export default function AccountPopover() {
};
const handleLogout = () => {
logout();
navigate('/auth/login');
}

View File

@@ -12,33 +12,73 @@ const ICONS = {
ecommerce: getIcon('ic_ecommerce'),
analytics: getIcon('ic_analytics'),
dashboard: getIcon('ic_dashboard'),
hospital: getIcon('ic_banking'),
};
const navConfig = [
// GENERAL
// ----------------------------------------------------------------------
{
subheader: 'general v3.2.0',
items: [
{ title: 'One', path: '/dashboard/one', icon: ICONS.dashboard },
{ title: 'Two', path: '/dashboard/two', icon: ICONS.ecommerce },
{ title: 'Three', path: '/dashboard/three', icon: ICONS.analytics },
{ title: 'Dashboard', path: '/dashboard', icon: ICONS.dashboard },
],
},
// MANAGEMENT
// Membership
// ----------------------------------------------------------------------
{
subheader: 'Management',
// subheader: 'DOCTORS & HOSPITALS',
items: [
// {
// title: 'Doctors',
// path: '/doctors',
// icon: ICONS.user,
// },
{
title: 'Master Data',
title: 'DOCTORS & HOSPITALS',
// path: '/',
icon: ICONS.user,
// icon: ICONS.user,
children: [
{ title: 'Obat', path: '/medicines' },
{ title: 'Doctors', path: '/doctors' },
{ title: 'Hospitals', path: '/hospitals' },
],
},
{
title: 'PHARMACY & DELIVERY MANAGEMENT',
children: [
{ title: 'Inventory', path: '/inventory' },
{ title: 'Delivery Services', path: '/delivery' },
],
},
{
title: 'STATION BENEFIT & MEMBERSHIP',
children: [
{ title: 'Corporate', path: '/corporates' },
{ title: 'Formularium', path: '/formularium' },
{ title: 'Diagnosis Library (ICD-X)', path: '/diagnosis' },
{ title: 'Hospitals', path: '/hospitals' },
],
},
{
title: 'CASE MANAGEMENT',
children: [
{ title: 'Request', path: '/case-request' },
],
},
{
title: 'CUSTOMER SERVICES',
children: [
{ title: 'Request', path: '/cs-request' },
],
},
{
title: 'USER MANAGEMENT',
path: '/users',
},
{
title: 'LINKING TOOLS',
path: '/linking',
},
],
},
];

View File

@@ -13,7 +13,7 @@ export default function NavbarDocs() {
>
<DocIllustration sx={{ width: 1 }} />
<div>
{/* <div>
<Typography gutterBottom variant="subtitle1">
Hi, Rayan Moran
</Typography>
@@ -23,7 +23,7 @@ export default function NavbarDocs() {
</Typography>
</div>
<Button variant="contained">Documentation</Button>
<Button variant="contained">Documentation</Button> */}
</Stack>
);
}

View File

@@ -2,7 +2,7 @@ import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';
// @mui
import { styled, useTheme } from '@mui/material/styles';
import { Box, Stack, Drawer } from '@mui/material';
import { Box, Stack, Drawer, Typography } from '@mui/material';
// hooks
import useResponsive from '../../../hooks/useResponsive';
import useCollapseDrawer from '../../../hooks/useCollapseDrawer';
@@ -72,13 +72,19 @@ export default function NavbarVertical({ isOpenSidebar, onCloseSidebar }: Props)
...(isCollapse && { alignItems: 'center' }),
}}
>
<Stack direction="row" alignItems="center" justifyContent="space-between">
<Logo />
{isDesktop && !isCollapse && (
{isDesktop && !isCollapse ? (
<Stack direction="row" alignItems="center" justifyContent="space-between">
<Stack direction="row" alignItems="center">
<Logo />
<Typography ml={3}>PRIME CENTER</Typography>
</Stack>
<CollapseButton onToggleCollapse={onToggleCollapse} collapseClick={collapseClick} />
)}
</Stack>
</Stack>)
: (
<Stack direction="row" alignItems="center" justifyContent="space-between">
<Logo />
</Stack>
)}
<NavbarAccount isCollapse={isCollapse} />
</Stack>