mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: exempt
This commit is contained in:
1 parent
7cc086b999
commit
8b082ed31f
2 files changed
+11
-4
No files matched your search
@@ -19,6 +19,7 @@ import {
|
|||||||
} from '../../../../../core/blitzkit/tankDefinitions';
|
} from '../../../../../core/blitzkit/tankDefinitions';
|
||||||
import { tankopediaFilterTank } from '../../../../../core/blitzkit/tankopediaFilterTank';
|
import { tankopediaFilterTank } from '../../../../../core/blitzkit/tankopediaFilterTank';
|
||||||
import { unionBoundingBox } from '../../../../../core/blitzkit/unionBoundingBox';
|
import { unionBoundingBox } from '../../../../../core/blitzkit/unionBoundingBox';
|
||||||
|
import { useAdExempt } from '../../../../../hooks/useAdExempt';
|
||||||
import { SORT_NAMES, SORT_UNITS } from '../../../../../stores/tankopedia';
|
import { SORT_NAMES, SORT_UNITS } from '../../../../../stores/tankopedia';
|
||||||
import { useTankopediaFilters } from '../../../../../stores/tankopediaFilters';
|
import { useTankopediaFilters } from '../../../../../stores/tankopediaFilters';
|
||||||
import { FilterControl } from '../FilterControl';
|
import { FilterControl } from '../FilterControl';
|
||||||
@@ -37,6 +38,7 @@ type TankSearchProps = FlexProps & {
|
|||||||
|
|
||||||
export const TankSearch = memo<TankSearchProps>(
|
export const TankSearch = memo<TankSearchProps>(
|
||||||
({ compact, onSelect, onSelectAll, ...props }) => {
|
({ compact, onSelect, onSelectAll, ...props }) => {
|
||||||
|
const exempt = useAdExempt();
|
||||||
const awaitedGameDefinitions = use(gameDefinitions);
|
const awaitedGameDefinitions = use(gameDefinitions);
|
||||||
const awaitedModelDefinitions = use(modelDefinitions);
|
const awaitedModelDefinitions = use(modelDefinitions);
|
||||||
const awaitedTankDefinitions = use(tankDefinitions);
|
const awaitedTankDefinitions = use(tankDefinitions);
|
||||||
@@ -415,9 +417,11 @@ export const TankSearch = memo<TankSearchProps>(
|
|||||||
{tanks.map((tank, index) => (
|
{tanks.map((tank, index) => (
|
||||||
<>
|
<>
|
||||||
<TankCard onSelect={onSelect} key={tank.id} tank={tank} />
|
<TankCard onSelect={onSelect} key={tank.id} tank={tank} />
|
||||||
{(index + 16) % 32 === 0 && index !== tanks.length - 1 && (
|
{!exempt &&
|
||||||
<AdMidSectionResponsive gridColumn="1 / -1" />
|
(index + 16) % 32 === 0 &&
|
||||||
)}
|
index !== tanks.length - 1 && (
|
||||||
|
<AdMidSectionResponsive gridColumn="1 / -1" />
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
</TankCardWrapper>
|
</TankCardWrapper>
|
||||||
|
|||||||
@@ -2,13 +2,16 @@
|
|||||||
|
|
||||||
import { AdMidSectionResponsive } from '../../../components/AdMidSectionResponsive';
|
import { AdMidSectionResponsive } from '../../../components/AdMidSectionResponsive';
|
||||||
import PageWrapper from '../../../components/PageWrapper';
|
import PageWrapper from '../../../components/PageWrapper';
|
||||||
|
import { useAdExempt } from '../../../hooks/useAdExempt';
|
||||||
import { TankSearch } from './components/TankSearch';
|
import { TankSearch } from './components/TankSearch';
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
|
const exempt = useAdExempt();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageWrapper color="purple" size={1028}>
|
<PageWrapper color="purple" size={1028}>
|
||||||
<TankSearch />
|
<TankSearch />
|
||||||
<AdMidSectionResponsive />
|
{!exempt && <AdMidSectionResponsive />}
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user