- Remove redundant Settings link from sidebar (accessible via user menu) - Move Transactions section below Board Reference for better grouping - Promote Investment Scenarios to its own top-level sidebar item - Add Compact View preference with tighter spacing theme - Wire compact theme into MantineProvider with dynamic switching - Enable Compact View toggle in both Preferences and Settings pages - Install missing @simplewebauthn/browser package (lock file update) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
940 B
TypeScript
34 lines
940 B
TypeScript
import { create } from 'zustand';
|
|
import { persist } from 'zustand/middleware';
|
|
|
|
type ColorScheme = 'light' | 'dark';
|
|
|
|
interface PreferencesState {
|
|
colorScheme: ColorScheme;
|
|
compactView: boolean;
|
|
toggleColorScheme: () => void;
|
|
setColorScheme: (scheme: ColorScheme) => void;
|
|
toggleCompactView: () => void;
|
|
setCompactView: (compact: boolean) => void;
|
|
}
|
|
|
|
export const usePreferencesStore = create<PreferencesState>()(
|
|
persist(
|
|
(set) => ({
|
|
colorScheme: 'light',
|
|
compactView: false,
|
|
toggleColorScheme: () =>
|
|
set((state) => ({
|
|
colorScheme: state.colorScheme === 'light' ? 'dark' : 'light',
|
|
})),
|
|
setColorScheme: (scheme) => set({ colorScheme: scheme }),
|
|
toggleCompactView: () =>
|
|
set((state) => ({ compactView: !state.compactView })),
|
|
setCompactView: (compact) => set({ compactView: compact }),
|
|
}),
|
|
{
|
|
name: 'ledgeriq-preferences',
|
|
},
|
|
),
|
|
);
|