feat: segmented control mode

This commit is contained in:
TrèsAbhi committed 2024-07-28 13:32:52 -05:00
1 parent 6e7df526ff
commit 6ebced6f01
11 files changed
+160 -237

No files matched your search

@@ -58,3 +58,8 @@ export const SORT_NAMES = {
'maneuverability.weight': 'weight',
'maneuverability.traverseSpeed': 'traverse speed',
} as const;
export enum TankopediaDisplay {
Model,
DynamicArmor,
StaticArmor,
}
+3 -8
View File
@@ -7,14 +7,11 @@ import { ENVIRONMENTS } from '../../app/tools/tankopedia/[id]/components/Lightin
import { TankClass, TreeType } from '../../components/Tanks';
import { Tier } from '../../core/blitzkit/tankDefinitions';
import { createNextSafeStore } from '../../core/zustand/createNextSafeStore';
import { SORT_NAMES } from './constants';
import { SORT_NAMES, TankopediaDisplay } from './constants';
export type TankopediaSortBy = keyof typeof SORT_NAMES;
export type TankopediaSortDirection = 'ascending' | 'descending';
export type TankopediaTestTankDisplay = 'include' | 'exclude' | 'only';
export type TankopediaMode = 'model' | 'armor';
export type TankopediaArmorMode = 'blitz' | 'static';
export interface TankopediaPersistent {
model: {
visual: {
@@ -39,8 +36,7 @@ export interface TankopediaPersistent {
test: TankopediaTestTankDisplay;
page: number;
};
mode: TankopediaMode;
armorMode: TankopediaArmorMode;
display: TankopediaDisplay;
}
export const { Provider, use, useMutation, useStore } = createNextSafeStore(
@@ -71,8 +67,7 @@ export const { Provider, use, useMutation, useStore } = createNextSafeStore(
test: 'include',
page: 0,
},
mode: 'model',
armorMode: 'blitz',
display: TankopediaDisplay.Model,
})),
{ name: 'tankopedia', merge: (a, b) => merge(b, a) },
),