Skip to content

Commit

Permalink
update badges
Browse files Browse the repository at this point in the history
  • Loading branch information
devksingh4 committed Jul 12, 2024
1 parent 69f71fd commit c7ec84e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
20 changes: 17 additions & 3 deletions clientv2/src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';

import { Group, Divider, Box, Burger, Drawer, ScrollArea, rem } from '@mantine/core';
import { Group, Divider, Box, Burger, Drawer, ScrollArea, rem, Badge } from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';
import classes from './index.module.css';
import LogoBadge from './Logo';
import { AuthContextData } from '../AuthContext';
import { AuthContextData, AuthSourceEnum } from '../AuthContext';
import { AuthenticatedProfileDropdown } from '../ProfileDropdown';

interface HeaderNavbarProps {
Expand All @@ -13,13 +13,27 @@ interface HeaderNavbarProps {

const HeaderNavbar: React.FC<HeaderNavbarProps> = ({ userData }) => {
const [drawerOpened, { toggle: toggleDrawer, close: closeDrawer }] = useDisclosure(false);
let badge = null;
if (userData?.authenticationMethod === AuthSourceEnum.LOCAL) {
badge = (
<Badge color="blue" style={{ marginLeft: 10 }}>
Recruiter
</Badge>
);
} else if (userData?.authenticationMethod === AuthSourceEnum.MSAL) {
badge = (
<Badge color="#FF5F05" style={{ marginLeft: 10 }}>
Student
</Badge>
);
}
return (
<Box>
<header className={classes.header}>
<Group justify="space-between" h="100%">
<Group justify="start" h="100%" gap={10}>
<LogoBadge />

{badge}
<a href="/" className={classes.link}>
Home
</a>
Expand Down
5 changes: 1 addition & 4 deletions clientv2/src/pages/recruiter/RecruiterHome.page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Badge, Title } from '@mantine/core';
import { Title } from '@mantine/core';
import { useAuth } from '@/components/AuthContext';
import { HeaderNavbar } from '@/components/Navbar';

Expand All @@ -12,9 +12,6 @@ export function RecruiterHomePage() {
<Title>
Hello {firstName} {lastName}!
</Title>
<Badge color="blue" style={{ marginLeft: 10 }}>
Recruiter
</Badge>
</div>
</>
);
Expand Down
5 changes: 1 addition & 4 deletions clientv2/src/pages/student/StudentHome.page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Badge, Title } from '@mantine/core';
import { Title } from '@mantine/core';
import { useAuth } from '@/components/AuthContext';
import { HeaderNavbar } from '@/components/Navbar';

Expand All @@ -12,9 +12,6 @@ export function StudentHomePage() {
<Title>
Hello {firstName} {lastName}!
</Title>
<Badge color="#FF5F05" style={{ marginLeft: 10 }}>
Student
</Badge>
</div>
</>
);
Expand Down

0 comments on commit c7ec84e

Please sign in to comment.