Skip to content

Commit

Permalink
Add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
ruscoder committed Jan 26, 2025
1 parent e38aea3 commit 2077c0e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions web/src/containers/Main/useIDELayout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { useLocalStorage } from 'shared/src/hooks/local-storage';

interface IDELayout {
vertical: number[];
horizontal1: number[];
horizontal2: number[];
}

export function useIDELayout() {
const [layout, setLayoutRaw] = useLocalStorage<IDELayout>('sdc-ide-layout', {
vertical: [1, 1],
horizontal1: [1, 1, 1],
horizontal2: [1, 1, 1],
});
const setLayout = (key: keyof IDELayout, values: IDELayout[typeof key]) => {
setLayoutRaw((prevLayout) => ({ ...prevLayout, [key]: values }));
};

return { layout, setLayout };
}

0 comments on commit 2077c0e

Please sign in to comment.