♻️(frontend) enhance useSidePanel

Encapsulate all interactions with the layout store concerning the
side panel into a hook. This hook exposes a clear interface.
Each variable has a single responsability, with a clear naming.
This commit is contained in:
lebaudantoine
2024-10-14 17:56:22 +02:00
committed by aleb_the_flash
parent 0db36c788b
commit a47f1f92c4
4 changed files with 29 additions and 28 deletions
+3 -3
View File
@@ -1,12 +1,12 @@
import { proxy } from 'valtio'
import { SidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
import { PanelId } from '@/features/rooms/livekit/hooks/useSidePanel'
type State = {
showHeader: boolean
sidePanel: SidePanel | null
activePanelId: PanelId | null
}
export const layoutStore = proxy<State>({
showHeader: false,
sidePanel: null,
activePanelId: null,
})