feat: ads

This commit is contained in:
TrèsAbhi committed 2024-06-10 13:52:25 -05:00
1 parent e370a53473
commit 626eb7e2d6
5 files changed
+28 -25

No files matched your search

+1
View File
@@ -93,6 +93,7 @@
"Minotauro",
"MIPMAPCOUNT",
"mišek",
"mmnow",
"modeltransform",
"MURICA",
"NEGATIVEX",
+5
View File
@@ -3,6 +3,7 @@
import { Flex } from '@radix-ui/themes';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { Ad, AdType } from '../../../components/Ad';
import PageWrapper from '../../../components/PageWrapper';
import { TankSearch } from './components/TankSearch';
@@ -11,6 +12,10 @@ export default function Page() {
return (
<PageWrapper size={1200} color="purple">
<Flex justify="center">
<Ad type={AdType.TankopediaHorizontal800} style={{ flex: 1 }} />
</Flex>
<TankSearch
onSelect={(tank) => {
router.push(`./tankopedia/${tank.id}`);
+21
View File
@@ -0,0 +1,21 @@
'use client';
import { ComponentProps, useEffect } from 'react';
export enum AdType {
TankopediaHorizontal800 = 738182777,
}
interface AdProps extends ComponentProps<'div'> {
type: AdType;
}
export function Ad({ type, ...props }: AdProps) {
useEffect(() => {
(window as any).msAdsQueue.push(function () {
(window as any).mmnow.render({ adUnitId: type, elementId: type });
});
});
return <div id={`${type}`} {...props} />;
}
-24
View File
@@ -1,24 +0,0 @@
export function AdHorizontal() {
return (
<>
<script
async
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1289406790225052"
crossOrigin="anonymous"
/>
<ins
className="adsbygoogle"
style={{ display: 'block' }}
data-ad-client="ca-pub-1289406790225052"
data-ad-slot="2391822409"
data-ad-format="auto"
data-full-width-responsive="true"
/>
<script
dangerouslySetInnerHTML={{
__html: `(adsbygoogle = window.adsbygoogle || []).push({});`,
}}
/>
</>
);
}
+1 -1
View File
@@ -36,7 +36,7 @@ export function Party3() {
{/* pub center */}
<script
async
src="https://adsdk.microsoft.com/pubcenter/sdk.js?siteId=364600&publisherId=253617120"
src="https://adsdk.microsoft.com/mmnow/sdk.js?siteId=364645&publisherId=253617120"
crossOrigin="anonymous"
/>
</>