Skip to content

Commit 67e910c

Browse files
committed
Squashed commit of the following:
commit d08ba11 Author: Jayly <[email protected]> Date: Mon Oct 13 10:33:10 2025 +0100 ads commit 3eeafc2 Author: Jayly <[email protected]> Date: Mon Oct 13 10:07:00 2025 +0100 Update page.tsx
1 parent 88b168b commit 67e910c

File tree

6 files changed

+12
-47
lines changed

6 files changed

+12
-47
lines changed

src/app/bedrock-experiments/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Button, Card, CardBody, CardHeader, Switch, Input, Divider, Chip, HeroU
66
import JSZip from "jszip";
77
import { Int8, ByteTag, Tag, read, write } from "nbtify";
88
import { ThemeProvider } from "next-themes";
9-
import { AdUnit } from "@/components/AdUnit";
9+
import { InArticleAdUnit } from "@/components/AdUnit";
1010

1111
interface Experiment {
1212
// The id of the experiment - must match the id in level.dat file
@@ -361,7 +361,7 @@ export default function Post(): JSX.Element {
361361
<body>
362362
<StatsCollection />
363363
<SiteHeader />
364-
<AdUnit />
364+
<InArticleAdUnit />
365365
<ExperimentsEditor />
366366
<SiteFooter />
367367
</body>

src/app/hk-tunnels-tolls/insider/page.tsx

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { StatsCollection, SiteFooter, SiteHeader } from "@/components/SiteFormat
55
import { useEffect, useState } from "react";
66
import { HeroUIProvider, Button } from "@heroui/react";
77
import { ThemeProvider } from "next-themes";
8+
import { InArticleAdUnit } from "@/components/AdUnit";
89

910
interface TollData {
1011
tunnels: Record<string, any>;
@@ -483,32 +484,13 @@ function HKTunnelsTollsApp(): JSX.Element {
483484
return <div></div>;
484485
}
485486

486-
const AdUnit: React.FC = () => {
487-
useEffect(() => {
488-
try {
489-
(window.adsbygoogle = window.adsbygoogle || []).push({});
490-
} catch (e) {
491-
console.error(e);
492-
}
493-
}, []);
494-
return (
495-
<ins
496-
className="adsbygoogle"
497-
data-ad-layout="in-article"
498-
data-ad-format="fluid"
499-
data-ad-client="ca-pub-2533146760921020"
500-
data-ad-slot="9602449199"
501-
></ins>
502-
);
503-
};
504-
505487
export default function Page(): JSX.Element {
506488
return (
507489
<html lang="zh-HK" suppressHydrationWarning>
508490
<body>
509491
<StatsCollection />
510492
<SiteHeader />
511-
<AdUnit />
493+
<InArticleAdUnit />
512494
<HeroUIProvider>
513495
<ThemeProvider>
514496
<HKTunnelsTollsApp />

src/app/hk-tunnels-tolls/page.tsx

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { ThemeProvider } from "next-themes";
88
import registryInfo from "./data/registry.json";
99
import tollData from "./data/tolls.json";
1010
import publicHolidayData from "./data/public_holidays.json";
11+
import { InArticleAdUnit } from "@/components/AdUnit";
1112

1213
// Utility functions for Hong Kong timezone handling
1314
function getHongKongDate(utcDate: Date): { date: Date; dateString: string; timeString: string; dayOfWeek: number } {
@@ -497,6 +498,8 @@ function HKTunnelsTollsApp(): JSX.Element {
497498
})}
498499
</div>
499500
</div>
501+
{/* Advertisement */}
502+
<InArticleAdUnit />
500503
{/* Individual Tunnel Tables */}
501504
{Object.keys(tollData.tunnels).map((key) => {
502505
if (!isValidTunnel(key)) {
@@ -553,32 +556,12 @@ function HKTunnelsTollsApp(): JSX.Element {
553556
);
554557
}
555558

556-
const AdUnit: React.FC = () => {
557-
useEffect(() => {
558-
try {
559-
(window.adsbygoogle = window.adsbygoogle || []).push({});
560-
} catch (e) {
561-
console.error(e);
562-
}
563-
}, []);
564-
return (
565-
<ins
566-
className="adsbygoogle"
567-
data-ad-layout="in-article"
568-
data-ad-format="fluid"
569-
data-ad-client="ca-pub-2533146760921020"
570-
data-ad-slot="9602449199"
571-
></ins>
572-
);
573-
};
574-
575559
export default function Page(): JSX.Element {
576560
return (
577561
<html lang="zh-HK" suppressHydrationWarning>
578562
<body>
579563
<StatsCollection />
580564
<SiteHeader lang="zh-HK" icon="/hk-tunnels-tolls/icon.png" />
581-
<AdUnit />
582565
<HeroUIProvider>
583566
<ThemeProvider>
584567
<HKTunnelsTollsApp />

src/app/posts/[slug]/downloads/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const adsenseCode = `<ins class="adsbygoogle"
2020
data-ad-format="auto"
2121
data-full-width-responsive="true"></ins>
2222
<script>
23-
(adsbygoogle = window.adsbygoogle || []).push({});f
23+
(adsbygoogle = window.adsbygoogle || []).push({});
2424
</script>`;
2525

2626
// Generate static parameters for all posts

src/app/privacy-policy/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import "@/styles/articles.css";
33
import React from "react";
44
import { StatsCollection, SiteHeader, SiteFooter } from "@/components/SiteFormat";
55
import { Link } from "@heroui/react";
6-
import { AdUnit } from "@/components/AdUnit";
6+
import { InArticleAdUnit } from "@/components/AdUnit";
77

88
const PrivacyPolicy: React.FC = () => {
99
return (
@@ -580,7 +580,7 @@ export default function Post(): JSX.Element {
580580
<body>
581581
<StatsCollection />
582582
<SiteHeader />
583-
<AdUnit />
583+
<InArticleAdUnit />
584584
<PrivacyPolicy />
585585
<SiteFooter />
586586
</body>

src/components/AdUnit.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect } from "react";
22

3-
export function AdUnit(): JSX.Element {
3+
export function InArticleAdUnit(): JSX.Element {
44
useEffect(() => {
55
try {
66
(window.adsbygoogle = window.adsbygoogle || []).push({});
@@ -10,7 +10,7 @@ export function AdUnit(): JSX.Element {
1010
}, []);
1111
return (
1212
<ins
13-
className="adsbygoogle"
13+
className="adsbygoogle min-w-96 min-h-48"
1414
style={{ display: "block", textAlign: "center", margin: "20px 0" }}
1515
data-ad-layout="in-article"
1616
data-ad-format="fluid"

0 commit comments

Comments
 (0)