mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
Revert "feat: progress on tankopedia search"
This reverts commit eebc33581c.
This commit is contained in:
1 parent
f02ae9833d
commit
a6f60ac0de
20 files changed
+230
-258
No files matched your search
@@ -11,7 +11,7 @@ export interface TankFilters {
|
||||
searching: boolean;
|
||||
}
|
||||
|
||||
export const initialTankFilters : TankFilters = {
|
||||
export const $tankFilters = map<TankFilters>({
|
||||
tiers: [],
|
||||
nations: [],
|
||||
classes: [],
|
||||
@@ -19,6 +19,4 @@ export const initialTankFilters : TankFilters = {
|
||||
testing: 'include',
|
||||
search: undefined,
|
||||
searching: false,
|
||||
}
|
||||
|
||||
export const $tankFilters = map<TankFilters>(initialTankFilters);
|
||||
});
|
||||
@@ -1,5 +1,9 @@
|
||||
import type { TankClass, Tier, TreeType } from '@blitzkit/core';
|
||||
import type { ENVIRONMENTS } from '../../components/Sandbox/components/Lighting';
|
||||
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 { createContextualSafeStore } from '../../core/zustand/createContextualSafeStore';
|
||||
import { SORT_NAMES, TankopediaDisplay } from './constants';
|
||||
|
||||
export type TankopediaSortBy = keyof typeof SORT_NAMES;
|
||||
@@ -34,39 +38,39 @@ export interface TankopediaPersistent {
|
||||
display: TankopediaDisplay;
|
||||
}
|
||||
|
||||
// export const { Provider, use, useMutation, useStore } =
|
||||
// createContextualSafeStore(() =>
|
||||
// create<TankopediaPersistent>()(
|
||||
// persist(
|
||||
// subscribeWithSelector<TankopediaPersistent>(() => ({
|
||||
// model: {
|
||||
// visual: {
|
||||
// showSpacedArmor: true,
|
||||
// showExternalModules: true,
|
||||
// showPrimaryArmor: true,
|
||||
// wireframe: false,
|
||||
// opaque: false,
|
||||
// environment: ENVIRONMENTS[0],
|
||||
// showGrid: true,
|
||||
// greenPenetration: false,
|
||||
// showEnvironment: false,
|
||||
// },
|
||||
// },
|
||||
// sort: {
|
||||
// by: 'meta.none',
|
||||
// direction: 'descending',
|
||||
// },
|
||||
// filters: {
|
||||
// tiers: [],
|
||||
// types: [],
|
||||
// treeTypes: [],
|
||||
// nations: [],
|
||||
// test: 'include',
|
||||
// page: 0,
|
||||
// },
|
||||
// display: TankopediaDisplay.Model,
|
||||
// })),
|
||||
// { name: 'tankopedia', merge: (a, b) => lodash.merge(b, a) },
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
export const { Provider, use, useMutation, useStore } =
|
||||
createContextualSafeStore(() =>
|
||||
create<TankopediaPersistent>()(
|
||||
persist(
|
||||
subscribeWithSelector<TankopediaPersistent>(() => ({
|
||||
model: {
|
||||
visual: {
|
||||
showSpacedArmor: true,
|
||||
showExternalModules: true,
|
||||
showPrimaryArmor: true,
|
||||
wireframe: false,
|
||||
opaque: false,
|
||||
environment: ENVIRONMENTS[0],
|
||||
showGrid: true,
|
||||
greenPenetration: false,
|
||||
showEnvironment: false,
|
||||
},
|
||||
},
|
||||
sort: {
|
||||
by: 'meta.none',
|
||||
direction: 'descending',
|
||||
},
|
||||
filters: {
|
||||
tiers: [],
|
||||
types: [],
|
||||
treeTypes: [],
|
||||
nations: [],
|
||||
test: 'include',
|
||||
page: 0,
|
||||
},
|
||||
display: TankopediaDisplay.Model,
|
||||
})),
|
||||
{ name: 'tankopedia', merge: (a, b) => lodash.merge(b, a) },
|
||||
),
|
||||
),
|
||||
);
|
||||
Reference in new issue
Block a user