another update
This commit is contained in:
@@ -7,7 +7,7 @@ async function proxyRequest(request: Request, method: string) {
|
||||
JSON.stringify({ error: "Missing `url` query parameter." }),
|
||||
{
|
||||
status: 400,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
headers: { "Content-Type": "application/json" }
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -21,7 +21,7 @@ async function proxyRequest(request: Request, method: string) {
|
||||
const init: RequestInit = {
|
||||
method,
|
||||
headers,
|
||||
body: method === "GET" || method === "HEAD" ? undefined : request.body,
|
||||
body: method === "GET" || method === "HEAD" ? undefined : request.body
|
||||
};
|
||||
|
||||
if (init.body !== undefined) {
|
||||
@@ -35,7 +35,7 @@ async function proxyRequest(request: Request, method: string) {
|
||||
|
||||
return new Response(response.body, {
|
||||
status: response.status,
|
||||
headers: responseHeaders,
|
||||
headers: responseHeaders
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@tailwind utilities;
|
||||
|
||||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-family: Geist;
|
||||
}
|
||||
|
||||
@layer base {
|
||||
|
||||
@@ -3,32 +3,32 @@ import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "./globals.css";
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
subsets: ["latin"],
|
||||
variable: "--font-geist-sans",
|
||||
subsets: ["latin"]
|
||||
});
|
||||
|
||||
const geistMono = Geist_Mono({
|
||||
variable: "--font-geist-mono",
|
||||
subsets: ["latin"],
|
||||
variable: "--font-geist-mono",
|
||||
subsets: ["latin"]
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Create Next App",
|
||||
description: "Generated by create next app",
|
||||
title: "Create Next App",
|
||||
description: "Generated by create next app"
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
children
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
return (
|
||||
<html lang="en">
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
77
app/page.tsx
77
app/page.tsx
@@ -5,7 +5,7 @@ import { HomeLoggedInHeader } from "@/components/loggedInHeader";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import {
|
||||
getOmniRecommendationsHome,
|
||||
OmniRecommendation,
|
||||
OmniRecommendation
|
||||
} from "@/lib/omniRecommendation";
|
||||
import { loadThumbnails } from "@/lib/thumbnailLoader";
|
||||
import { useEffect, useState } from "react";
|
||||
@@ -14,7 +14,7 @@ export default function Home() {
|
||||
const SORTS_ALLOWED_IDS = [100000003, 100000001];
|
||||
const [rec, setRec] = useState<OmniRecommendation | null>(null);
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
setTimeout(async () => {
|
||||
const r = await getOmniRecommendationsHome();
|
||||
setRec(r);
|
||||
loadThumbnails(
|
||||
@@ -22,52 +22,51 @@ export default function Home() {
|
||||
type: "GameThumbnail",
|
||||
targetId: Number(a[1].rootPlaceId),
|
||||
format: "webp",
|
||||
size: "384x216",
|
||||
size: "384x216"
|
||||
}))
|
||||
).catch((a) => {});
|
||||
})();
|
||||
}, 1000);
|
||||
}, []);
|
||||
|
||||
if (!rec) {
|
||||
return (
|
||||
<div className="p-4">
|
||||
<Card>
|
||||
<CardContent className="p-4">
|
||||
<div className="h-[200px] flex items-center justify-center">
|
||||
<div className="animate-pulse text-muted-foreground">
|
||||
{"Loading..."}
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="overflow-scroll no-scrollbar w-screen max-h-screen h-screen">
|
||||
<HomeLoggedInHeader />
|
||||
<div className="p-4 space-y-8 no-scrollbar">
|
||||
{rec.sorts
|
||||
.filter((a) => SORTS_ALLOWED_IDS.includes(a.topicId))
|
||||
.map((sort, idx) => (
|
||||
<div key={idx}>
|
||||
<h1 className="text-2xl pb-2">{sort.topic}</h1>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
{(sort.recommendationList || []).map(
|
||||
(recommendation, idxb) => {
|
||||
const game =
|
||||
rec.contentMetadata.Game[
|
||||
recommendation.contentId.toString()
|
||||
];
|
||||
return (
|
||||
<GameCard key={idxb} game={game} />
|
||||
);
|
||||
}
|
||||
)}
|
||||
{!rec ? (
|
||||
<Card>
|
||||
<CardContent className="p-4">
|
||||
<div className="h-[200px] flex items-center justify-center">
|
||||
<div className="animate-pulse text-muted-foreground">
|
||||
{"Loading..."}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
) : (
|
||||
rec.sorts
|
||||
.filter((a) => SORTS_ALLOWED_IDS.includes(a.topicId))
|
||||
.map((sort, idx) => (
|
||||
<div key={idx}>
|
||||
<h1 className="text-2xl pb-2">{sort.topic}</h1>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
{(sort.recommendationList || []).map(
|
||||
(recommendation, idxb) => {
|
||||
const game =
|
||||
rec.contentMetadata.Game[
|
||||
recommendation.contentId.toString()
|
||||
];
|
||||
return (
|
||||
<GameCard
|
||||
key={idxb}
|
||||
game={game}
|
||||
/>
|
||||
);
|
||||
}
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user