Skip to content

Commit 60813ab

Browse files
committed
Added Case for No Games Showcase and Fixed Styling
1 parent 2dd4b54 commit 60813ab

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

client/src/components/ui/landingGames.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Link from "next/link";
33

44
import { useGameshowcase } from "@/hooks/useGameshowcase";
55

6-
export default function LandingGame() {
6+
export default function LandingGames() {
77
const { data: showcases, isPending, isError, error } = useGameshowcase();
88
if (isPending) {
99
return (
@@ -13,17 +13,25 @@ export default function LandingGame() {
1313
);
1414
}
1515

16+
if (!showcases || showcases.length === 0) {
17+
return (
18+
<div>
19+
<p> No Games Showcased Yet</p>
20+
</div>
21+
);
22+
}
23+
1624
if (isError) {
1725
const errorMessage =
1826
error?.response?.status === 404
1927
? "Games not found."
2028
: "Failed to Load Games";
2129
return (
22-
<main className="mx-auto min-h-screen max-w-7xl px-6 py-16">
30+
<div>
2331
<p className="text-red-500" role="alert">
2432
{errorMessage}
2533
</p>
26-
</main>
34+
</div>
2735
);
2836
}
2937
return (

client/src/pages/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
EventHighlightCard,
77
eventHighlightCardType,
88
} from "@/components/ui/eventHighlightCard";
9-
import LandingGame from "@/components/ui/landingGames";
9+
import LandingGames from "@/components/ui/landingGames";
1010
import { placeholderEvents } from "@/placeholderData";
1111

1212
import { Button } from "../components/ui/button";
@@ -171,7 +171,7 @@ export default function Landing() {
171171
</Link>
172172
</div>
173173
</div>
174-
<LandingGame />
174+
<LandingGames />
175175
</div>
176176
</section>
177177
</div>

0 commit comments

Comments
 (0)