Skip to content

Commit

Permalink
refactor(portal): use hackathon application status enum
Browse files Browse the repository at this point in the history
  • Loading branch information
HasithDeAlwis committed Feb 17, 2025
1 parent 0a111e5 commit 122b3fc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
26 changes: 13 additions & 13 deletions libs/portal/pages/index/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { UserHackathonApplicationStatus } from '@cuhacking/portal/types/user'
import { Banner } from '@cuhacking/portal/ui/dashboard/banner'
import { HackathonCountdown } from '@cuhacking/portal/ui/dashboard/hackathon-countdown'
import { Stat } from '@cuhacking/portal/ui/dashboard/stat'
Expand All @@ -10,15 +11,11 @@ const constants = {
name: 'Saim',
},
hackathonDate: new Date(2025, 2, 14),
status: 'pending',
hackathonApplicationStatus: UserHackathonApplicationStatus.notComplete,
stats: [
{
label: 'Total Applications',
value: 1000,
},
{
label: 'Money Raised',
value: '$12,230',
value: '$20 030',
},
],
}
Expand All @@ -30,18 +27,21 @@ export function Home() {
<div className="flex flex-1 flex-col w-full p-4 gap-5">
<Banner name={constants.user.name} />
<div className="flex justify-center w-full">
<Button
className="text-black px-8 md:px-12 py-2.5"
variant="secondary"
>
APPLY TO CUHACKING 6
</Button>
{constants.hackathonApplicationStatus === UserHackathonApplicationStatus.notComplete
&& (
<Button
className="text-black px-8 md:px-12 py-2.5"
variant="secondary"
>
APPLY TO CUHACKING 6
</Button>
)}
</div>
<HackathonCountdown date={constants.hackathonDate} />
{constants.stats.map(stat => (
<Stat key={stat.label} label={stat.label} value={stat.value} />
))}
<UserStatus name={constants.user.name} status={constants.status} />
{ constants.hackathonApplicationStatus !== UserHackathonApplicationStatus.notComplete && <UserStatus name={constants.user.name} status={constants.status} /> }
</div>
</div>
)
Expand Down
5 changes: 5 additions & 0 deletions libs/portal/types/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ export enum UserProfileStatus {
complete = 'complete',
notComplete = 'not_complete',
}
export enum UserHackathonApplicationStatus {
complete = 'complete',
notComplete = 'not_complete',
pending = 'pending',
}

0 comments on commit 122b3fc

Please sign in to comment.