Skip to content

Commit aac3d36

Browse files
committed
add stream tab
1 parent 29fa67d commit aac3d36

File tree

2 files changed

+40
-31
lines changed

2 files changed

+40
-31
lines changed

Diff for: frontend/src/app/dashboard/DashboardNavbar.tsx

+39-30
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ import Link from 'next/link';
66
import { usePathname } from 'next/navigation';
77
import Image from 'next/image';
88
import React from 'react';
9+
import { fetchModesOfAttendance } from '../../lib/api/events/modeOfAttendance';
910

10-
export default function DashboardNavbar() {
11+
export default function DashboardNavbar({
12+
registered,
13+
}: {
14+
registered: boolean;
15+
}) {
1116
const pathname = usePathname();
1217
const isProfile = pathname === '/dashboard/profile';
1318
const isRegister = pathname === '/dashboard/register';
@@ -72,53 +77,56 @@ export default function DashboardNavbar() {
7277
Optional
7378
</span>
7479
</div>
80+
{!registered && (
81+
<div
82+
className={`flex items-center justify-center gap-2 border-b-2 border-solid px-6 py-5 max-md:gap-1 max-md:px-3 max-md:py-2 ${
83+
isRegister ? 'border-b-primary' : undefined
84+
}`}
85+
>
86+
<Image
87+
width={24}
88+
height={24}
89+
className={`${
90+
isRegister ? 'filter-primary' : undefined
91+
} h-6 w-6 max-md:h-5 max-md:w-5`}
92+
src="/source/TicketStar.svg"
93+
alt=""
94+
/>
95+
<Link
96+
href="/dashboard/register"
97+
className={`text-xl font-semibold not-italic leading-normal tracking-[-0.2px] max-md:text-base ${
98+
isRegister ? 'text-primary' : 'text-darkslategray-100'
99+
}`}
100+
>
101+
Registration
102+
</Link>
103+
</div>
104+
)}
105+
75106
<div
76107
className={`flex items-center justify-center gap-2 border-b-2 border-solid px-6 py-5 max-md:gap-1 max-md:px-3 max-md:py-2 ${
77-
isRegister ? 'border-b-primary' : undefined
108+
isStream ? 'border-b-primary' : undefined
78109
}`}
79110
>
80111
<Image
81112
width={24}
82113
height={24}
83114
className={`${
84-
isRegister ? 'filter-primary' : undefined
115+
isStream ? 'filter-primary' : undefined
85116
} h-6 w-6 max-md:h-5 max-md:w-5`}
86-
src="/source/TicketStar.svg"
117+
src="/source/stream.svg"
87118
alt=""
88119
/>
89120
<Link
90-
href="/dashboard/register"
121+
href="/dashboard/stream"
91122
className={`text-xl font-semibold not-italic leading-normal tracking-[-0.2px] max-md:text-base ${
92-
isRegister ? 'text-primary' : 'text-darkslategray-100'
123+
isStream ? 'text-primary' : 'text-darkslategray-100'
93124
}`}
94125
>
95-
Registration
126+
Stream
96127
</Link>
97128
</div>
98129

99-
{/*<div*/}
100-
{/* className={`flex items-center justify-center gap-2 border-b-2 border-solid px-6 py-5 max-md:gap-1 max-md:px-3 max-md:py-2 ${*/}
101-
{/* isStream ? 'border-b-primary' : undefined*/}
102-
{/* }`}*/}
103-
{/*>*/}
104-
{/* <Image*/}
105-
{/* width={24}*/}
106-
{/* height={24}*/}
107-
{/* className={`${*/}
108-
{/* isStream ? 'filter-primary' : undefined*/}
109-
{/* } h-6 w-6 max-md:h-5 max-md:w-5`}*/}
110-
{/* src="/source/stream.svg"*/}
111-
{/* alt=""*/}
112-
{/* />*/}
113-
{/* <Link*/}
114-
{/* href="/dashboard/stream"*/}
115-
{/* className={`text-xl font-semibold not-italic leading-normal tracking-[-0.2px] max-md:text-base ${*/}
116-
{/* isStream ? 'text-primary' : 'text-darkslategray-100'*/}
117-
{/* }`}*/}
118-
{/* >*/}
119-
{/* Stream*/}
120-
{/* </Link>*/}
121-
{/*</div>*/}
122130
{/*<div*/}
123131
{/* className={`flex items-center justify-center gap-2 border-b-2 border-solid px-6 py-5 max-md:gap-1 max-md:px-3 max-md:py-2 ${*/}
124132
{/* isVideos ? 'border-b-primary' : undefined*/}
@@ -142,6 +150,7 @@ export default function DashboardNavbar() {
142150
{/* Videos*/}
143151
{/* </Link>*/}
144152
{/*</div>*/}
153+
145154
{/*<div*/}
146155
{/* className={`flex items-center justify-center gap-2 border-b-2 border-solid px-6 py-5 max-md:gap-1 max-md:px-3 max-md:py-2 ${*/}
147156
{/* isCertificates ? 'border-b-primary' : undefined*/}

Diff for: frontend/src/app/dashboard/layout.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default async function DashboardLayout({ children }) {
5353
: 'Not Registered Yet'}
5454
</p>
5555
</div>
56-
<DashboardNavbar />
56+
<DashboardNavbar registered={!!registeredModeOfAttendance} />
5757
{children}
5858
</div>
5959
</div>

0 commit comments

Comments
 (0)