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 { isSharedBase } = useProject()
const route = useRoute()
const email = computed(() => user.value?.email ?? '---')
@ -49,7 +51,7 @@ const logout = () => {
</div>
</a-tooltip>
<template v-if="signedIn">
<template v-if="signedIn && !isSharedBase">
<a-dropdown :trigger="['click']">
<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>
import { useI18n } from 'vue-i18n'
import { useHead, useRoute } from '#imports'
import { useProject } from '~/composables'
const route = useRoute()
const { te, t } = useI18n()
const { isSharedBase } = useProject()
useHead({
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>
<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">
<slot name="sidebar" />
</teleport>
@ -26,5 +29,13 @@ export default {
<a-layout-content>
<slot />
</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>
</template>

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

@ -5,7 +5,7 @@ import { openLink } from '~/utils'
const route = useRoute()
const { project, loadProject, loadTables } = useProject()
const { project, loadProject, loadTables, isSharedBase } = useProject()
const { addTab, clearTabs } = useTabs()
@ -65,7 +65,16 @@ await loadTables()
<img alt="NocoDB" src="~/assets/img/icons/512x512-trans.png" />
</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
:style="{ width: isOpen ? 'calc(100% - 40px) pr-2' : '100%' }"
:class="[isOpen ? '' : 'justify-center']"
@ -220,7 +229,6 @@ await loadTables()
</template>
<dashboard-settings-modal v-model="dialogOpen" :open-key="openDialogKey" />
<NuxtPage />
<GeneralPreviewAs float />

Loading…
Cancel
Save