-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Query optimizations and suspense
- Loading branch information
Showing
8 changed files
with
83 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { fetchDates } from "@/components/shared/hooks/api/useDates" | ||
import { DateTime } from "luxon" | ||
|
||
export async function FairDates() { | ||
const dates = await fetchDates() | ||
|
||
return ( | ||
<div className="mt-5 flex gap-4 font-bebas-neue"> | ||
<p className="text-2xl uppercase text-stone-400">Fair:</p> | ||
<div className="flex"> | ||
{[ | ||
// Pick first and last day (ASSUMPTION: days are sorted and continuous) | ||
dates.fair.days[0], | ||
dates.fair.days[dates.fair.days.length - 1] | ||
].map((date, index, list) => ( | ||
<p key={date} className="text-2xl text-stone-400"> | ||
{DateTime.fromISO(date).toFormat( | ||
// Only add month and year to last | ||
`d${index == list.length - 1 ? " MMM" : "-"}${DateTime.fromISO(date).year !== DateTime.now().year ? " YYYY" : ""}` | ||
)} | ||
</p> | ||
))} | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { fetchRecruitment } from "@/components/shared/hooks/api/useRecruitment" | ||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert" | ||
import { UserRoundIcon } from "lucide-react" | ||
import Link from "next/link" | ||
|
||
export async function RecruitmentBanner() { | ||
const recruitment = await fetchRecruitment({ | ||
cache: "no-cache" | ||
}) | ||
|
||
if (recruitment == null) return null | ||
|
||
return ( | ||
<Link href="/student/recruitment"> | ||
<Alert className="mt-0 cursor-pointer dark:hover:border-melon-700 dark:hover:border-opacity-50"> | ||
<UserRoundIcon className="h-4 w-4" /> | ||
<AlertTitle>Recruitment open!</AlertTitle> | ||
<AlertDescription> | ||
Apply to become a part of Armada 2024 | ||
</AlertDescription> | ||
</Alert> | ||
</Link> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters