mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: migrated tank search
This commit is contained in:
1 parent
0537418f6a
commit
e241870ece
36 files changed
+868
-718
No files matched your search
@@ -1,6 +1,5 @@
|
||||
import { TankClass, Tier, TreeType } from '@blitzkit/core';
|
||||
import { create } from 'zustand';
|
||||
import { createContextualSafeStore } from '../core/zustand/createContextualSafeStore';
|
||||
import type { TankClass, Tier, TreeType } from '@blitzkit/core';
|
||||
import { map } from 'nanostores';
|
||||
|
||||
export interface TankFilters {
|
||||
tiers: Tier[];
|
||||
@@ -12,15 +11,14 @@ export interface TankFilters {
|
||||
searching: boolean;
|
||||
}
|
||||
|
||||
export const { Provider, use, useMutation, useStore } =
|
||||
createContextualSafeStore(() =>
|
||||
create<TankFilters>()(() => ({
|
||||
tiers: [],
|
||||
nations: [],
|
||||
classes: [],
|
||||
types: [],
|
||||
testing: 'include',
|
||||
search: undefined,
|
||||
searching: false,
|
||||
})),
|
||||
);
|
||||
export const initialTankFilters: TankFilters = {
|
||||
tiers: [],
|
||||
nations: [],
|
||||
classes: [],
|
||||
types: [],
|
||||
testing: 'include',
|
||||
search: undefined,
|
||||
searching: false,
|
||||
};
|
||||
|
||||
export const $tankFilters = map<TankFilters>(initialTankFilters);
|
||||
@@ -2,7 +2,7 @@ import { TankClass, Tier, TreeType } from '@blitzkit/core';
|
||||
import lodash from 'lodash-es';
|
||||
import { create } from 'zustand';
|
||||
import { persist, subscribeWithSelector } from 'zustand/middleware';
|
||||
import { ENVIRONMENTS } from '../../app/tools/tankopedia/[id]/components/Lighting';
|
||||
import { ENVIRONMENTS } from '../../constants/lightingEnvironments';
|
||||
import { createContextualSafeStore } from '../../core/zustand/createContextualSafeStore';
|
||||
import { SORT_NAMES, TankopediaDisplay } from './constants';
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { create } from 'zustand';
|
||||
import { createContextualSafeStore } from '../core/zustand/createContextualSafeStore';
|
||||
import { map } from 'nanostores';
|
||||
import {
|
||||
TankopediaSortBy,
|
||||
TankopediaSortDirection,
|
||||
type TankopediaSortBy,
|
||||
type TankopediaSortDirection,
|
||||
} from './tankopediaPersistent';
|
||||
|
||||
export interface TankopediaSort {
|
||||
@@ -10,10 +9,7 @@ export interface TankopediaSort {
|
||||
direction: TankopediaSortDirection;
|
||||
}
|
||||
|
||||
export const { Provider, use, useMutation, useStore } =
|
||||
createContextualSafeStore(() =>
|
||||
create<TankopediaSort>()(() => ({
|
||||
by: 'meta.none',
|
||||
direction: 'descending',
|
||||
})),
|
||||
);
|
||||
export const $tankopediaSort = map<TankopediaSort>({
|
||||
by: 'meta.none',
|
||||
direction: 'descending',
|
||||
});
|
||||
Reference in new issue
Block a user