From 01dc9c97490ac28daef7e013fba0a0f82c974673 Mon Sep 17 00:00:00 2001
From: Hieuhuy Pham
Date: Wed, 12 Mar 2025 01:52:05 -0400
Subject: [PATCH] Change the way routing works, so ad will fit better for
everyone, we gotta find away to refresh it so we can use but right now
quick and dirty solution
---
global.d.ts | 8 ++++++
src/app/books/[bookId]/page.tsx | 17 ++++++------
src/app/layout.tsx | 42 ++++++++++++++++++------------
src/app/releases/page.tsx | 13 +++++-----
src/components/NavigationBar.tsx | 44 +++++++++++++++++---------------
src/hooks/useRefreshAds.ts | 32 +++++++++++++++++++++++
6 files changed, 103 insertions(+), 53 deletions(-)
create mode 100644 src/hooks/useRefreshAds.ts
diff --git a/global.d.ts b/global.d.ts
index 46cf8d5..943f9c6 100644
--- a/global.d.ts
+++ b/global.d.ts
@@ -8,6 +8,14 @@ declare namespace NodeJS {
interface Window {
kofiWidgetOverlay: any;
dataLayer: any[];
+ googletag: {
+ cmd: any[];
+ pubads: () => {
+ refresh: () => void;
+ enableSingleRequest: () => void;
+ };
+ enableServices: () => void;
+ };
}
}
export {};
\ No newline at end of file
diff --git a/src/app/books/[bookId]/page.tsx b/src/app/books/[bookId]/page.tsx
index d9e7e89..dad2489 100644
--- a/src/app/books/[bookId]/page.tsx
+++ b/src/app/books/[bookId]/page.tsx
@@ -4,7 +4,6 @@ import { encodeId, formatDateToMonthDayYear, markdownToHtml } from "@/lib/utils"
import ChapterDropdown from "@/components/ChapterDropdown";
import { Ad } from "@/lib/types";
import { Countdown } from "@/components/Countdown";
-import Link from "next/link";
export type paramsType = Promise<{ bookId: string }>;
@@ -106,7 +105,7 @@ export default async function BookPage(props: { params: paramsType }) {
{chapter.number === next_chapter?.number ? (
-
Unlock Early AdWalled Chapter
-
+
)
: (
-
Join Patreon for More Early Chapters
-
+
)}
@@ -174,7 +173,7 @@ export default async function BookPage(props: { params: paramsType }) {
{chapter.number === next_chapter?.number ? (
-
Unlock Early Ad-Walled Chapter
-
+
)
: (
-
Join Patreon for More Early Chapters
-
+
)}
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 4cd8ee4..33faaa0 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -35,18 +35,17 @@ export default function RootLayout({ children }: { children: React.ReactNode })
const Default_Fallback = () => (
-

-
Loading content...
-
+
+ Loading content...
+
)
-
return (
-
+
-
+
+