mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: some linting for new proto 5
This commit is contained in:
1 parent
53a9c5f2de
commit
96310a9d63
40 files changed
+409
-367
No files matched your search
@@ -1,22 +1,9 @@
|
||||
import {
|
||||
createDefaultSkills,
|
||||
equipmentDefinitions,
|
||||
modelDefinitions,
|
||||
provisionDefinitions,
|
||||
skillDefinitions,
|
||||
tankDefinitions,
|
||||
} from '@blitzkit/core';
|
||||
import { createDefaultSkills } from '@blitzkit/core';
|
||||
import { PlusIcon } from '@radix-ui/react-icons';
|
||||
import { Box, Flex, Heading, IconButton, Text } from '@radix-ui/themes';
|
||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
||||
import { use, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { CompareControls } from '../../../../../website/src/components/Controls';
|
||||
import { DamageWarning } from '../../../../../website/src/components/DamageWarning';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { tankCharacteristics } from '../../../core/blitzkit/tankCharacteristics';
|
||||
import { tankToCompareMember } from '../../../core/blitzkit/tankToCompareMember';
|
||||
import * as CompareEphemeral from '../../../stores/compareEphemeral';
|
||||
import { CompareTable } from '../../../../../website/src/components/Compare/CompareTable';
|
||||
|
||||
export default function Page() {
|
||||
const pathname = usePathname();
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
import { compositeStatsKeys, tankDefinitionsArray } from '@blitzkit/core';
|
||||
import strings from '@blitzkit/core/lang/en-US.json';
|
||||
import { use } from 'react';
|
||||
import {
|
||||
BreakdownEmbedCard,
|
||||
BreakdownEmbedWrapper,
|
||||
} from '../../../../components/TanksEmbed';
|
||||
import { breakdownConfig } from '../../../../../../website/src/constants/embeds';
|
||||
import { useEmbedStateCurry } from '../../../../stores/embedState/utilities';
|
||||
|
||||
export const compositeStatsKeysOptions = compositeStatsKeys.map((value) => ({
|
||||
label: strings.common.composite_stats[value],
|
||||
value,
|
||||
}));
|
||||
|
||||
export function BreakdownPreview() {
|
||||
const tanks = use(tankDefinitionsArray);
|
||||
const { useState } = useEmbedStateCurry<typeof breakdownConfig>();
|
||||
|
||||
return (
|
||||
<BreakdownEmbedWrapper>
|
||||
{useState('showTotal') && <BreakdownEmbedCard tank={null} />}
|
||||
|
||||
{tanks.slice(0, useState('listMaxTanks')).map((tank) => (
|
||||
<BreakdownEmbedCard key={tank.id} tank={tank} />
|
||||
))}
|
||||
</BreakdownEmbedWrapper>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +1,6 @@
|
||||
import { averageDefinitionsArray, tankDefinitions } from '@blitzkit/core';
|
||||
import { Table } from '@radix-ui/themes';
|
||||
import { times } from 'lodash-es';
|
||||
import { Suspense, use, useEffect, useMemo, useState } from 'react';
|
||||
import { filterTank } from '../../../../core/blitzkit/filterTank';
|
||||
import * as TankFilters from '../../../../stores/tankFilters';
|
||||
import * as TankPerformancePersistent from '../../../../stores/tankPerformancePersistent';
|
||||
import * as TankPerformanceSort from '../../../../stores/tankPerformanceSort';
|
||||
import { RowLoader } from './RowLoader';
|
||||
import { TankRow } from './TankRow';
|
||||
import { Total } from './Total';
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import {
|
||||
averageDefinitionsArray,
|
||||
formatCompact,
|
||||
TANK_CLASSES,
|
||||
TankClass,
|
||||
tankDefinitions,
|
||||
Tier,
|
||||
TIER_ROMAN_NUMERALS,
|
||||
} from '@blitzkit/core';
|
||||
|
||||
@@ -6,8 +6,8 @@ import {
|
||||
STAT_NAMES,
|
||||
Stat,
|
||||
UNLOCALIZED_REGION_NAMES_SHORT,
|
||||
blitzStarsTankAverages,
|
||||
deltaTankStats,
|
||||
fetchTankDefinitions,
|
||||
generateStats,
|
||||
getAccountInfo,
|
||||
getTankStats,
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
prettifyStats,
|
||||
searchPlayersAcrossRegions,
|
||||
sumBlitzStarsStats,
|
||||
tankDefinitions,
|
||||
} from '@blitzkit/core';
|
||||
import {
|
||||
ArrowDownIcon,
|
||||
@@ -37,9 +36,8 @@ import {
|
||||
} from '@radix-ui/themes';
|
||||
import { debounce } from 'lodash-es';
|
||||
import { use, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { TankRowHeaderCell } from '../../../components/TankRowHeaderCell';
|
||||
import * as Session from '../../../stores/session';
|
||||
|
||||
const awaitedTankDefinitions = await fetchTankDefinitions();
|
||||
|
||||
export default function Page({
|
||||
searchParams,
|
||||
@@ -47,8 +45,6 @@ export default function Page({
|
||||
searchParams: { id?: string };
|
||||
}) {
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const awaitedTankDefinitions = use(tankDefinitions);
|
||||
const awaitedTankAvearges = use(blitzStarsTankAverages);
|
||||
const [showSearch, setShowSearch] = useState(false);
|
||||
const [searching, setSearching] = useState(false);
|
||||
const [searchResults, setSearchResults] = useState<AccountListWithServer>([]);
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import {
|
||||
modelDefinitions,
|
||||
provisionDefinitions,
|
||||
tankDefinitions,
|
||||
tankDefinitionsArray,
|
||||
fetchModelDefinitions,
|
||||
fetchTankDefinitions,
|
||||
tankIcon,
|
||||
TIER_ROMAN_NUMERALS,
|
||||
} from '@blitzkit/core';
|
||||
import strings from '@blitzkit/core/lang/en-US.json';
|
||||
import { ReactNode } from 'react';
|
||||
import * as Duel from '../../../../stores/duel';
|
||||
import * as TankopediaEphemeral from '../../../../stores/tankopediaEphemeral';
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const tanks = await tankDefinitionsArray;
|
||||
const tankDefinitions = await fetchTankDefinitions();
|
||||
const tanks = Object.values(tankDefinitions.tanks);
|
||||
return tanks.map((tank) => ({ id: `${tank.id}` }));
|
||||
}
|
||||
|
||||
const tankDefinitions = await fetchTankDefinitions();
|
||||
const definitions = await fetchModelDefinitions();
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
params,
|
||||
@@ -24,11 +24,9 @@ export default async function Layout({
|
||||
params: { id: string };
|
||||
}) {
|
||||
const id = Number(params.id);
|
||||
const awaitedTankDefinitions = await tankDefinitions;
|
||||
const awaitedModelDefinitions = await modelDefinitions;
|
||||
const tankModelDefinition = awaitedModelDefinitions[id];
|
||||
const tankModelDefinition = definitions[id];
|
||||
const awaitedProvisionDefinitions = await provisionDefinitions;
|
||||
const tank = awaitedTankDefinitions[id];
|
||||
const tank = tankDefinitions[id];
|
||||
const title = `${tank.name} - Tier ${TIER_ROMAN_NUMERALS[tank.tier]} ${
|
||||
(strings.common.nations_adjectives as Record<string, string>)[tank.nation]
|
||||
} ${strings.common.tank_class_short[tank.class]}`;
|
||||
@@ -38,7 +36,7 @@ export default async function Layout({
|
||||
<TankopediaEphemeral.Provider data={tankModelDefinition}>
|
||||
<Duel.Provider
|
||||
data={{
|
||||
tank: awaitedTankDefinitions[id],
|
||||
tank: tankDefinitions[id],
|
||||
provisionDefinitions: awaitedProvisionDefinitions,
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user