@campxdev/shared 1.11.56 → 1.11.57

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.57",
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,53 @@ 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
+
40
+ {window.innerWidth < 1024 && (
41
+ <>
42
+ <IconButton
43
+ color="inherit"
44
+ aria-label="open drawer"
45
+ onClick={handleDrawer}
46
+ edge="start"
47
+ sx={{ mr: 0.5 }}
48
+ >
49
+ <MenuIcon />
50
+ </IconButton>
51
+ {/* <Button
52
+ onClick={() => {
53
+ console.log('hi')
54
+ }}
55
+ // edge="start"
56
+ // sx={{ mr: 0.5 }}
57
+ >
58
+ <MenuIcon />
59
+ </Button> */}
60
+ <StyledDrawer
61
+ variant={'temporary'}
62
+ anchor="left"
63
+ open={open}
64
+ onClose={handleDrawer}
65
+ >
66
+ <SideNav menuItems={menu as any[]} header={sideMenuHeader} />
67
+ </StyledDrawer>
68
+ </>
69
+ )}
70
+
28
71
  <StyledMainContentContainer
29
72
  style={{
30
73
  width: permissions.isHomePageEnabled
@@ -44,3 +87,23 @@ export default function LayoutWrapper({
44
87
  </ErrorBoundary>
45
88
  )
46
89
  }
90
+
91
+ const drawerWidth: number = 240
92
+
93
+ export const StyledDrawer = styled(Drawer)(() => ({
94
+ width: drawerWidth,
95
+ flexShrink: 0,
96
+ '& .MuiDrawer-paper': {
97
+ width: drawerWidth,
98
+ boxSizing: 'border-box',
99
+ position: 'unset',
100
+ transition: 'none !important',
101
+ borderRight: 'none !important',
102
+ borderRadius: '5px',
103
+ },
104
+ ['@media (max-width: 1024px)']: {
105
+ '& .MuiDrawer-paper': {
106
+ borderRadius: '0px',
107
+ },
108
+ },
109
+ }))
@@ -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': {