mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: start of sorting
This commit is contained in:
1 parent
479a165149
commit
38b2b6025f
8 files changed
+455
-75
No files matched your search
@@ -2,6 +2,7 @@ import { produce } from 'immer';
|
||||
import { create } from 'zustand';
|
||||
import { TankClass, TreeType } from '../components/Tanks';
|
||||
import { Tier } from '../core/blitzkit/tankDefinitions';
|
||||
import { TankopediaSortBy, TankopediaSortDirection } from './tankopedia';
|
||||
|
||||
export interface TankopediaFilters {
|
||||
tier?: Tier;
|
||||
@@ -10,10 +11,18 @@ export interface TankopediaFilters {
|
||||
type?: TreeType;
|
||||
testing: 'include' | 'exclude' | 'only';
|
||||
search?: string;
|
||||
sort: {
|
||||
by: TankopediaSortBy;
|
||||
direction: TankopediaSortDirection;
|
||||
};
|
||||
}
|
||||
|
||||
export const useTankopediaFilters = create<TankopediaFilters>()(() => ({
|
||||
testing: 'include',
|
||||
sort: {
|
||||
by: 'meta.tier',
|
||||
direction: 'descending',
|
||||
},
|
||||
}));
|
||||
|
||||
export function mutateTankopediaFilters(
|
||||
|
||||
Reference in new issue
Block a user