Browse Source

chore(gui-v2): cleanup menu styles and colorings

pull/3211/head
braks 2 years ago
parent
commit
369c97c68f
  1. 28
      packages/nc-gui-v2/components/general/Language.vue
  2. 32
      packages/nc-gui-v2/layouts/base.vue

28
packages/nc-gui-v2/components/general/Language.vue

@ -37,22 +37,22 @@ onMounted(() => {
</script> </script>
<template> <template>
<a-dropdown class="select-none" :trigger="['click']"> <a-dropdown class="select-none color-transition" :trigger="['click']">
<MaterialSymbolsTranslate v-bind="$attrs" class="md:text-xl cursor-pointer nc-menu-translate" /> <MaterialSymbolsTranslate v-bind="$attrs" class="md:text-xl cursor-pointer nc-menu-translate" />
<template #overlay> <template #overlay>
<a-menu class="scrollbar-thin-dull min-w-50 max-h-90vh overflow-auto !py-0 dark:(!bg-gray-800 !text-white)"> <a-menu class="scrollbar-thin-dull min-w-50 max-h-90vh overflow-auto !py-0 rounded">
<a-menu-item <a-menu-item
v-for="lang of languages" v-for="lang of languages"
:key="lang" :key="lang"
:class="lang === locale ? '!bg-primary/10 text-primary dark:(!bg-gray-700 !text-secondary)' : ''" :class="lang === locale ? '!bg-primary/10 text-primary' : ''"
class="!min-h-8 group" class="group"
:value="lang" :value="lang"
@click="changeLanguage(lang)" @click="changeLanguage(lang)"
> >
<div <div
:class="lang === locale ? '!font-semibold !text-primary' : ''" :class="lang === locale ? '!font-semibold !text-primary' : ''"
class="capitalize md:(!leading-8) group-hover:(text-primary font-semibold) dark:(group-hover:text-secondary)" class="nc-project-menu-item capitalize group-hover:text-pink-500"
> >
{{ Language[lang] || lang }} {{ Language[lang] || lang }}
</div> </div>
@ -71,3 +71,21 @@ onMounted(() => {
</template> </template>
</a-dropdown> </a-dropdown>
</template> </template>
<style scoped>
:deep(.ant-dropdown-menu-item-group-list) {
@apply !mx-0;
}
:deep(.ant-dropdown-menu-item-group-title) {
@apply border-b-1;
}
:deep(.ant-dropdown-menu-item-group-list) {
@apply m-0;
}
:deep(.ant-dropdown-menu-item) {
@apply !py-0 active:(ring ring-pink-500);
}
</style>

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

@ -50,35 +50,35 @@ const logout = () => {
<GeneralShareBaseButton /> <GeneralShareBaseButton />
<a-tooltip placement="bottom"> <a-tooltip placement="bottom" :mouse-enter-delay="1">
<template #title> Switch language</template> <template #title> Switch language</template>
<div class="flex pr-4 items-center"> <div class="flex pr-4 items-center">
<GeneralLanguage class="cursor-pointer text-2xl" /> <GeneralLanguage class="cursor-pointer text-2xl hover:text-pink-500" />
</div> </div>
</a-tooltip> </a-tooltip>
<template v-if="signedIn && !isSharedBase"> <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 hover:text-pink-500" @click.prevent />
<template #overlay> <template #overlay>
<a-menu class="!py-0 nc-user-menu dark:(!bg-gray-800) leading-8 !rounded"> <a-menu class="!py-0 dark:(!bg-gray-800) leading-8 !rounded">
<a-menu-item key="0" class="!rounded-t"> <a-menu-item key="0" class="!rounded-t">
<nuxt-link v-t="['c:navbar:user:email']" class="group flex items-center no-underline py-2" to="/user"> <nuxt-link v-t="['c:navbar:user:email']" class="nc-project-menu-item group no-underline" to="/user">
<MdiAt class="mt-1 group-hover:text-success" />&nbsp; <MdiAt class="mt-1 group-hover:text-pink-500" />&nbsp;
<span class="prose group-hover:text-black nc-user-menu-email">{{ email }}</span> <span class="prose">{{ email }}</span>
</nuxt-link> </nuxt-link>
</a-menu-item> </a-menu-item>
<a-menu-divider class="!m-0" /> <a-menu-divider class="!m-0" />
<a-menu-item key="1" class="!rounded-b"> <a-menu-item key="1" class="!rounded-b">
<div v-t="['a:navbar:user:sign-out']" class="group flex items-center py-2" @click="logout"> <div v-t="['a:navbar:user:sign-out']" class="nc-project-menu-item group" @click="logout">
<MdiLogout class="dark:text-white group-hover:(!text-red-500)" />&nbsp; <MdiLogout class="group-hover:(!text-pink-500)" />&nbsp;
<span class="prose font-semibold text-gray-500 group-hover:text-black nc-user-menu-signout"> <span class="prose">
{{ $t('general.signOut') }} {{ $t('general.signOut') }}
</span> </span>
</div> </div>
@ -112,10 +112,22 @@ const logout = () => {
@apply border-b-1; @apply border-b-1;
} }
:deep(.ant-dropdown-menu-item-group-list) {
@apply !mx-0;
}
:deep(.ant-dropdown-menu-item-group-title) {
@apply border-b-1;
}
:deep(.ant-dropdown-menu-item-group-list) { :deep(.ant-dropdown-menu-item-group-list) {
@apply m-0; @apply m-0;
} }
:deep(.ant-dropdown-menu-item) {
@apply !py-0 active:(ring ring-pink-500);
}
.nc-lang-btn { .nc-lang-btn {
@apply color-transition flex items-center justify-center fixed bottom-10 right-10 z-99 w-12 h-12 rounded-full shadow-md shadow-gray-500 p-2 !bg-primary text-white active:(ring ring-pink-500) hover:(ring ring-pink-500); @apply color-transition flex items-center justify-center fixed bottom-10 right-10 z-99 w-12 h-12 rounded-full shadow-md shadow-gray-500 p-2 !bg-primary text-white active:(ring ring-pink-500) hover:(ring ring-pink-500);

Loading…
Cancel
Save