mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 23:45:48 +01:00
🐛 Fix deprecated zustand dependencies
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import { create } from 'zustand';
|
||||
import { createWithEqualityFn } from 'zustand/traditional';
|
||||
|
||||
interface EditModeState {
|
||||
enabled: boolean;
|
||||
toggleEditMode: () => void;
|
||||
}
|
||||
|
||||
export const useEditModeStore = create<EditModeState>((set) => ({
|
||||
enabled: false,
|
||||
toggleEditMode: () => set((state) => ({ enabled: !state.enabled })),
|
||||
}));
|
||||
export const useEditModeStore = createWithEqualityFn<EditModeState>(
|
||||
(set) => ({
|
||||
enabled: false,
|
||||
toggleEditMode: () => set((state) => ({ enabled: !state.enabled })),
|
||||
}),
|
||||
Object.is
|
||||
);
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import { create } from 'zustand';
|
||||
import { createWithEqualityFn } from 'zustand/traditional';
|
||||
|
||||
import { useConfigContext } from '../../../../config/provider';
|
||||
import { GridstackBreakpoints } from '../../../../constants/gridstack-breakpoints';
|
||||
|
||||
export const useGridstackStore = create<GridstackStoreType>((set, get) => ({
|
||||
mainAreaWidth: null,
|
||||
currentShapeSize: null,
|
||||
setMainAreaWidth: (w: number) =>
|
||||
set((v) => ({ ...v, mainAreaWidth: w, currentShapeSize: getCurrentShapeSize(w) })),
|
||||
}));
|
||||
export const useGridstackStore = createWithEqualityFn<GridstackStoreType>(
|
||||
(set, get) => ({
|
||||
mainAreaWidth: null,
|
||||
currentShapeSize: null,
|
||||
setMainAreaWidth: (w: number) =>
|
||||
set((v) => ({ ...v, mainAreaWidth: w, currentShapeSize: getCurrentShapeSize(w) })),
|
||||
}),
|
||||
Object.is
|
||||
);
|
||||
|
||||
interface GridstackStoreType {
|
||||
mainAreaWidth: null | number;
|
||||
|
||||
Reference in New Issue
Block a user