diff --git a/src/components/Doc.tsx b/src/components/Doc.tsx index 5615f589..40022c59 100644 --- a/src/components/Doc.tsx +++ b/src/components/Doc.tsx @@ -8,7 +8,7 @@ import { Markdown } from '~/components/Markdown' import { Toc } from './Toc' import { twMerge } from 'tailwind-merge' import { TocMobile } from './TocMobile' -import { GadLeader } from './GoogleScripts' +import { GamLeader } from './Gam' type DocProps = { title: string @@ -106,7 +106,7 @@ export function Doc({ isTocVisible && '!pr-0' )} > - + {title ? {title} : null}
diff --git a/src/components/DocsLayout.tsx b/src/components/DocsLayout.tsx index f80ffa3d..e179dd35 100644 --- a/src/components/DocsLayout.tsx +++ b/src/components/DocsLayout.tsx @@ -27,11 +27,7 @@ import { DocsCalloutBytes } from '~/components/DocsCalloutBytes' import { twMerge } from 'tailwind-merge' import { partners } from '~/utils/partners' import { useThemeStore } from './ThemeToggle' -import { - GadFooter, - GadLeftRailSquare, - GadRightRailSquare, -} from './GoogleScripts' +import { GamFooter, GamLeftRailSquare, GamRightRailSquare } from './Gam' import { SearchButton } from './SearchButton' // Let's use zustand to wrap the local storage logic. This way @@ -363,8 +359,6 @@ export function DocsLayout({ const [showBytes, setShowBytes] = useLocalStorage('showBytes', true) - const footerAdKey = useRouterState({ select: (d) => d.location.pathname }) - const menuItems = menuConfig.map((group, i) => { const WrapperComp = group.collapsible ? 'details' : 'div' const LabelComp = group.collapsible ? 'summary' : 'div' @@ -558,7 +552,7 @@ export function DocsLayout({ > {smallMenu} {largeMenu} -
+
{children}
-
- +
+
@@ -608,9 +599,9 @@ export function DocsLayout({
-
-
-
+
+
+
Our Partners
@@ -682,12 +673,12 @@ export function DocsLayout({
) : null} -
- +
+
-
- +
+
{/*
diff --git a/src/components/GoogleScripts.tsx b/src/components/Gam.tsx similarity index 51% rename from src/components/GoogleScripts.tsx rename to src/components/Gam.tsx index 2f533d53..387f8b4f 100644 --- a/src/components/GoogleScripts.tsx +++ b/src/components/Gam.tsx @@ -1,7 +1,7 @@ import { Link } from '@tanstack/react-router' import React from 'react' import { twMerge } from 'tailwind-merge' -import { getLibrary, libraries } from '~/libraries' +import { libraries } from '~/libraries' declare global { interface Window { @@ -27,152 +27,96 @@ declare global { } } }> + fusetag: { + que: { + push: (fn: () => void) => void + } + pageInit: () => void + } } } -const adSlots = { - leaderboard: { - id: 'div-gpt-ad-1738811978953-leaderboard', - sizes: [[728, 90]], - targeting: 'leaderboard', - refreshInterval: 45_000, - }, - footer: { - id: 'div-gpt-ad-1738811978953-footer', - sizes: [[728, 90]], - targeting: 'footer', - refreshInterval: 45_000, - }, - rightRail: { - id: 'div-gpt-ad-1738811978953-right-rail', - sizes: [[300, 250]], - targeting: 'right-side-rail', - refreshInterval: 45_000, - }, - leftRail: { - id: 'div-gpt-ad-1738811978953-left-rail', - sizes: [[300, 250]], - targeting: 'left-side-rail', - refreshInterval: 45_000, - }, -} as Record< - string, - { - id: string - sizes: [number, number][] - targeting: string - refreshInterval: number - slot?: any - } -> - -export function GoogleScripts() { - return ( - <> - - - ) +export function GamOnPageChange() { + if (typeof window === 'undefined' || !window.fusetag) return + window.fusetag.que.push(function () { + window.fusetag.pageInit() + }) } -function Gad({ +export const GamScripts = () => ( + <> +