Merge branch '1.16.0' into main

This commit is contained in:
TrèsAbhi authored and GitHub committed 2023-12-13 12:08:55 -06:00
commit 0a19157dbb
64 files changed
+5805 -1714

No files matched your search

+18 -20
View File
@@ -1,6 +1,6 @@
import { produce } from 'immer';
import { create } from 'zustand';
import { devtools, persist } from 'zustand/middleware';
import { persist } from 'zustand/middleware';
import { CustomColumnDisplay } from '../app/tools/session/components/CustomColumn';
import { AccentColor, GrayColor } from '../constants/radixColors';
import { Region } from '../constants/regions';
@@ -66,26 +66,24 @@ export function resetSession() {
}
export const useSession = create<Session>()(
devtools(
persist(
(set) => ({
title: 'Untitled session',
isTracking: false,
resetPrompt: true,
showTotal: true,
showCareer: true,
embedPrompt: true,
persist(
(set) => ({
title: 'Untitled session',
isTracking: false,
resetPrompt: true,
showTotal: true,
showCareer: true,
embedPrompt: true,
customColumns: [
{ display: 'battles', showDelta: false },
{ display: 'winrate', showDelta: true },
{ display: 'wn8', showDelta: false },
{ display: 'damage', showDelta: true },
],
color: 'slate',
}),
{ name: 'session' },
),
customColumns: [
{ display: 'battles', showDelta: false },
{ display: 'winrate', showDelta: true },
{ display: 'wn8', showDelta: false },
{ display: 'damage', showDelta: true },
],
color: 'slate',
}),
{ name: 'session' },
),
);
+40
View File
@@ -0,0 +1,40 @@
import { produce } from 'immer';
import { create } from 'zustand';
import { TankType, TreeTypeString } from '../components/Tanks';
import { Tier } from '../core/blitzkrieg/definitions/tanks';
export type TankopediaSortBy = 'tier' | 'name';
export type TankopediaSortDirection = 'ascending' | 'descending';
export type TankopediaTestTankDisplay = 'include' | 'exclude' | 'only';
type Tankopedia = {
sort: {
by: TankopediaSortBy;
direction: TankopediaSortDirection;
};
filters: {
tiers: Tier[];
types: TankType[];
treeTypes: TreeTypeString[];
nations: string[];
test: TankopediaTestTankDisplay;
};
};
export const useTankopedia = create<Tankopedia>()(() => ({
sort: {
by: 'tier',
direction: 'descending',
},
filters: {
tiers: [],
types: [],
treeTypes: [],
nations: [],
test: 'include',
},
}));
export default function mutateTankopedia(recipe: (draft: Tankopedia) => void) {
useTankopedia.setState(produce(recipe));
}