@ -1,26 +1,12 @@
< script lang = "ts" setup >
< script lang = "ts" setup >
import {
import { computed , navigateTo , onMounted , ref , storeToRefs , useGlobal , useSidebarStore , useUsers , watch } from '#imports'
computed ,
message ,
navigateTo ,
onMounted ,
ref ,
storeToRefs ,
useCopy ,
useGlobal ,
useSidebarStore ,
useUsers ,
watch ,
} from '#imports'
const { user , signOut , token , appInfo } = useGlobal ( )
const { user , signOut , appInfo } = useGlobal ( )
/ / S o w a t c h e r i n u s e r s s t o r e i s t r i g g e r e d
/ / S o w a t c h e r i n u s e r s s t o r e i s t r i g g e r e d
useUsers ( )
useUsers ( )
const { leftSidebarState } = storeToRefs ( useSidebarStore ( ) )
const { leftSidebarState } = storeToRefs ( useSidebarStore ( ) )
const { copy } = useCopy ( true )
const name = computed ( ( ) => user . value ? . display _name ? . trim ( ) )
const name = computed ( ( ) => user . value ? . display _name ? . trim ( ) )
const isMenuOpen = ref ( false )
const isMenuOpen = ref ( false )
@ -47,16 +33,6 @@ const logout = async () => {
}
}
}
}
const onCopy = async ( ) => {
try {
await copy ( token . value ! )
isAuthTokenCopied . value = true
} catch ( e : any ) {
console . error ( e )
message . error ( e . message )
}
}
watch ( isMenuOpen , ( ) => {
watch ( isMenuOpen , ( ) => {
if ( isAuthTokenCopied . value ) {
if ( isAuthTokenCopied . value ) {
isAuthTokenCopied . value = false
isAuthTokenCopied . value = false
@ -99,16 +75,6 @@ onMounted(() => {
< span class = "menu-btn" > { { $t ( 'general.logout' ) } } < / span >
< span class = "menu-btn" > { { $t ( 'general.logout' ) } } < / span >
< / div >
< / div >
< / NcMenuItem >
< / NcMenuItem >
< template v-if ="!isMobileMode" >
< NcMenuItem @click ="onCopy" >
< div v-e ="['c:auth-token:copy']" class="flex gap-2 items-center" >
< GeneralIcon v -if = " isAuthTokenCopied " icon = "check" class = "group-hover:text-black menu-icon" / >
< GeneralIcon v -else icon = "copy" class = "menu-icon" / >
< template v-if ="isAuthTokenCopied" > {{ $ t ( ' title.copiedAuthToken ' ) }} < / template >
< template v-else > {{ $ t ( ' title.copyAuthToken ' ) }} < / template >
< / div >
< / NcMenuItem >
< / template >
< NcDivider / >
< NcDivider / >
< a
< a
v - e = "['c:nocodb:discord']"
v - e = "['c:nocodb:discord']"
@ -118,7 +84,7 @@ onMounted(() => {
rel = "noopener noreferrer"
rel = "noopener noreferrer"
>
>
< NcMenuItem class = "social-icon-wrapper" >
< NcMenuItem class = "social-icon-wrapper" >
< GeneralIcon class = "social-icon" icon = "d iscord" / >
< GeneralIcon class = "social-icon" icon = "ncD iscord" / >
< span class = "menu-btn" > { { $t ( 'labels.community.joinDiscord' ) } } < / span >
< span class = "menu-btn" > { { $t ( 'labels.community.joinDiscord' ) } } < / span >
< / NcMenuItem >
< / NcMenuItem >
< / a >
< / a >
@ -130,7 +96,7 @@ onMounted(() => {
rel = "noopener noreferrer"
rel = "noopener noreferrer"
>
>
< NcMenuItem class = "social-icon-wrapper" >
< NcMenuItem class = "social-icon-wrapper" >
< GeneralIcon class = "social-icon" icon = "r eddit" / >
< GeneralIcon class = "social-icon" icon = "ncR eddit" / >
< span class = "menu-btn" > { { $t ( 'labels.community.joinReddit' ) } } < / span >
< span class = "menu-btn" > { { $t ( 'labels.community.joinReddit' ) } } < / span >
< / NcMenuItem >
< / NcMenuItem >
< / a >
< / a >
@ -142,7 +108,7 @@ onMounted(() => {
rel = "noopener noreferrer"
rel = "noopener noreferrer"
>
>
< NcMenuItem class = "social-icon-wrapper group" >
< NcMenuItem class = "social-icon-wrapper group" >
< GeneralIcon class = "text-gray-500 group-hover:text-gray-800 my-0.5 " icon = "t witter" / >
< GeneralIcon class = "social-icon text-gray-500 group-hover:text-gray-800" icon = "ncT witter" / >
< span class = "menu-btn" > { { $t ( 'labels.twitter' ) } } < / span >
< span class = "menu-btn" > { { $t ( 'labels.twitter' ) } } < / span >
< / NcMenuItem >
< / NcMenuItem >
< / a >
< / a >
@ -181,7 +147,7 @@ onMounted(() => {
rel = "noopener"
rel = "noopener"
>
>
< NcMenuItem >
< NcMenuItem >
< GeneralIcon icon = "h elp" class = "menu-icon mt-0.5" / >
< GeneralIcon icon = "ncH elp" class = "menu-icon mt-0.5" / >
< span class = "menu-btn" > { { $t ( 'title.forum' ) } } < / span >
< span class = "menu-btn" > { { $t ( 'title.forum' ) } } < / span >
< / NcMenuItem >
< / NcMenuItem >
< / a >
< / a >
@ -194,7 +160,7 @@ onMounted(() => {
rel = "noopener"
rel = "noopener"
>
>
< NcMenuItem >
< NcMenuItem >
< GeneralIcon icon = "doc " class = "menu-icon mt-0.5" / >
< GeneralIcon icon = "file " class = "menu-icon mt-0.5" / >
< span class = "menu-btn" > { { $t ( 'title.docs' ) } } < / span >
< span class = "menu-btn" > { { $t ( 'title.docs' ) } } < / span >
< / NcMenuItem >
< / NcMenuItem >
< / a >
< / a >
@ -202,7 +168,7 @@ onMounted(() => {
< NcDivider / >
< NcDivider / >
< nuxt -link v-e ="['c:user:settings']" class="!no-underline" to="/account/profile" >
< nuxt -link v-e ="['c:user:settings']" class="!no-underline" to="/account/profile" >
< NcMenuItem > < GeneralIcon icon = "s ettings" class = "menu-icon" / > { { $t ( 'title.accountSettings' ) } } < / NcMenuItem >
< NcMenuItem > < GeneralIcon icon = "ncS ettings" class = "menu-icon" / > { { $t ( 'title.accountSettings' ) } } < / NcMenuItem >
< / n u x t - l i n k >
< / n u x t - l i n k >
< / template >
< / template >
< / NcMenu >
< / NcMenu >
@ -222,9 +188,9 @@ onMounted(() => {
line - height : 1.5 ;
line - height : 1.5 ;
}
}
. menu - icon {
. menu - icon {
@ apply ! min - h - 4.5 ;
@ apply w - 4 h - 4 ;
line - height : 1 rem ;
line - height : 1 rem ;
font - size : 1.125 rem ;
font - size : 1 rem ;
}
}
: deep ( . ant - popover - inner - content ) {
: deep ( . ant - popover - inner - content ) {
@ -232,7 +198,7 @@ onMounted(() => {
}
}
. social - icon {
. social - icon {
@ apply my - 0.5 ;
@ apply my - 0.5 w - 4 h - 4 stroke - transparent ;
/ / M a k e i c o n b l a c k a n d w h i t e
/ / M a k e i c o n b l a c k a n d w h i t e
filter : grayscale ( 100 % ) ;
filter : grayscale ( 100 % ) ;