fix: some linting

This commit is contained in:
TrèsAbhi committed 2024-10-09 10:29:42 -05:00
1 parent ae0e2f45dc
commit 66f33746cb
30 files changed
+82 -1856

No files matched your search

+51 -55
View File
@@ -1,8 +1,4 @@
import { imgur } from '@blitzkit/core';
import { Box, type BoxProps, Text } from '@radix-ui/themes';
import { uniqueId } from 'lodash-es';
import { useEffect, useRef } from 'react';
import type { Vector2Tuple } from 'three';
import { type BoxProps } from '@radix-ui/themes';
export enum AdType {
MediumRectangleHorizontalPurple = 738182777,
@@ -11,65 +7,65 @@ export enum AdType {
HalfPageVerticalPurple = 880185176,
}
const AD_DIMENSIONS: Record<AdType, Vector2Tuple> = {
[AdType.MediumRectangleHorizontalPurple]: [300, 250],
[AdType.LeaderboardHorizontalPurple]: [728, 90],
[AdType.WideSkyscraperVerticalPurple]: [160, 600],
[AdType.HalfPageVerticalPurple]: [300, 600],
};
// const AD_DIMENSIONS: Record<AdType, Vector2Tuple> = {
// [AdType.MediumRectangleHorizontalPurple]: [300, 250],
// [AdType.LeaderboardHorizontalPurple]: [728, 90],
// [AdType.WideSkyscraperVerticalPurple]: [160, 600],
// [AdType.HalfPageVerticalPurple]: [300, 600],
// };
type AdProps = BoxProps & {
type: AdType;
};
export function Ad({ type, style, ...props }: AdProps) {
export function Ad({}: AdProps) {
return null;
const id = useRef(uniqueId());
const dimensions = AD_DIMENSIONS[type];
// const id = useRef(uniqueId());
// const dimensions = AD_DIMENSIONS[type];
useEffect(() => {
(window as any).msAdsQueue.push(function () {
(window as any).mmnow.render({
adUnitId: type,
elementId: `${type}-${id.current}`,
});
});
}, [type]);
// useEffect(() => {
// (window as any).msAdsQueue.push(function () {
// (window as any).mmnow.render({
// adUnitId: type,
// elementId: `${type}-${id.current}`,
// });
// });
// }, [type]);
return (
<Box
position="relative"
width={`${dimensions[0]}px`}
height={`${dimensions[1]}px`}
style={{
outline: '1px solid var(--gray-3)',
borderRadius: 'var(--radius-1)',
background: `url(${imgur('DK21EHY')})`,
// return (
// <Box
// position="relative"
// width={`${dimensions[0]}px`}
// height={`${dimensions[1]}px`}
// style={{
// outline: '1px solid var(--gray-3)',
// borderRadius: 'var(--radius-1)',
// background: `url(${imgur('DK21EHY')})`,
...style,
}}
{...props}
>
<Text
color="gray"
style={{
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
}}
align="center"
>
Advertisement
</Text>
// ...style,
// }}
// {...props}
// >
// <Text
// color="gray"
// style={{
// position: 'absolute',
// top: '50%',
// left: '50%',
// transform: 'translate(-50%, -50%)',
// }}
// align="center"
// >
// Advertisement
// </Text>
<Box
width={`${dimensions[0]}px`}
height={`${dimensions[1]}px`}
position="relative"
id={`${type}-${id.current}`}
/>
</Box>
);
// <Box
// width={`${dimensions[0]}px`}
// height={`${dimensions[1]}px`}
// position="relative"
// id={`${type}-${id.current}`}
// />
// </Box>
// );
}
@@ -1,25 +1,24 @@
import { Flex, type FlexProps } from '@radix-ui/themes';
import { Ad, AdType } from './Ad';
import { type FlexProps } from '@radix-ui/themes';
export function AdMidSectionResponsive(props: FlexProps) {
export function AdMidSectionResponsive(_: FlexProps) {
return null;
return (
<Flex justify="center" py="4" gap="4" {...props}>
<Ad
display={{
initial: 'none',
sm: 'block',
}}
type={AdType.LeaderboardHorizontalPurple}
/>
<Ad
display={{
initial: 'block',
sm: 'none',
}}
type={AdType.MediumRectangleHorizontalPurple}
/>
</Flex>
);
// return (
// <Flex justify="center" py="4" gap="4" {...props}>
// <Ad
// display={{
// initial: 'none',
// sm: 'block',
// }}
// type={AdType.LeaderboardHorizontalPurple}
// />
// <Ad
// display={{
// initial: 'block',
// sm: 'none',
// }}
// type={AdType.MediumRectangleHorizontalPurple}
// />
// </Flex>
// );
}
+5 -5
View File
@@ -1,8 +1,8 @@
<script async src="https://www.googletagmanager.com/gtag/js?id=G-GL2JVHCGPQ"
></script>
<script>
// @ts-nocheck
<script
is:inline
async
src="https://www.googletagmanager.com/gtag/js?id=G-GL2JVHCGPQ"></script>
<script is:inline>
window.dataLayer = window.dataLayer || [];
function gtag() {
@@ -32,9 +32,6 @@ export const TankModel = memo(() => {
turretModelDefinition.guns[protagonist.gun.gun_type!.value.base.id];
const { gltf } = useModel(protagonist.tank.id);
const nodes = Object.values(gltf.nodes);
const isDynamicArmorActive = Duel.use((state) =>
state.protagonist.consumables.includes(73),
);
useTankTransform(protagonist, turretContainer, gunContainer);
@@ -9,7 +9,6 @@ import {
Text,
} from '@radix-ui/themes';
import { useState } from 'react';
import { App } from '../../../../../../stores/app';
import { Duel } from '../../../../../../stores/duel';
import { $wargamingLogin } from '../../../../../../stores/wargamingLogin';
import { Stars } from '../../Stars';
@@ -20,7 +19,6 @@ export function VoteCaster() {
const [firepower, setFirepower] = useState<StarsInt | null>(null);
const [maneuverability, setManeuverability] = useState<StarsInt | null>(null);
const [survivability, setSurvivability] = useState<StarsInt | null>(null);
const appStore = App.useStore();
// true = vote successful, false = vote failed, null = hide alert
const [postVote, setPostVote] = useState<boolean | null>(null);
// true = open, false = closed, null = casting
@@ -174,10 +174,6 @@ export function tankCharacteristics(
[hasSupercharger, 0.35],
[hasImprovedGunPowder, 0.3],
);
const penetrationLossOverDistanceCoefficient = coefficient([
hasSupercharger,
-0.6,
]);
const aimTimeCoefficient =
coefficient(
[hasEnhancedGunLayingDrive, -0.15],
@@ -1,7 +1,6 @@
import {
STAT_KEYS,
STAT_NAMES,
UNLOCALIZED_REGION_NAMES_SHORT,
deltaTankStats,
fetchAverageDefinitions,
fetchTankDefinitions,
@@ -17,6 +16,7 @@ import {
type IndividualTankStats,
type Stat,
} from '@blitzkit/core';
import strings from '@blitzkit/core/lang/en-US.json';
import {
ArrowDownIcon,
MagnifyingGlassIcon,
@@ -102,8 +102,6 @@ function Content() {
: undefined,
[delta],
);
const [showLinkOverridePrompt, setShowLinkOverridePrompt] = useState(true);
const search = debounce(async () => {
if (!input.current) return;
@@ -242,7 +240,7 @@ function Content() {
onClick={() => track(player.account_id)}
>
{player.nickname} (
{UNLOCALIZED_REGION_NAMES_SHORT[player.region]})
{strings.common.regions.short[player.region]})
</Button>
))}
</Flex>
+1 -1
View File
@@ -27,7 +27,7 @@ type Session = SessionTracking | SessionNotTracking;
export const Session = createContextualStore(() =>
create<Session>()(
persist(
(set) => ({
(_) => ({
columns: ['battles', 'winrate', 'wn8', 'averageDamage'],
tracking: false,
}),