Browse Source

mobile optimisations - work on merging right and left sidebar (WIP)

pull/4898/head
Daniel Spaude 2 years ago
parent
commit
86162186bb
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 15
      packages/nc-gui/components/smartsheet/sidebar/mobile.vue
  2. 15
      packages/nc-gui/pages/[projectType]/[projectId]/index.vue

15
packages/nc-gui/components/smartsheet/sidebar/mobile.vue

@ -44,9 +44,12 @@ const route = useRoute()
const { $e } = useNuxtApp()
/** Sidebar visible */
const { isOpen } = useSidebar('nc-right-sidebar')
// const { isOpen } = useSidebar('nc-right-sidebar')
// const FOO = useSidebar('nc-right-sidebar')
// FOO.
const sidebarCollapsed = computed(() => !isOpen.value || isMobileMode.value)
// const sidebarCollapsed = computed(() => !isOpen.value || isMobileMode.value)
const sidebarCollapsed = false
/** Sidebar ref */
const sidebar = ref()
@ -138,9 +141,9 @@ function onOpenModal({
</script>
<template>
<div>
Mobile Views Menu <br />
views: {{ views.length }}
<!-- <div> -->
<!-- Mobile Views Menu <br />
views: {{ views.length }} -->
<a-layout-sider
ref="sidebar"
:collapsed="sidebarCollapsed"
@ -170,7 +173,7 @@ function onOpenModal({
</template>
</div>
</a-layout-sider>
</div>
<!-- </div> -->
</template>
<style scoped>

15
packages/nc-gui/pages/[projectType]/[projectId]/index.vue

@ -1,5 +1,6 @@
<script setup lang="ts">
import tinycolor from 'tinycolor2'
import type { TableType } from 'nocodb-sdk'
import {
TabType,
computed,
@ -29,7 +30,6 @@ import {
useTheme,
useUIPermission,
} from '#imports'
import { TableType } from 'nocodb-sdk'
definePageMeta({
hideHeader: true,
@ -66,9 +66,6 @@ const dataSourcesState = ref<string>('')
const dropdownOpen = ref(false)
const { activeTab } = useTabs()
const { metas } = useMetas()
// const { tables } = useProject()
@ -76,8 +73,7 @@ const { metas } = useMetas()
const meta = computed<TableType | undefined>(() => activeTab.value && metas.value[activeTab.value.id!])
provide(MetaInj, meta)
const showViewsMobileSidebar = ref(false)
/** Sidebar ref */
const sidebar = ref()
@ -602,8 +598,11 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
<!-- v-show="isMobileRightSidebarOpen" -->
<!-- meta: {{ JSON.stringify(meta) }} <br />
isMobileMode: {{ JSON.stringify(isMobileMode) }} <br /> -->
<SmartsheetSidebarMobile v-if="meta && isMobileMode" class="nc-left-sidebar-mobile" />
<LazyDashboardTreeView @create-base-dlg="toggleDialog(true, 'dataSources')" />
<LazyDashboardTreeView
v-if="!(isMobileMode && showViewsMobileSidebar)"
@create-base-dlg="toggleDialog(true, 'dataSources')"
/>
<SmartsheetSidebarMobile v-if="meta && isMobileMode && showViewsMobileSidebar" class="nc-left-sidebar-mobile" />
</a-layout-sider>
</template>

Loading…
Cancel
Save