Browse Source

Merge pull request #6649 from nocodb/nc-fix/mobile-view-fix

Fixed mobile view bug
pull/6650/head
Pranav C 1 year ago committed by GitHub
parent
commit
75cefec469
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      packages/nc-gui/store/sidebar.ts

16
packages/nc-gui/store/sidebar.ts

@ -3,10 +3,22 @@ import { MAX_WIDTH_FOR_MOBILE_MODE } from '~/lib'
export const useSidebarStore = defineStore('sidebarStore', () => {
const { width } = useWindowSize()
const isViewPortMobile = () => width.value < MAX_WIDTH_FOR_MOBILE_MODE
const isViewPortMobile = () => {
return width.value < MAX_WIDTH_FOR_MOBILE_MODE
}
const { isMobileMode } = useGlobal()
const isLeftSidebarOpen = ref(!isViewPortMobile())
const tablesStore = useTablesStore()
const _isLeftSidebarOpen = ref(!isViewPortMobile())
const isLeftSidebarOpen = computed({
get() {
return (isMobileMode && !tablesStore.activeTableId) || _isLeftSidebarOpen.value
},
set(value) {
_isLeftSidebarOpen.value = value
},
})
const isRightSidebarOpen = ref(true)
const leftSidebarWidthPercent = ref(isViewPortMobile() ? 0 : 20)

Loading…
Cancel
Save