mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Add collapsible sidebar (#68)
- Sidebar can collapse by menu option or dragging
This commit is contained in:
parent
ec7a053a74
commit
e49fe6c452
11 changed files with 348 additions and 50 deletions
|
|
@ -5,6 +5,7 @@ import { immer } from 'zustand/middleware/immer';
|
|||
import { Platform } from '/@/renderer/types';
|
||||
|
||||
type SidebarProps = {
|
||||
collapsed: boolean;
|
||||
expanded: string[];
|
||||
image: boolean;
|
||||
leftWidth: string;
|
||||
|
|
@ -20,13 +21,7 @@ type TitlebarProps = {
|
|||
export interface AppState {
|
||||
isReorderingQueue: boolean;
|
||||
platform: Platform;
|
||||
sidebar: {
|
||||
expanded: string[];
|
||||
image: boolean;
|
||||
leftWidth: string;
|
||||
rightExpanded: boolean;
|
||||
rightWidth: string;
|
||||
};
|
||||
sidebar: SidebarProps;
|
||||
titlebar: TitlebarProps;
|
||||
}
|
||||
|
||||
|
|
@ -60,6 +55,7 @@ export const useAppStore = create<AppSlice>()(
|
|||
isReorderingQueue: false,
|
||||
platform: Platform.WINDOWS,
|
||||
sidebar: {
|
||||
collapsed: false,
|
||||
expanded: [],
|
||||
image: false,
|
||||
leftWidth: '400px',
|
||||
|
|
@ -78,7 +74,7 @@ export const useAppStore = create<AppSlice>()(
|
|||
return merge(currentState, persistedState);
|
||||
},
|
||||
name: 'store_app',
|
||||
version: 1,
|
||||
version: 2,
|
||||
},
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue