@campxdev/shared 1.11.56 → 1.11.58

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.11.56",
3
+ "version": "1.11.58",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -1,3 +1,6 @@
1
+ import MenuIcon from '@mui/icons-material/Menu'
2
+ import { Drawer, IconButton, styled } from '@mui/material'
3
+ import { useState } from 'react'
1
4
  import {
2
5
  StyledLeftNavContainer,
3
6
  StyledMainContentContainer,
@@ -18,13 +21,22 @@ export default function LayoutWrapper({
18
21
  }: Props) {
19
22
  const permissions = PermissionsStore.useState()
20
23
 
24
+ const [open, setOpen] = useState<boolean>(false)
25
+
26
+ const handleDrawer = () => {
27
+ console.log('hi')
28
+ setOpen(!open)
29
+ }
30
+
31
+ console.log(window.innerWidth)
21
32
  return (
22
33
  <ErrorBoundary>
23
- {!permissions.isHomePageEnabled && (
34
+ {window.innerWidth > 1024 && !permissions.isHomePageEnabled && (
24
35
  <StyledLeftNavContainer>
25
36
  <SideNav menuItems={menu as any[]} header={sideMenuHeader} />
26
37
  </StyledLeftNavContainer>
27
38
  )}
39
+
28
40
  <StyledMainContentContainer
29
41
  style={{
30
42
  width: permissions.isHomePageEnabled
@@ -39,8 +51,58 @@ export default function LayoutWrapper({
39
51
  : 'calc(100vh - 64px)',
40
52
  }}
41
53
  >
54
+ {window.innerWidth < 1024 && (
55
+ <>
56
+ <IconButton
57
+ color="inherit"
58
+ aria-label="open drawer"
59
+ onClick={handleDrawer}
60
+ edge="start"
61
+ sx={{ mr: 0.5 }}
62
+ >
63
+ <MenuIcon />
64
+ </IconButton>
65
+ {/* <Button
66
+ onClick={() => {
67
+ console.log('hi')
68
+ }}
69
+ // edge="start"
70
+ // sx={{ mr: 0.5 }}
71
+ >
72
+ <MenuIcon />
73
+ </Button> */}
74
+ <StyledDrawer
75
+ variant={'temporary'}
76
+ anchor="left"
77
+ open={open}
78
+ onClose={handleDrawer}
79
+ >
80
+ <SideNav menuItems={menu as any[]} header={sideMenuHeader} />
81
+ </StyledDrawer>
82
+ </>
83
+ )}
42
84
  <ErrorBoundary>{children}</ErrorBoundary>
43
85
  </StyledMainContentContainer>
44
86
  </ErrorBoundary>
45
87
  )
46
88
  }
89
+
90
+ const drawerWidth: number = 240
91
+
92
+ export const StyledDrawer = styled(Drawer)(() => ({
93
+ width: drawerWidth,
94
+ flexShrink: 0,
95
+ '& .MuiDrawer-paper': {
96
+ width: drawerWidth,
97
+ boxSizing: 'border-box',
98
+ position: 'unset',
99
+ transition: 'none !important',
100
+ borderRight: 'none !important',
101
+ borderRadius: '5px',
102
+ },
103
+ ['@media (max-width: 1024px)']: {
104
+ '& .MuiDrawer-paper': {
105
+ borderRadius: '0px',
106
+ },
107
+ },
108
+ }))
@@ -75,7 +75,7 @@ export const StyledMainContentContainer = muiStyled('main')(() => ({
75
75
  left: 0,
76
76
  right: 0,
77
77
  bottom: 0,
78
- width: '100%',
78
+ width: '100% !important',
79
79
  },
80
80
 
81
81
  // '&::-webkit-scrollbar': {