-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.tsx
73 lines (65 loc) · 1.75 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
'use client'
import { FC } from 'react'
import { Logo } from '@baseapp-frontend/design-system/components/web/logos'
import { useResponsive } from '@baseapp-frontend/design-system/hooks/web'
import { hideScroll } from '@baseapp-frontend/design-system/styles/web'
import Box from '@mui/material/Box'
import Stack from '@mui/material/Stack'
import NavToggleButton from '../__shared__/NavToggleButton'
import VerticalDrawer from '../__shared__/VerticalDrawer'
import { NAV_WIDTH } from '../constants'
import NavSectionMini from './NavSectionMini'
import { NavMiniProps } from './types'
const NavMini: FC<NavMiniProps> = ({
navData,
settings,
setSettings,
LogoIcon,
LogoProps,
openNav,
onCloseNav,
hideToggleButton = false,
}) => {
const lgDown = useResponsive('down', 'lg')
if (lgDown) {
return <VerticalDrawer navData={navData} openNav={openNav} onCloseNav={onCloseNav} />
}
return (
<Box
sx={{
flexShrink: { lg: 0 },
width: { lg: NAV_WIDTH.MINI },
display: { xs: 'none', lg: 'flex' },
}}
>
{!hideToggleButton && (
<NavToggleButton
settings={settings}
setSettings={setSettings}
sx={{
top: 22,
left: NAV_WIDTH.MINI - 12,
}}
/>
)}
<Stack
sx={{
pb: 2,
height: 1,
position: 'fixed',
width: NAV_WIDTH.MINI,
borderRight: (theme) => `solid 1px ${theme.palette.divider}`,
...hideScroll.x,
}}
>
{LogoIcon && (
<Logo {...LogoProps} sx={{ mx: 'auto', my: 2, ...LogoProps?.sx }}>
<LogoIcon />
</Logo>
)}
<NavSectionMini navData={navData} />
</Stack>
</Box>
)
}
export default NavMini