From 8b082ed31ffc62a263f4e3a597b5d93b4a322004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Tue, 25 Jun 2024 20:01:51 -0500 Subject: [PATCH] feat: exempt --- .../tools/tankopedia/components/TankSearch/index.tsx | 10 +++++++--- src/app/tools/tankopedia/page.tsx | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/app/tools/tankopedia/components/TankSearch/index.tsx b/src/app/tools/tankopedia/components/TankSearch/index.tsx index 0fda77707..7a5410c97 100644 --- a/src/app/tools/tankopedia/components/TankSearch/index.tsx +++ b/src/app/tools/tankopedia/components/TankSearch/index.tsx @@ -19,6 +19,7 @@ import { } from '../../../../../core/blitzkit/tankDefinitions'; import { tankopediaFilterTank } from '../../../../../core/blitzkit/tankopediaFilterTank'; import { unionBoundingBox } from '../../../../../core/blitzkit/unionBoundingBox'; +import { useAdExempt } from '../../../../../hooks/useAdExempt'; import { SORT_NAMES, SORT_UNITS } from '../../../../../stores/tankopedia'; import { useTankopediaFilters } from '../../../../../stores/tankopediaFilters'; import { FilterControl } from '../FilterControl'; @@ -37,6 +38,7 @@ type TankSearchProps = FlexProps & { export const TankSearch = memo( ({ compact, onSelect, onSelectAll, ...props }) => { + const exempt = useAdExempt(); const awaitedGameDefinitions = use(gameDefinitions); const awaitedModelDefinitions = use(modelDefinitions); const awaitedTankDefinitions = use(tankDefinitions); @@ -415,9 +417,11 @@ export const TankSearch = memo( {tanks.map((tank, index) => ( <> - {(index + 16) % 32 === 0 && index !== tanks.length - 1 && ( - - )} + {!exempt && + (index + 16) % 32 === 0 && + index !== tanks.length - 1 && ( + + )} ))} diff --git a/src/app/tools/tankopedia/page.tsx b/src/app/tools/tankopedia/page.tsx index 16f578dc9..65732580d 100644 --- a/src/app/tools/tankopedia/page.tsx +++ b/src/app/tools/tankopedia/page.tsx @@ -2,13 +2,16 @@ import { AdMidSectionResponsive } from '../../../components/AdMidSectionResponsive'; import PageWrapper from '../../../components/PageWrapper'; +import { useAdExempt } from '../../../hooks/useAdExempt'; import { TankSearch } from './components/TankSearch'; export default function Page() { + const exempt = useAdExempt(); + return ( - + {!exempt && } ); }