File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed
apps/learner-web-app/src/app/profile Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,10 @@ type FilterDetails = {
1717const ProfilePage = ( ) => {
1818 const [ filters ] = useState < FilterDetails > ( {
1919 status : [ 'completed' , 'viewCertificate' ] ,
20- tenantId : localStorage . getItem ( 'tenantId' ) || '' ,
21- userId : localStorage . getItem ( 'userId' ) || '' ,
20+ tenantId :
21+ ( typeof window !== 'undefined' && localStorage . getItem ( 'tenantId' ) ) || '' ,
22+ userId :
23+ ( typeof window !== 'undefined' && localStorage . getItem ( 'userId' ) ) || '' ,
2224 } ) ;
2325 const [ showCertificate , setShowCertificate ] = useState ( false ) ;
2426 const [ certificateId , setCertificateId ] = useState ( '' ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ import {
1313} from '@mui/material' ;
1414import MenuIcon from '@mui/icons-material/Menu' ;
1515import ArrowBackIcon from '@mui/icons-material/ArrowBack' ;
16- import { CommonDrawer , DrawerItemProp } from '../Drawer/CommonDrawer' ;
16+ import { CommonDrawer } from '../Drawer/CommonDrawer' ;
17+ import type { DrawerItemProp } from '../Drawer/CommonDrawer' ;
1718
1819interface NewDrawerItemProp extends DrawerItemProp {
1920 variant ?: 'contained' | 'text' ;
Original file line number Diff line number Diff line change @@ -11,7 +11,11 @@ interface DrawerItem {
1111 icon ?: React . ReactNode ;
1212 to : string ;
1313}
14-
14+ export interface DrawerItemProp {
15+ title : React . ReactNode ;
16+ icon ?: React . ReactNode ;
17+ to : string | ( ( event : React . MouseEvent < HTMLAnchorElement > ) => void ) ;
18+ }
1519interface CommonDrawerProps {
1620 open : boolean ;
1721 onDrawerClose : ( ) => void ;
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ import {
1212} from '@mui/material' ;
1313import MenuIcon from '@mui/icons-material/Menu' ;
1414import ArrowBackIcon from '@mui/icons-material/ArrowBack' ;
15- import { CommonDrawer , DrawerItemProp } from '../Drawer/CommonDrawer' ;
15+ import { CommonDrawer } from '../Drawer/CommonDrawer' ;
16+ import type { DrawerItemProp } from '../Drawer/CommonDrawer' ;
1617
1718interface NewDrawerItemProp extends DrawerItemProp {
1819 variant ?: 'contained' | 'text' ;
@@ -147,6 +148,8 @@ const DesktopBar = ({
147148 return (
148149 < Button
149150 key = { index }
151+ // @ts -ignore
152+
150153 variant = {
151154 link . variant ??
152155 ( link . isActive ? 'top-bar-link-button' : 'top-bar-link-text' )
@@ -240,12 +243,14 @@ const MobileTopBar = ({
240243 < CommonDrawer
241244 open = { isDrawerOpen }
242245 onDrawerClose = { ( ) => setIsDrawerOpen ( false ) }
246+ // @ts -ignore
247+
243248 items = { navLinks }
244249 onItemClick = { ( to ) => {
245250 setIsDrawerOpen ( false ) ;
246251 } }
247252 topElement = { < Brand { ..._brand } /> }
248- />
253+ />
249254 </ Box >
250255 ) ;
251256} ;
You can’t perform that action at this time.
0 commit comments