Browse Source

feat(gui-v2): hide menu in shared base and add footer overlay

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3123/head
Pranav C 2 years ago
parent
commit
ae2434c736
  1. 4
      packages/nc-gui-v2/layouts/base.vue
  2. 13
      packages/nc-gui-v2/layouts/default.vue
  3. 14
      packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue

4
packages/nc-gui-v2/layouts/base.vue

@ -4,6 +4,8 @@ import { computed, useGlobal, useRoute } from '#imports'
const { signOut, signedIn, isLoading, user } = useGlobal() const { signOut, signedIn, isLoading, user } = useGlobal()
const { isSharedBase } = useProject()
const route = useRoute() const route = useRoute()
const email = computed(() => user.value?.email ?? '---') const email = computed(() => user.value?.email ?? '---')
@ -49,7 +51,7 @@ const logout = () => {
</div> </div>
</a-tooltip> </a-tooltip>
<template v-if="signedIn"> <template v-if="signedIn && !isSharedBase">
<a-dropdown :trigger="['click']"> <a-dropdown :trigger="['click']">
<MdiDotsVertical class="md:text-xl cursor-pointer nc-user-menu" @click.prevent /> <MdiDotsVertical class="md:text-xl cursor-pointer nc-user-menu" @click.prevent />

13
packages/nc-gui-v2/layouts/default.vue

@ -1,11 +1,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { useHead, useRoute } from '#imports' import { useHead, useRoute } from '#imports'
import { useProject } from '~/composables'
const route = useRoute() const route = useRoute()
const { te, t } = useI18n() const { te, t } = useI18n()
const { isSharedBase } = useProject()
useHead({ useHead({
title: route.meta?.title && te(route.meta.title as string) ? `${t(route.meta.title as string)} | NocoDB` : 'NocoDB', title: route.meta?.title && te(route.meta.title as string) ? `${t(route.meta.title as string)} | NocoDB` : 'NocoDB',
}) })
@ -18,7 +21,7 @@ export default {
</script> </script>
<template> <template>
<div class="w-full h-full"> <div class="w-full h-full" :class="{ 'mb-10': isSharedBase }">
<teleport v-if="$slots.sidebar" to="#nc-sidebar-left"> <teleport v-if="$slots.sidebar" to="#nc-sidebar-left">
<slot name="sidebar" /> <slot name="sidebar" />
</teleport> </teleport>
@ -26,5 +29,13 @@ export default {
<a-layout-content> <a-layout-content>
<slot /> <slot />
</a-layout-content> </a-layout-content>
<div v-if="isSharedBase" class="bg-white w-[100vw] h-[20px] fixed bottom-0 left-0 z-99 flex px-2 align-center border-t-1">
<div class="flex-1" />
<img src="~/public/favicon-32.png" class="h-[15px] mr-1" />
<a href="https://github.com/nocodb/nocodb" target="_blank" class="text-xs text-primary/100">
Powered by
<span class="font-bold"> NocoDB </span>
</a>
</div>
</div> </div>
</template> </template>

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

@ -5,7 +5,7 @@ import { openLink } from '~/utils'
const route = useRoute() const route = useRoute()
const { project, loadProject, loadTables } = useProject() const { project, loadProject, loadTables, isSharedBase } = useProject()
const { addTab, clearTabs } = useTabs() const { addTab, clearTabs } = useTabs()
@ -65,7 +65,16 @@ await loadTables()
<img alt="NocoDB" src="~/assets/img/icons/512x512-trans.png" /> <img alt="NocoDB" src="~/assets/img/icons/512x512-trans.png" />
</div> </div>
<a-dropdown :trigger="['click']" placement="bottom"> <div v-if="isSharedBase">
<template v-if="isOpen">
<div class="text-xl font-semibold truncate">{{ project.title }}</div>
</template>
<template v-else>
<MdiFolder class="text-primary cursor-pointer transform hover:scale-105 text-2xl" />
</template>
</div>
<a-dropdown v-else :trigger="['click']" placement="bottom">
<div <div
:style="{ width: isOpen ? 'calc(100% - 40px) pr-2' : '100%' }" :style="{ width: isOpen ? 'calc(100% - 40px) pr-2' : '100%' }"
:class="[isOpen ? '' : 'justify-center']" :class="[isOpen ? '' : 'justify-center']"
@ -220,7 +229,6 @@ await loadTables()
</template> </template>
<dashboard-settings-modal v-model="dialogOpen" :open-key="openDialogKey" /> <dashboard-settings-modal v-model="dialogOpen" :open-key="openDialogKey" />
<NuxtPage /> <NuxtPage />
<GeneralPreviewAs float /> <GeneralPreviewAs float />

Loading…
Cancel
Save