diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-06-30 23:30:36 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-06-30 23:30:36 +0200 |
| commit | 9e01efdc8832ebbac6bd995675ce1bd2ea3b8613 (patch) | |
| tree | 55797a54eb0616d9d9aadff1cbb5d33943ff66ea /apps/web/src/stores | |
| parent | 011be3d9a55b0a90a4c4ce02c532f367179667c4 (diff) | |
| download | opencut-9e01efdc8832ebbac6bd995675ce1bd2ea3b8613.tar.gz | |
refactor: consolidate default panel sizes into a constant for improved maintainability
Diffstat (limited to 'apps/web/src/stores')
| -rw-r--r-- | apps/web/src/stores/panel-store.ts | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/web/src/stores/panel-store.ts b/apps/web/src/stores/panel-store.ts index 7706417a..656fb062 100644 --- a/apps/web/src/stores/panel-store.ts +++ b/apps/web/src/stores/panel-store.ts @@ -1,6 +1,14 @@ import { create } from "zustand";
import { persist } from "zustand/middleware";
+const DEFAULT_PANEL_SIZES = {
+ toolsPanel: 25,
+ previewPanel: 75,
+ propertiesPanel: 20,
+ mainContent: 70,
+ timeline: 30,
+} as const;
+
interface PanelState {
// Panel sizes as percentages
toolsPanel: number;
@@ -21,11 +29,7 @@ export const usePanelStore = create<PanelState>()( persist(
(set) => ({
// Default sizes - optimized for responsiveness
- toolsPanel: 25,
- previewPanel: 75,
- propertiesPanel: 20,
- mainContent: 70,
- timeline: 30,
+ ...DEFAULT_PANEL_SIZES,
// Actions
setToolsPanel: (size) => set({ toolsPanel: size }),
|
