mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 19:19:52 +02:00
feat: remove ads
This commit is contained in:
1 parent
b1f29a6148
commit
aa8bb1c040
21 files changed
+56
-187
No files matched your search
@@ -1,25 +0,0 @@
|
|||||||
import { Box, type BoxProps } from '@radix-ui/themes';
|
|
||||||
import { useEffect } from 'react';
|
|
||||||
|
|
||||||
export type AdProps = BoxProps & {
|
|
||||||
id: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export function Ad({ id, ...props }: AdProps) {
|
|
||||||
useEffect(() => {
|
|
||||||
(window as any).nitroAds.createAd(id, {
|
|
||||||
refreshTime: 30,
|
|
||||||
demo: import.meta.env.MODE === 'development',
|
|
||||||
renderVisibleOnly: true,
|
|
||||||
delayLoading: true,
|
|
||||||
report: {
|
|
||||||
enabled: true,
|
|
||||||
icon: true,
|
|
||||||
wording: 'Report Ad',
|
|
||||||
position: 'top-right-side',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}, [id]);
|
|
||||||
|
|
||||||
return <Box id={id} className="ad-container" {...props} />;
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import { Ad, type AdProps } from './Ad';
|
|
||||||
|
|
||||||
type AdResponsiveHorizontal = AdProps;
|
|
||||||
|
|
||||||
export function AdResponsiveHorizontal(props: AdResponsiveHorizontal) {
|
|
||||||
return <Ad height="250px" width="100%" {...props} />;
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { Flex, Table } from '@radix-ui/themes';
|
|
||||||
import { AdResponsiveHorizontal } from './AdResponsiveHorizontal';
|
|
||||||
|
|
||||||
interface AdStickyTableRowProps {
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function AdStickyTableRow({ id }: AdStickyTableRowProps) {
|
|
||||||
return (
|
|
||||||
<Table.Body style={{ height: 250 }}>
|
|
||||||
<Table.Row align="center">
|
|
||||||
<Flex
|
|
||||||
justify="center"
|
|
||||||
align="center"
|
|
||||||
position="absolute"
|
|
||||||
width="100%"
|
|
||||||
left="0"
|
|
||||||
>
|
|
||||||
<AdResponsiveHorizontal id={id} />
|
|
||||||
</Flex>
|
|
||||||
</Table.Row>
|
|
||||||
</Table.Body>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { App } from '../stores/app';
|
|
||||||
import { Ad, type AdProps } from './Ad';
|
|
||||||
|
|
||||||
export function AdWithContext(props: AdProps) {
|
|
||||||
return (
|
|
||||||
<App.Provider>
|
|
||||||
<Ad {...props} />
|
|
||||||
</App.Provider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,6 @@ import { asset } from '@blitzkit/core';
|
|||||||
import { Flex, Heading, IconButton, Table } from '@radix-ui/themes';
|
import { Flex, Heading, IconButton, Table } from '@radix-ui/themes';
|
||||||
import type { TankCharacteristics } from '../../core/blitzkit/tankCharacteristics';
|
import type { TankCharacteristics } from '../../core/blitzkit/tankCharacteristics';
|
||||||
import { CompareEphemeral } from '../../stores/compareEphemeral';
|
import { CompareEphemeral } from '../../stores/compareEphemeral';
|
||||||
import { AdStickyTableRow } from '../AdStickyTableRow';
|
|
||||||
import { StickyColumnHeaderCell } from '../StickyColumnHeaderCell';
|
import { StickyColumnHeaderCell } from '../StickyColumnHeaderCell';
|
||||||
import { CompareRow } from './CompareRow';
|
import { CompareRow } from './CompareRow';
|
||||||
import { CompareSectionTitle } from './CompareSectionTitle';
|
import { CompareSectionTitle } from './CompareSectionTitle';
|
||||||
@@ -76,8 +75,6 @@ export function Body({ stats }: BodyProps) {
|
|||||||
</Table.Row>
|
</Table.Row>
|
||||||
</Table.Header>
|
</Table.Header>
|
||||||
|
|
||||||
<AdStickyTableRow id="compare-1" />
|
|
||||||
|
|
||||||
<Table.Body>
|
<Table.Body>
|
||||||
<CompareRow stats={stats} name="DPM" value="dpm" decimals={0} />
|
<CompareRow stats={stats} name="DPM" value="dpm" decimals={0} />
|
||||||
<CompareRow
|
<CompareRow
|
||||||
@@ -223,8 +220,6 @@ export function Body({ stats }: BodyProps) {
|
|||||||
/>
|
/>
|
||||||
</Table.Body>
|
</Table.Body>
|
||||||
|
|
||||||
<AdStickyTableRow id="compare-2" />
|
|
||||||
|
|
||||||
<CompareSectionTitle>Maneuverability</CompareSectionTitle>
|
<CompareSectionTitle>Maneuverability</CompareSectionTitle>
|
||||||
<Table.Body>
|
<Table.Body>
|
||||||
<CompareRow
|
<CompareRow
|
||||||
@@ -335,8 +330,6 @@ export function Body({ stats }: BodyProps) {
|
|||||||
/>
|
/>
|
||||||
</Table.Body>
|
</Table.Body>
|
||||||
|
|
||||||
<AdStickyTableRow id="compare-3" />
|
|
||||||
|
|
||||||
<CompareSectionTitle>Survivability</CompareSectionTitle>
|
<CompareSectionTitle>Survivability</CompareSectionTitle>
|
||||||
<Table.Body>
|
<Table.Body>
|
||||||
<CompareRow stats={stats} name="Health" value="health" decimals={0} />
|
<CompareRow stats={stats} name="Health" value="health" decimals={0} />
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { Skeleton, type SkeletonProps } from '@radix-ui/themes';
|
||||||
|
|
||||||
|
export function InlineSkeleton({ style, ...props }: SkeletonProps) {
|
||||||
|
return (
|
||||||
|
<Skeleton
|
||||||
|
height="1em"
|
||||||
|
style={{ display: 'inline-block', ...style }}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import { Table } from '@radix-ui/themes';
|
|
||||||
import { times } from 'lodash-es';
|
|
||||||
import { RowLoader } from './RowLoader';
|
|
||||||
|
|
||||||
export function BodyLoader() {
|
|
||||||
return (
|
|
||||||
<Table.Body>
|
|
||||||
{times(10, (index) => (
|
|
||||||
<RowLoader key={index} />
|
|
||||||
))}
|
|
||||||
</Table.Body>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -5,16 +5,21 @@ import {
|
|||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
import { InfoCircledIcon } from '@radix-ui/react-icons';
|
import { InfoCircledIcon } from '@radix-ui/react-icons';
|
||||||
import { Callout, Flex } from '@radix-ui/themes';
|
import { Callout, Flex } from '@radix-ui/themes';
|
||||||
|
import type { MaybeSkeletonComponentProps } from '../../types/maybeSkeletonComponentProps';
|
||||||
|
import { InlineSkeleton } from '../InlineSkeleton';
|
||||||
|
|
||||||
const discoveredIdsDefinitions = await fetchDiscoveredIdsDefinitions();
|
const discoveredIdsDefinitions = await fetchDiscoveredIdsDefinitions();
|
||||||
const averageDefinitions = await fetchAverageDefinitions();
|
const averageDefinitions = await fetchAverageDefinitions();
|
||||||
|
|
||||||
export function PerformanceInfo() {
|
export function PerformanceInfo({ skeleton }: MaybeSkeletonComponentProps) {
|
||||||
const samples = discoveredIdsDefinitions.count;
|
const samples = formatCompact(Math.round(discoveredIdsDefinitions.count));
|
||||||
const minutesAgo = Math.floor(
|
const minutesAgo = Math.floor(
|
||||||
(Date.now() - averageDefinitions.time) / (1000 * 60),
|
(Date.now() - averageDefinitions.time) / (1000 * 60),
|
||||||
);
|
);
|
||||||
const hoursAgo = Math.floor(minutesAgo / 60);
|
const hoursAgo = Math.floor(minutesAgo / 60);
|
||||||
|
const timeAgo = `${hoursAgo === 0 ? minutesAgo : hoursAgo} ${
|
||||||
|
hoursAgo === 0 ? 'minutes' : 'hours'
|
||||||
|
}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex justify="center">
|
<Flex justify="center">
|
||||||
@@ -23,9 +28,9 @@ export function PerformanceInfo() {
|
|||||||
<InfoCircledIcon />
|
<InfoCircledIcon />
|
||||||
</Callout.Icon>
|
</Callout.Icon>
|
||||||
<Callout.Text>
|
<Callout.Text>
|
||||||
Career stats based on {formatCompact(Math.round(samples))} players.
|
Career stats based on{' '}
|
||||||
Updated {hoursAgo === 0 ? minutesAgo : hoursAgo}{' '}
|
{skeleton ? <InlineSkeleton width="2rem" /> : samples} players.
|
||||||
{hoursAgo === 0 ? 'minutes' : 'hours'} ago.
|
Updated {skeleton ? <InlineSkeleton width="4rem" /> : timeAgo} ago.
|
||||||
</Callout.Text>
|
</Callout.Text>
|
||||||
</Callout.Root>
|
</Callout.Root>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -1,25 +1,19 @@
|
|||||||
import { Flex } from '@radix-ui/themes';
|
import { Flex } from '@radix-ui/themes';
|
||||||
import { Suspense } from 'react';
|
import type { MaybeSkeletonComponentProps } from '../../types/maybeSkeletonComponentProps';
|
||||||
import { StickyTableRoot } from '../StickyTableRoot';
|
import { StickyTableRoot } from '../StickyTableRoot';
|
||||||
import { BodyLoader } from './BodyLoader';
|
|
||||||
import { Header } from './Header';
|
import { Header } from './Header';
|
||||||
import { Tanks } from './Tanks';
|
import { Tanks } from './Tanks';
|
||||||
|
|
||||||
export function TankTable() {
|
export function TankTable({ skeleton }: MaybeSkeletonComponentProps) {
|
||||||
return (
|
return (
|
||||||
<Flex justify="center">
|
<Flex justify="center">
|
||||||
<StickyTableRoot
|
<StickyTableRoot
|
||||||
size={{ initial: '1', sm: '2' }}
|
size={{ initial: '1', sm: '2' }}
|
||||||
variant="surface"
|
variant="surface"
|
||||||
style={{
|
style={{ maxWidth: '100%' }}
|
||||||
maxWidth: '100%',
|
|
||||||
// maxHeight: 'calc(100vh - 256px)'
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Header />
|
<Header />
|
||||||
<Suspense fallback={<BodyLoader />}>
|
<Tanks skeleton={skeleton} />
|
||||||
<Tanks />
|
|
||||||
</Suspense>
|
|
||||||
</StickyTableRoot>
|
</StickyTableRoot>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { filterTank } from '../../core/blitzkit/filterTank';
|
|||||||
import { $tankFilters } from '../../stores/tankFilters';
|
import { $tankFilters } from '../../stores/tankFilters';
|
||||||
import { TankPerformancePersistent } from '../../stores/tankPerformancePersistent';
|
import { TankPerformancePersistent } from '../../stores/tankPerformancePersistent';
|
||||||
import { TankPerformanceSort } from '../../stores/tankPerformanceSort';
|
import { TankPerformanceSort } from '../../stores/tankPerformanceSort';
|
||||||
import { AdStickyTableRow } from '../AdStickyTableRow';
|
import type { MaybeSkeletonComponentProps } from '../../types/maybeSkeletonComponentProps';
|
||||||
import { RowLoader } from './RowLoader';
|
import { RowLoader } from './RowLoader';
|
||||||
import { TankRow } from './TankRow';
|
import { TankRow } from './TankRow';
|
||||||
import { Total } from './Total';
|
import { Total } from './Total';
|
||||||
@@ -24,7 +24,17 @@ const averageDefinitionsArray = await fetchAverageDefinitions().then(
|
|||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
|
|
||||||
export function Tanks() {
|
export function Tanks({ skeleton }: MaybeSkeletonComponentProps) {
|
||||||
|
if (skeleton) {
|
||||||
|
return (
|
||||||
|
<Table.Body>
|
||||||
|
{times(16, (index) => (
|
||||||
|
<RowLoader key={index} />
|
||||||
|
))}
|
||||||
|
</Table.Body>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const sort = TankPerformanceSort.use();
|
const sort = TankPerformanceSort.use();
|
||||||
const tankPerformancePersistentStore = TankPerformancePersistent.useStore();
|
const tankPerformancePersistentStore = TankPerformancePersistent.useStore();
|
||||||
const filters = useStore($tankFilters);
|
const filters = useStore($tankFilters);
|
||||||
@@ -132,16 +142,11 @@ export function Tanks() {
|
|||||||
|
|
||||||
{tanks.slice(0, loadedRows).map((averages, index) => {
|
{tanks.slice(0, loadedRows).map((averages, index) => {
|
||||||
const tank = tankDefinitions.tanks[averages.id];
|
const tank = tankDefinitions.tanks[averages.id];
|
||||||
const hasAd = index % 16 === 0;
|
|
||||||
const adId = Math.floor(index / 16);
|
|
||||||
|
|
||||||
if (tank === undefined) return null;
|
if (tank === undefined) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment key={tank.id}>
|
<Fragment key={tank.id}>
|
||||||
{hasAd && (
|
|
||||||
<AdStickyTableRow id={`performance-${adId}-${tank.id}`} />
|
|
||||||
)}
|
|
||||||
<Suspense fallback={<RowLoader />}>
|
<Suspense fallback={<RowLoader />}>
|
||||||
<TankRow tank={tank} />
|
<TankRow tank={tank} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
import { slateDarkA } from '@radix-ui/colors';
|
|
||||||
import { keyframes, style } from '@vanilla-extract/css';
|
|
||||||
|
|
||||||
const animation = keyframes({
|
|
||||||
'0%': { backgroundColor: slateDarkA.slateA2 },
|
|
||||||
'50%': { backgroundColor: slateDarkA.slateA3 },
|
|
||||||
'100%': { backgroundColor: slateDarkA.slateA2 },
|
|
||||||
});
|
|
||||||
|
|
||||||
export const skeleton = style({
|
|
||||||
borderRadius: 8,
|
|
||||||
animation: `${animation} 2s ease-in-out infinite`,
|
|
||||||
});
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import type { ComponentProps } from 'react';
|
|
||||||
import { skeleton } from './index.css';
|
|
||||||
|
|
||||||
export function Skeleton({ className, ...props }: ComponentProps<'div'>) {
|
|
||||||
return <div {...props} className={`${className} ${skeleton}`} />;
|
|
||||||
}
|
|
||||||
@@ -6,9 +6,9 @@ export function StickyTableRoot({ style, ...props }: RootProps) {
|
|||||||
const table = useRef<HTMLTableElement>(null);
|
const table = useRef<HTMLTableElement>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
table.current
|
// table.current
|
||||||
?.querySelector('table')
|
// ?.querySelector('table')
|
||||||
?.style.setProperty('overflow', 'auto');
|
// ?.style.setProperty('overflow', 'auto');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { useStore } from '@nanostores/react';
|
|||||||
import { Callout, Flex, Link, Text, type FlexProps } from '@radix-ui/themes';
|
import { Callout, Flex, Link, Text, type FlexProps } from '@radix-ui/themes';
|
||||||
import fuzzysort from 'fuzzysort';
|
import fuzzysort from 'fuzzysort';
|
||||||
import { times } from 'lodash-es';
|
import { times } from 'lodash-es';
|
||||||
import { Fragment, memo, useEffect, useMemo, useState } from 'react';
|
import { memo, useEffect, useMemo, useState } from 'react';
|
||||||
import { filterTank } from '../../core/blitzkit/filterTank';
|
import { filterTank } from '../../core/blitzkit/filterTank';
|
||||||
import { resolveReload } from '../../core/blitzkit/resolveReload';
|
import { resolveReload } from '../../core/blitzkit/resolveReload';
|
||||||
import { useAdExempt } from '../../hooks/useAdExempt';
|
import { useAdExempt } from '../../hooks/useAdExempt';
|
||||||
@@ -23,7 +23,6 @@ import {
|
|||||||
SORT_UNITS,
|
SORT_UNITS,
|
||||||
} from '../../stores/tankopediaPersistent/constants';
|
} from '../../stores/tankopediaPersistent/constants';
|
||||||
import { $tankopediaSort } from '../../stores/tankopediaSort';
|
import { $tankopediaSort } from '../../stores/tankopediaSort';
|
||||||
import { AdResponsiveHorizontal } from '../AdResponsiveHorizontal';
|
|
||||||
import { ExperimentIcon } from '../ExperimentIcon';
|
import { ExperimentIcon } from '../ExperimentIcon';
|
||||||
import { FilterControl } from './components/FilterControl';
|
import { FilterControl } from './components/FilterControl';
|
||||||
import { NoResults } from './components/NoResults';
|
import { NoResults } from './components/NoResults';
|
||||||
@@ -463,27 +462,9 @@ export const TankSearch = memo<TankSearchProps>(
|
|||||||
<>
|
<>
|
||||||
{tanks.length > 0 && (
|
{tanks.length > 0 && (
|
||||||
<TankCardWrapper>
|
<TankCardWrapper>
|
||||||
{tanks.map((tank, index) => {
|
{tanks.map((tank) => (
|
||||||
const hasAd = (index + 16) % 32 === 0;
|
<TankCard key={tank.id} onSelect={onSelect} tank={tank} />
|
||||||
const adId = Math.floor(index / 32);
|
))}
|
||||||
|
|
||||||
return (
|
|
||||||
<Fragment key={tank.id}>
|
|
||||||
<TankCard onSelect={onSelect} tank={tank} />
|
|
||||||
|
|
||||||
{!exempt &&
|
|
||||||
!compact &&
|
|
||||||
hasAd &&
|
|
||||||
index !== tanks.length - 1 && (
|
|
||||||
<Flex gridColumn="1 / -1">
|
|
||||||
<AdResponsiveHorizontal
|
|
||||||
id={`tankopedia-search-${adId}`}
|
|
||||||
/>
|
|
||||||
</Flex>
|
|
||||||
)}
|
|
||||||
</Fragment>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
|
|
||||||
{times(
|
{times(
|
||||||
Math.min(PREVIEW_COUNT, tanksFiltered.length - loadedRows),
|
Math.min(PREVIEW_COUNT, tanksFiltered.length - loadedRows),
|
||||||
|
|||||||
-13
@@ -503,19 +503,6 @@ export function Characteristics() {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
{/* AD TODO: */}
|
|
||||||
{/* {!exempt && (
|
|
||||||
<Flex
|
|
||||||
justify="center"
|
|
||||||
display={{
|
|
||||||
initial: 'flex',
|
|
||||||
xs: 'none',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Ad type={AdType.MediumRectangleHorizontalPurple} />
|
|
||||||
</Flex>
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
<Flex direction="column" gap="8" style={{ flex: 1 }}>
|
<Flex direction="column" gap="8" style={{ flex: 1 }}>
|
||||||
<Flex direction="column" gap="2">
|
<Flex direction="column" gap="2">
|
||||||
<Heading size="5">Maneuverability</Heading>
|
<Heading size="5">Maneuverability</Heading>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ type Name =
|
|||||||
| `color-${'background' | `panel-${'solid' | 'translucent'}` | 'surface' | 'overlay'}`
|
| `color-${'background' | `panel-${'solid' | 'translucent'}` | 'surface' | 'overlay'}`
|
||||||
| `radius-${1 | 2 | 3 | 4 | 5 | 6 | 'full'}`
|
| `radius-${1 | 2 | 3 | 4 | 5 | 6 | 'full'}`
|
||||||
| `space-${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`
|
| `space-${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`
|
||||||
| string;
|
|
||||||
|
|
||||||
export function Var(name: Name) {
|
export function Var(name: Name) {
|
||||||
return `var(--${name})`;
|
return `var(--${name})`;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
---
|
---
|
||||||
import { Box, Flex, Heading } from '@radix-ui/themes';
|
import { Box, Flex, Heading } from '@radix-ui/themes';
|
||||||
import { AdResponsiveHorizontal } from '../components/AdResponsiveHorizontal';
|
|
||||||
import HomeHero from '../components/HomeHero.astro';
|
import HomeHero from '../components/HomeHero.astro';
|
||||||
import { Plugs } from '../components/Plugs.tsx';
|
import { Plugs } from '../components/Plugs.tsx';
|
||||||
import ToolCard from '../components/ToolCard.astro';
|
import ToolCard from '../components/ToolCard.astro';
|
||||||
@@ -24,10 +23,6 @@ import BaseLayout from '../layouts/BaseLayout.astro';
|
|||||||
<Flex maxWidth="64rem" flexGrow="1" gap="4" direction="column">
|
<Flex maxWidth="64rem" flexGrow="1" gap="4" direction="column">
|
||||||
<ToolCard tool={tankopediaTool} />
|
<ToolCard tool={tankopediaTool} />
|
||||||
|
|
||||||
<Flex justify="center">
|
|
||||||
<AdResponsiveHorizontal client:idle id="homepage-1" />
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
||||||
{/* <ToolCard tool={playerStatsTool} /> */}
|
{/* <ToolCard tool={playerStatsTool} /> */}
|
||||||
<ToolCard tool={compareTool} />
|
<ToolCard tool={compareTool} />
|
||||||
@@ -41,10 +36,6 @@ import BaseLayout from '../layouts/BaseLayout.astro';
|
|||||||
<ToolCard tool={discordTool} />
|
<ToolCard tool={discordTool} />
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex justify="center">
|
|
||||||
<AdResponsiveHorizontal client:idle id="homepage-2" />
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
||||||
<ToolCard tool={moreTool} />
|
<ToolCard tool={moreTool} />
|
||||||
<Box flexGrow="1" />
|
<Box flexGrow="1" />
|
||||||
|
|||||||
@@ -4,23 +4,24 @@ import { PerformanceInfo } from '../../../components/Performance/PerformanceInfo
|
|||||||
import { TankTable } from '../../../components/Performance/Table';
|
import { TankTable } from '../../../components/Performance/Table';
|
||||||
import { TankPerformancePersistent } from '../../../stores/tankPerformancePersistent';
|
import { TankPerformancePersistent } from '../../../stores/tankPerformancePersistent';
|
||||||
import { TankPerformanceSort } from '../../../stores/tankPerformanceSort';
|
import { TankPerformanceSort } from '../../../stores/tankPerformanceSort';
|
||||||
|
import type { MaybeSkeletonComponentProps } from '../../../types/maybeSkeletonComponentProps';
|
||||||
|
|
||||||
export function Page() {
|
export function Page({ skeleton }: MaybeSkeletonComponentProps) {
|
||||||
return (
|
return (
|
||||||
<TankPerformanceSort.Provider>
|
<TankPerformanceSort.Provider>
|
||||||
<TankPerformancePersistent.Provider>
|
<TankPerformancePersistent.Provider>
|
||||||
<Content />
|
<Content skeleton={skeleton} />
|
||||||
</TankPerformancePersistent.Provider>
|
</TankPerformancePersistent.Provider>
|
||||||
</TankPerformanceSort.Provider>
|
</TankPerformanceSort.Provider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Content() {
|
function Content({ skeleton }: MaybeSkeletonComponentProps) {
|
||||||
return (
|
return (
|
||||||
<PageWrapper color="jade" noMaxWidth>
|
<PageWrapper color="jade" noMaxWidth>
|
||||||
<PerformanceInfo />
|
<PerformanceInfo skeleton={skeleton} />
|
||||||
<Controls />
|
<Controls />
|
||||||
<TankTable />
|
<TankTable skeleton={skeleton} />
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -5,5 +5,7 @@ import { Page } from './_index';
|
|||||||
---
|
---
|
||||||
|
|
||||||
<ToolLayout tool={performanceTool}>
|
<ToolLayout tool={performanceTool}>
|
||||||
<Page client:load />
|
<Page client:only="react">
|
||||||
|
<Page skeleton slot="fallback" />
|
||||||
|
</Page>
|
||||||
</ToolLayout>
|
</ToolLayout>
|
||||||
@@ -3,7 +3,6 @@ import {
|
|||||||
fetchProvisionDefinitions,
|
fetchProvisionDefinitions,
|
||||||
fetchTankDefinitions,
|
fetchTankDefinitions,
|
||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
import { AdResponsiveHorizontal } from '../../../../components/AdResponsiveHorizontal';
|
|
||||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||||
import { CalloutsSection } from '../../../../components/Tankopedia/CalloutsSection';
|
import { CalloutsSection } from '../../../../components/Tankopedia/CalloutsSection';
|
||||||
import { CharacteristicsSection } from '../../../../components/Tankopedia/CharacteristicsSection';
|
import { CharacteristicsSection } from '../../../../components/Tankopedia/CharacteristicsSection';
|
||||||
@@ -48,16 +47,12 @@ export function Page({ id }: PageProps) {
|
|||||||
>
|
>
|
||||||
<HeroSection />
|
<HeroSection />
|
||||||
<ShotDisplaySection />
|
<ShotDisplaySection />
|
||||||
<AdResponsiveHorizontal id="tankopedia-1" />
|
|
||||||
<CalloutsSection />
|
<CalloutsSection />
|
||||||
<MetaSection />
|
<MetaSection />
|
||||||
<TechTreeSection />
|
<TechTreeSection />
|
||||||
<AdResponsiveHorizontal id="tankopedia-2" />
|
|
||||||
<CharacteristicsSection />
|
<CharacteristicsSection />
|
||||||
<AdResponsiveHorizontal id="tankopedia-3" />
|
|
||||||
<GameModeSection />
|
<GameModeSection />
|
||||||
<VideoSection />
|
<VideoSection />
|
||||||
<AdResponsiveHorizontal id="tankopedia-4" />
|
|
||||||
<HistorySection />
|
<HistorySection />
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</Duel.Provider>
|
</Duel.Provider>
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export interface MaybeSkeletonComponentProps {
|
||||||
|
skeleton?: boolean;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user