Browse Source

chore(gui-v2): add transitions

pull/3109/head
braks 2 years ago
parent
commit
8e8ba31000
  1. 116
      packages/nc-gui-v2/layouts/base.vue

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

@ -19,70 +19,74 @@ const logout = () => {
<div id="nc-sidebar-left" /> <div id="nc-sidebar-left" />
<a-layout class="!flex-col"> <a-layout class="!flex-col">
<a-layout-header v-if="signedIn" class="flex !bg-primary items-center text-white pl-4 pr-5 shadow-lg"> <Transition name="layout">
<div <a-layout-header v-if="signedIn" class="flex !bg-primary items-center text-white pl-4 pr-5 shadow-lg">
v-if="route.name === 'index' || route.name === 'project-index-create' || route.name === 'project-index-create-external'" <div
class="transition-all duration-200 p-2 cursor-pointer transform hover:scale-105" v-if="route.name === 'index' || route.name === 'project-index-create' || route.name === 'project-index-create-external'"
@click="navigateTo('/')" class="transition-all duration-200 p-2 cursor-pointer transform hover:scale-105"
> @click="navigateTo('/')"
<img width="35" alt="NocoDB" src="~/assets/img/icons/512x512-trans.png" /> >
</div> <img width="35" alt="NocoDB" src="~/assets/img/icons/512x512-trans.png" />
<div class="flex justify-center">
<div v-show="isLoading" class="flex items-center gap-2 ml-3">
{{ $t('general.loading') }}
<MdiReload :class="{ 'animate-infinite animate-spin': isLoading }" />
</div> </div>
</div>
<div class="flex-1" /> <div class="flex justify-center">
<div v-show="isLoading" class="flex items-center gap-2 ml-3">
{{ $t('general.loading') }}
<a-tooltip placement="left"> <MdiReload :class="{ 'animate-infinite animate-spin': isLoading }" />
<template #title> Switch language </template> </div>
<div class="flex pr-4 items-center">
<GeneralLanguage class="cursor-pointer text-2xl" />
</div> </div>
</a-tooltip>
<div class="flex-1" />
<template v-if="signedIn">
<a-dropdown :trigger="['click']"> <a-tooltip placement="left">
<MdiDotsVertical class="md:text-xl cursor-pointer nc-user-menu" @click.prevent /> <template #title> Switch language </template>
<template #overlay> <div class="flex pr-4 items-center">
<a-menu class="!py-0 nc-user-menu dark:(!bg-gray-800) leading-8 !rounded"> <GeneralLanguage class="cursor-pointer text-2xl" />
<a-menu-item key="0" class="!rounded-t"> </div>
<nuxt-link v-t="['c:navbar:user:email']" class="group flex items-center no-underline py-2" to="/user"> </a-tooltip>
<MdiAt class="mt-1 group-hover:text-success" />&nbsp;
<template v-if="signedIn">
<span class="prose group-hover:text-black nc-user-menu-email">{{ email }}</span> <a-dropdown :trigger="['click']">
</nuxt-link> <MdiDotsVertical class="md:text-xl cursor-pointer nc-user-menu" @click.prevent />
</a-menu-item>
<template #overlay>
<a-menu-divider class="!m-0" /> <a-menu class="!py-0 nc-user-menu dark:(!bg-gray-800) leading-8 !rounded">
<a-menu-item key="0" class="!rounded-t">
<a-menu-item key="1" class="!rounded-b"> <nuxt-link v-t="['c:navbar:user:email']" class="group flex items-center no-underline py-2" to="/user">
<div v-t="['a:navbar:user:sign-out']" class="group flex items-center py-2" @click="logout"> <MdiAt class="mt-1 group-hover:text-success" />&nbsp;
<MdiLogout class="dark:text-white group-hover:(!text-red-500)" />&nbsp;
<span class="prose group-hover:text-black nc-user-menu-email">{{ email }}</span>
<span class="prose font-semibold text-gray-500 group-hover:text-black nc-user-menu-signout"> </nuxt-link>
{{ $t('general.signOut') }} </a-menu-item>
</span>
</div> <a-menu-divider class="!m-0" />
</a-menu-item>
</a-menu> <a-menu-item key="1" class="!rounded-b">
</template> <div v-t="['a:navbar:user:sign-out']" class="group flex items-center py-2" @click="logout">
</a-dropdown> <MdiLogout class="dark:text-white group-hover:(!text-red-500)" />&nbsp;
</template>
</a-layout-header> <span class="prose font-semibold text-gray-500 group-hover:text-black nc-user-menu-signout">
{{ $t('general.signOut') }}
</span>
</div>
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</template>
</a-layout-header>
</Transition>
<a-tooltip> <a-tooltip>
<template #title> Switch language </template> <template #title> Switch language </template>
<div v-if="!signedIn" class="nc-lang-btn"> <Transition name="layout">
<GeneralLanguage /> <div v-if="!signedIn" class="nc-lang-btn">
</div> <GeneralLanguage />
</div>
</Transition>
</a-tooltip> </a-tooltip>
<div class="w-full h-full overflow-hidden"> <div class="w-full h-full overflow-hidden">

Loading…
Cancel
Save