Skip to content

Commit dbb1ff2

Browse files
authored
Merge pull request #628 from tekdi/main-learner
Main learner qa
2 parents 6a03409 + 06bded3 commit dbb1ff2

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

apps/learner-web-app/src/app/profile/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ type FilterDetails = {
1717
const 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('');

libs/shared-lib-v2/src/lib/Header/TopAppBar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import {
1313
} from '@mui/material';
1414
import MenuIcon from '@mui/icons-material/Menu';
1515
import 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

1819
interface NewDrawerItemProp extends DrawerItemProp {
1920
variant?: 'contained' | 'text';

libs/shared-lib/src/lib/Drawer/CommonDrawer.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
}
1519
interface CommonDrawerProps {
1620
open: boolean;
1721
onDrawerClose: () => void;

libs/shared-lib/src/lib/Header/TopAppBar.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import {
1212
} from '@mui/material';
1313
import MenuIcon from '@mui/icons-material/Menu';
1414
import 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

1718
interface 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
};

0 commit comments

Comments
 (0)