Skip to content

Commit 2ca03df

Browse files
authored
Merge branch 'main' into issue-67-Add_upcoming_events_to_landing_page_carousel
2 parents ad93690 + bc17634 commit 2ca03df

19 files changed

Lines changed: 541 additions & 80 deletions

client/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"framer-motion": "^12.23.24",
2929
"is-inside-container": "^1.0.0",
3030
"lucide-react": "^0.516.0",
31-
"next": "15.4.10",
31+
"next": "15.4.11",
3232
"react": "19.1.0",
3333
"react-dom": "19.1.0",
3434
"react-social-icons": "^6.25.0",

client/src/components/main/Navbar.tsx

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,41 @@ export default function Navbar() {
1818

1919
return (
2020
<>
21-
<header className="sticky top-0 z-50 flex h-24 w-full flex-wrap items-center justify-center rounded-md border-b border-border/20 bg-background px-20 font-jersey10">
22-
<Link
23-
href="/"
24-
className="flex flex-none items-center gap-3 text-2xl md:mr-5"
25-
>
26-
<Image
27-
src="/game_dev_club_logo.svg"
28-
alt="logo"
29-
width={32}
30-
height={32}
31-
className="h-8 w-8"
32-
/>
33-
<span className="sr-only">Game Development UWA</span>
34-
<span aria-hidden="true" className="whitespace-nowrap md:hidden">
35-
GDUWA
36-
</span>
37-
<span
38-
aria-hidden="true"
39-
className="hidden whitespace-nowrap md:inline"
40-
>
41-
Game Development UWA _
42-
</span>
43-
</Link>
44-
45-
<nav className="ml-auto hidden flex-none gap-8 text-xl md:flex">
46-
{navItems.map((item) => (
47-
<Link
48-
key={item.href}
49-
href={item.href}
50-
className="whitespace-nowrap text-foreground/90 transition-colors duration-150 hover:text-primary"
21+
<header className="sticky top-0 z-50 flex h-24 w-full items-center rounded-md border-b border-border/20 bg-background px-20 font-jersey10">
22+
<div className="flex flex-1 items-center">
23+
<Link href="/" className="flex items-center gap-3 text-2xl lg:mr-5">
24+
<Image
25+
src="/game_dev_club_logo.svg"
26+
alt="logo"
27+
width={32}
28+
height={32}
29+
className="h-8 w-8"
30+
/>
31+
<span className="sr-only">Game Development UWA</span>
32+
<span aria-hidden="true" className="whitespace-nowrap md:hidden">
33+
GDUWA
34+
</span>
35+
<span
36+
aria-hidden="true"
37+
className="hidden whitespace-nowrap md:inline"
5138
>
52-
{item.label}
53-
</Link>
54-
))}
55-
</nav>
56-
57-
<div className="ml-auto flex items-center">
58-
<div className="relative md:hidden">
39+
Game Development UWA _
40+
</span>
41+
</Link>
42+
<nav className="ml-auto hidden gap-8 text-xl lg:flex">
43+
{navItems.map((item) => (
44+
<Link
45+
key={item.href}
46+
href={item.href}
47+
className="whitespace-nowrap text-foreground/90 transition-colors duration-150 hover:text-primary"
48+
>
49+
{item.label}
50+
</Link>
51+
))}
52+
</nav>
53+
</div>
54+
<div className="flex items-center lg:hidden">
55+
<div className="relative">
5956
<button
6057
onClick={() => setIsDropdownOpen(!isDropdownOpen)}
6158
className="flex items-center justify-center p-2"

client/src/components/ui/eventHighlightCard.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Play } from "lucide-react";
12
import Image from "next/image";
23

34
export type eventHighlightCardImage = {
@@ -62,7 +63,13 @@ export function EventHighlightCard({
6263

6364
<div className="mt-4 rounded-md border border-muted bg-landingCard p-4 text-gray-200">
6465
<div className="flex gap-2">
65-
<span></span>
66+
<span className="flex h-6 w-6 flex-shrink-0 items-center justify-center">
67+
<Play
68+
className="h-6 w-6 fill-accent text-accent"
69+
aria-hidden="true"
70+
fill="currentColor"
71+
/>
72+
</span>
6673
<p>{description}</p>
6774
{image && (
6875
<Image
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import Image from "next/image";
2+
import Link from "next/link";
3+
4+
import { useGameshowcase } from "@/hooks/useGameshowcase";
5+
6+
export default function LandingGames() {
7+
const { data: showcases, isPending, isError, error } = useGameshowcase();
8+
if (isPending) {
9+
return (
10+
<main className="mx-auto min-h-screen max-w-7xl px-6 py-16">
11+
<p>Loading games...</p>
12+
</main>
13+
);
14+
}
15+
16+
if (!showcases || showcases.length === 0) {
17+
return (
18+
<div>
19+
<p> No Games Showcased Yet</p>
20+
</div>
21+
);
22+
}
23+
24+
if (isError) {
25+
const errorMessage =
26+
error?.response?.status === 404
27+
? "Games not found."
28+
: "Failed to Load Games";
29+
return (
30+
<div>
31+
<p className="text-red-500" role="alert">
32+
{errorMessage}
33+
</p>
34+
</div>
35+
);
36+
}
37+
return (
38+
<div className="grid grid-cols-1 gap-10 md:grid-cols-3">
39+
{showcases.slice(0, 3).map((game) => (
40+
<div
41+
key={game.game_id}
42+
className="rounded-xl p-6 text-background duration-200 ease-in-out hover:scale-110"
43+
>
44+
<Link key={game.game_id} href={`/games/${game.game_id}`}>
45+
<div className="relative aspect-[16/9] w-full overflow-hidden rounded-lg">
46+
<Image
47+
src={game.gameCover}
48+
alt={game.game_name}
49+
fill
50+
className="object-cover"
51+
/>
52+
</div>
53+
<h3 className="mb-2 mt-4 font-jersey10 text-2xl text-white">
54+
{game.game_name}
55+
</h3>
56+
57+
<p className="mb-4 truncate text-sm text-primary">
58+
{game.game_description}
59+
</p>
60+
<div className="h-px w-full bg-white/30" />
61+
</Link>
62+
</div>
63+
))}
64+
</div>
65+
);
66+
}

client/src/hooks/useCommittee.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { useQuery } from "@tanstack/react-query";
2+
import { AxiosError } from "axios";
3+
4+
import api from "@/lib/api";
5+
6+
export type ApiMember = {
7+
name: string;
8+
profile_picture: string;
9+
pronouns: string;
10+
about: string;
11+
};
12+
13+
export function useCommittee() {
14+
return useQuery<ApiMember[], AxiosError>({
15+
queryKey: ["role"],
16+
queryFn: async () => {
17+
const response = await api.get<ApiMember[]>("/about/");
18+
console.log(response.data);
19+
return response.data;
20+
},
21+
retry: (failureCount, error) => {
22+
if (error?.response?.status === 404) {
23+
return false;
24+
}
25+
return failureCount < 3;
26+
},
27+
});
28+
}

0 commit comments

Comments
 (0)