mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: added options
This commit is contained in:
1 parent
8264f19ad4
commit
7f431b07e1
7 files changed
+305
-142
No files matched your search
@@ -1,5 +1,7 @@
|
||||
import { produce } from 'immer';
|
||||
import { create } from 'zustand';
|
||||
import { devtools, persist } from 'zustand/middleware';
|
||||
import { CustomColumnDisplay } from '../app/tools/session/components/CustomColumn';
|
||||
import { Region } from '../constants/regions';
|
||||
import { NormalizedTankStats } from '../types/tanksStats';
|
||||
|
||||
@@ -18,6 +20,11 @@ type Session = (
|
||||
}
|
||||
) & {
|
||||
promptBeforeReset: boolean;
|
||||
customColumns: {
|
||||
display: CustomColumnDisplay;
|
||||
showDelta: boolean;
|
||||
}[] & { length: 4 };
|
||||
showTotal: boolean;
|
||||
};
|
||||
|
||||
export const useSession = create<Session>()(
|
||||
@@ -26,6 +33,14 @@ export const useSession = create<Session>()(
|
||||
(set) => ({
|
||||
isTracking: false,
|
||||
promptBeforeReset: true,
|
||||
showTotal: true,
|
||||
|
||||
customColumns: [
|
||||
{ display: 'battles', showDelta: false },
|
||||
{ display: 'winrate', showDelta: true },
|
||||
{ display: 'wn8', showDelta: false },
|
||||
{ display: 'damage', showDelta: true },
|
||||
],
|
||||
}),
|
||||
{
|
||||
name: 'session',
|
||||
@@ -33,3 +48,7 @@ export const useSession = create<Session>()(
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
export default function mutateSession(recipe: (draft: Session) => void) {
|
||||
useSession.setState(produce(recipe));
|
||||
}
|
||||
Reference in new issue
Block a user