fix: some linting for new proto 4

This commit is contained in:
TrèsAbhi committed 2024-10-05 20:55:44 -05:00
1 parent f14ca394b5
commit 53a9c5f2de
22 files changed
+155 -133

No files matched your search

@@ -1,4 +1,4 @@
import { BlitzkitResponse, StarsInt } from '@blitzkit/core';
import type { BlitzkitResponse, StarsInt } from '@blitzkit/core';
import { PaperPlaneIcon } from '@radix-ui/react-icons';
import {
AlertDialog,
@@ -9,8 +9,9 @@ import {
Text,
} from '@radix-ui/themes';
import { useState } from 'react';
import * as App from '../../../../../../../../../../stores/app';
import * as Duel from '../../../../../../../../../../stores/duel';
import { App } from '../../../../../../stores/app';
import { Duel } from '../../../../../../stores/duel';
import { $wargamingLogin } from '../../../../../../stores/wargamingLogin';
import { Stars } from '../../Stars';
export function VoteCaster() {
@@ -98,9 +99,9 @@ export function VoteCaster() {
survivability === null)
}
onClick={() => {
const wargaming = appStore.getState().logins.wargaming;
const wargaming = $wargamingLogin.get();
if (!wargaming) {
if (!wargaming.token) {
return setShowDialogue(false);
}
@@ -1,8 +1,10 @@
import {
assertSecret,
asset,
modelDefinitions,
provisionDefinitions,
fetchModelDefinitions,
fetchProvisionDefinitions,
TankPriceType,
TankType,
} from '@blitzkit/core';
import strings from '@blitzkit/core/lang/en-US.json';
import { ChevronLeftIcon, MixIcon, UpdateIcon } from '@radix-ui/react-icons';
@@ -17,8 +19,8 @@ import { ScienceIcon } from '../../ScienceIcon';
import { TankSearch } from '../../TankSearch';
import { Listing } from './components/Listing';
const awaitedProvisionDefinitions = await provisionDefinitions;
const awaitedModelDefinitions = await modelDefinitions;
const provisionDefinitions = await fetchProvisionDefinitions();
const modelDefinitions = await fetchModelDefinitions();
export function MetaSection() {
const developerMode = App.useDeferred((state) => state.developerMode, false);
@@ -78,12 +80,12 @@ export function MetaSection() {
onSelect={(tank) => {
setShowSwapDialog(false);
mutateTankopediaEphemeral((draft) => {
draft.model = awaitedModelDefinitions[tank.id];
draft.model = modelDefinitions.models[tank.id];
});
mutateDuel((draft) => {
draft.protagonist = tankToDuelMember(
tank,
awaitedProvisionDefinitions,
provisionDefinitions,
);
});
@@ -130,14 +132,14 @@ export function MetaSection() {
<Listing
label="Type"
color={
protagonist.treeType === 'collector'
protagonist.type === TankType.COLLECTOR
? 'blue'
: protagonist.treeType === 'premium'
: protagonist.type === TankType.PREMIUM
? 'amber'
: undefined
}
>
{strings.common.tree_type[protagonist.treeType]}
{strings.common.tree_type[protagonist.type]}
</Listing>
</Flex>
@@ -147,7 +149,7 @@ export function MetaSection() {
<Code>{protagonist.id}</Code>
</Listing>
)}
{protagonist.treeType === 'premium' && (
{protagonist.type === TankType.PREMIUM && (
<Listing label="Purchase price">
<Flex align="center" gap="1">
{protagonist.price.value / 400}
@@ -161,7 +163,7 @@ export function MetaSection() {
)}
<Listing
label={`${
protagonist.treeType === 'researchable'
protagonist.type === TankType.RESEARCHABLE
? 'Purchase'
: 'Restoration'
} price`}
@@ -170,10 +172,12 @@ export function MetaSection() {
{protagonist.price.value.toLocaleString()}
<img
style={{ width: '1em', height: '1em' }}
alt={protagonist.price.type}
alt={TankPriceType[protagonist.price.type]}
src={asset(
`icons/currencies/${
protagonist.price.type === 'gold' ? 'gold' : 'silver'
protagonist.price.type === TankPriceType.GOLD
? 'gold'
: 'silver'
}.webp`,
)}
/>
@@ -184,10 +188,12 @@ export function MetaSection() {
{(protagonist.price.value / 2).toLocaleString()}
<img
style={{ width: '1em', height: '1em' }}
alt={protagonist.price.type}
alt={TankPriceType[protagonist.price.type]}
src={asset(
`icons/currencies/${
protagonist.price.type === 'gold' ? 'gold' : 'silver'
protagonist.price.type === TankPriceType.GOLD
? 'gold'
: 'silver'
}.webp`,
)}
/>