feat: better ad discriminators

This commit is contained in:
TrèsAbhi committed 2024-10-12 21:42:38 -05:00
1 parent dea84321d4
commit d8d1b4a016
2 files changed
+21 -15

No files matched your search

@@ -470,20 +470,26 @@ export const TankSearch = memo<TankSearchProps>(
<>
{tanks.length > 0 && (
<TankCardWrapper>
{tanks.map((tank, index) => (
<Fragment key={tank.id}>
<TankCard onSelect={onSelect} tank={tank} />
{tanks.map((tank, index) => {
const hasAd = (index + 16) % 32 === 0;
{!exempt &&
!compact &&
(index + 16) % 32 === 0 &&
index !== tanks.length - 1 && (
<Box gridColumn="1 / -1">
<Ad id={`ad-${index}`} />
</Box>
)}
</Fragment>
))}
return (
<Fragment key={tank.id}>
<TankCard onSelect={onSelect} tank={tank} />
{!exempt &&
!compact &&
hasAd &&
index !== tanks.length - 1 && (
<Box gridColumn="1 / -1">
<Ad
id={`tankopedia-search-ad-${Math.floor(index / 32)}`}
/>
</Box>
)}
</Fragment>
);
})}
{times(
Math.min(PREVIEW_COUNT, tanksFiltered.length - loadedRows),
+2 -2
View File
@@ -24,7 +24,7 @@ import RootLayout from '../layouts/RootLayout.astro';
<Flex maxWidth="64rem" flexGrow="1" gap="4" direction="column">
<ToolCard tool={tankopediaTool} />
<Ad client:only="react" id="ad-1" />
<Ad client:only="react" id="homepage-ad-1" />
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
{/* <ToolCard tool={playerStatsTool} /> */}
@@ -39,7 +39,7 @@ import RootLayout from '../layouts/RootLayout.astro';
<ToolCard tool={discordTool} />
</Flex>
<Ad client:only="react" id="ad-2" />
<Ad client:only="react" id="homepage-ad-2" />
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
<ToolCard tool={moreTool} />