-
} />
-
- {
- props.error
- ?
-
-
You are not
- ready for this
-
- :
-
- }
-
- } />
-
-
+export default function memePage(props: { image: string; error: boolean }) {
+ return (
+
+
+
+ }
+ />
+
+ {props.error ? (
+
+
You are not
+ ready for this
-
- )
+ ) : (
+
+ )}
+
+
+ }
+ />
+
+
+
+
+ );
}
export const getServerSideProps = (async (context) => {
- const data = { props: { image: "" as string, error: false as boolean } };
+ const data = { props: { image: "" as string, error: false as boolean } };
- const response = await fetch(`${publicRuntimeConfig.URL || serverRuntimeConfig.URL || "http://localhost:3000/"}${context.params!.id}`, {
- method: "GET"
- })
- if (response.ok) {
- const json = await response.json();
-
- data.props.image = json!.image;
- return data;
- }
- data.props.error = true;
+ const response = await fetch(
+ `${
+ publicRuntimeConfig.URL ||
+ serverRuntimeConfig.URL ||
+ "http://localhost:3000/"
+ }${context.params!.id}`,
+ {
+ method: "GET",
+ },
+ );
+ if (response.ok) {
+ const json = await response.json();
+ data.props.image = json!.image;
return data;
-}) satisfies GetStaticProps;
\ No newline at end of file
+ }
+ data.props.error = true;
+
+ return data;
+}) satisfies GetStaticProps;
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index 8e0b5d2..4758b45 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -1,32 +1,32 @@
-import '@/styles/globals.css'
-import dayjs from 'dayjs';
-import type { AppProps } from 'next/app'
-import Head from 'next/head';
+import "@/styles/globals.css";
+import dayjs from "dayjs";
+import type { AppProps } from "next/app";
+import Head from "next/head";
import duration from "dayjs/plugin/duration";
import weekOfYear from "dayjs/plugin/weekOfYear";
import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
-import Layout from '@components/layout/Layout';
-import { ThemeProvider } from 'next-themes';
-
+import Layout from "@components/layout/Layout";
+import { ThemeProvider } from "next-themes";
export default function App({ Component, pageProps }: AppProps) {
dayjs.extend(duration);
dayjs.extend(isSameOrBefore);
- dayjs.extend(weekOfYear)
+ dayjs.extend(weekOfYear);
return (
-
-
-
+
Meme Christmas Calendar
-
+
-
+
-
+
);
}
diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx
index 54e8bf3..b2fff8b 100644
--- a/src/pages/_document.tsx
+++ b/src/pages/_document.tsx
@@ -1,4 +1,4 @@
-import { Html, Head, Main, NextScript } from 'next/document'
+import { Html, Head, Main, NextScript } from "next/document";
export default function Document() {
return (
@@ -9,5 +9,5 @@ export default function Document() {