Skip to content

Commit

Permalink
Update Menu Item to Quiz
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtan2000 committed Sep 18, 2024
1 parent 52d157e commit 4a1b696
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions app/(full-page)/auth/google/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ const GoogleAuthPage = () => {
useEffect(() => {
if (isDenyAccess) redirect('/auth/access');
if (isLogin) {
let redirectionUrl = '/dashboard';
let redirectionUrl = '/quiz';

if (typeof sessionStorage !== 'undefined' && sessionStorage.getItem('redirection') !== null) {
redirectionUrl = sessionStorage.getItem('redirection') || '/dashboard';
redirectionUrl = sessionStorage.getItem('redirection') || '/quiz';
sessionStorage.removeItem('redirection');
}

Expand Down
2 changes: 1 addition & 1 deletion app/(full-page)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const LandingPage = () => {
<span className="font-light block">MTECH SE 31</span>Quemistry
</h1>
<p className="font-normal text-2xl line-height-3 md:mt-3 text-gray-700">Platform manages multiple choice questions to test and improve your knowlege in chemistry ... </p>
<Link href="/dashboard">
<Link href="/quiz">
<Button type="button" label="Get Started" rounded className="text-xl border-none mt-3 bg-blue-500 font-normal line-height-3 px-3 text-white"></Button>
</Link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/(main)/students/invitation/accept/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const InvitationPage = () => {

const storeInvitationResponse = useCallback((result: boolean) => {
sessionStorage.setItem("invitation_result", String(result));
router.push('/dashboard');
router.push('/quiz');
}, [router]);

useEffect(() => {
Expand Down
24 changes: 12 additions & 12 deletions layout/AppMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ const AppMenu = () => {
label: 'Home',
items: [
{
label: 'Dashboard',
icon: 'pi pi-fw pi-home',
to: '/dashboard',
label: 'Quiz', icon: 'pi pi-fw pi-folder', visible: accessibleBy(['student']),
items: [
{ label: 'Take Quiz', icon: 'pi pi-fw pi-pencil', to: '/quiz', visible: accessibleBy(['student']) },
{ label: 'Quiz Results', icon: 'pi pi-fw pi-chart-scatter', to: '/quiz/results', visible: accessibleBy(['student']) },
{ label: 'Class Test', icon: 'pi pi-fw pi-graduation-cap', to: '/test', visible: accessibleBy(['student']) },
{
label: 'History',
icon: 'pi pi-fw pi-history',
to: '/quiz/history',
visible: accessibleBy(['student'])
}
{ label: 'Quiz History', icon: 'pi pi-fw pi-history', to: '/quiz/history', visible: accessibleBy(['student']) }
]
}
]
},
{
label: 'Class Test', icon: 'pi pi-fw pi-folder', visible: accessibleBy(['student']),
items: [
{ label: 'Take Class Test', icon: 'pi pi-fw pi-pencil', to: '/test', visible: accessibleBy(['student']) },
{ label: 'Test Results', icon: 'pi pi-fw pi-chart-bar', visible: accessibleBy(['student']) },
{ label: 'Test History', icon: 'pi pi-fw pi-history', visible: accessibleBy(['student']) }
]
},
],
},
{
label: 'Manage',
Expand Down
2 changes: 0 additions & 2 deletions lib/RouteGuard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export const RouteGuard = {
return true;
case '/auth/error':
return true;
case '/dashboard':
return true;
case '/quiz':
return this.accessibleBy(['student']);
case '/test':
Expand Down

0 comments on commit 4a1b696

Please sign in to comment.