From 1521d693cbacdabb2c68ad665c491292e7ac7c17 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Fri, 5 Aug 2022 15:55:09 +0200 Subject: [PATCH] feat(gui-v2): add toggle for tree view sidebar --- packages/nc-gui-v2/app.vue | 15 +++-------- .../components/dashboard/TreeView.vue | 2 +- .../nc-gui-v2/composables/useSidebar/index.ts | 3 +++ .../nc-gui-v2/pages/nc/[projectId]/index.vue | 26 ++++++++++++++++--- 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/packages/nc-gui-v2/app.vue b/packages/nc-gui-v2/app.vue index 0f1f6d8e31..3a11050c8d 100644 --- a/packages/nc-gui-v2/app.vue +++ b/packages/nc-gui-v2/app.vue @@ -8,7 +8,7 @@ const breakpoints = useBreakpoints(breakpointsTailwind) const { signOut, signedIn, isLoading, user } = $(useGlobal()) -const { isOpen, hasSidebar } = useSidebar({ isOpen: signedIn && breakpoints.greater('md').value }) +const { isOpen, toggle, hasSidebar } = useSidebar({ isOpen: signedIn && breakpoints.greater('md').value }) const sidebar = ref() @@ -18,21 +18,12 @@ const logout = () => { signOut() navigateTo('/signin') } - -const sidebarCollapsed = computed({ - get: () => !isOpen.value, - set: (val) => (isOpen.value = !val), -}) - -const toggleSidebar = () => { - sidebarCollapsed.value = !sidebarCollapsed.value -}