diff --git a/app/components/Header/AccountMenu.client.vue b/app/components/Header/AccountMenu.client.vue index 00fa7a194..db28c29a2 100644 --- a/app/components/Header/AccountMenu.client.vue +++ b/app/components/Header/AccountMenu.client.vue @@ -12,14 +12,26 @@ const { } = useConnector() const { user: atprotoUser } = useAtproto() +const { isConnected: isGitHubConnected, user: githubUser } = useGitHub() const isOpen = shallowRef(false) /** Check if connected to at least one service */ -const hasAnyConnection = computed(() => isNpmConnected.value || !!atprotoUser.value) +const hasAnyConnection = computed( + () => isNpmConnected.value || !!atprotoUser.value || isGitHubConnected.value, +) -/** Check if connected to both services */ -const hasBothConnections = computed(() => isNpmConnected.value && !!atprotoUser.value) +/** Count of connected services for avatar stacking */ +const connectedCount = computed(() => { + let count = 0 + if (isNpmConnected.value) count++ + if (atprotoUser.value) count++ + if (isGitHubConnected.value) count++ + return count +}) + +/** Check if connected to more than one service */ +const hasMultipleConnections = computed(() => connectedCount.value > 1) /** Only show count of active (pending/approved/running) operations */ const operationCount = computed(() => activeOperations.value.length) @@ -45,12 +57,21 @@ function openConnectorModal() { } } -const authModal = useModal('auth-modal') +const atprotoModal = useModal('atproto-modal') -function openAuthModal() { - if (authModal) { +function openAtprotoModal() { + if (atprotoModal) { isOpen.value = false - authModal.open() + atprotoModal.open() + } +} + +const githubModal = useModal('github-modal') + +function openGitHubModal() { + if (githubModal) { + isOpen.value = false + githubModal.open() } } @@ -68,7 +89,7 @@ function openAuthModal() { + + + + @@ -189,7 +219,7 @@ function openAuthModal() { v-if="atprotoUser" role="menuitem" class="w-full text-start gap-x-3 border-none" - @click="openAuthModal" + @click="openAtprotoModal" > {{ $t('account_menu.atmosphere') }} + + + + + + + {{ + githubUser.username + }} + {{ $t('account_menu.github') }} + +
-
+
+ + + + + + + {{ $t('account_menu.connect_github') }} + + {{ $t('account_menu.github_desc') }} + +
- + + diff --git a/app/components/Header/AuthModal.client.vue b/app/components/Header/AtprotoModal.client.vue similarity index 99% rename from app/components/Header/AuthModal.client.vue rename to app/components/Header/AtprotoModal.client.vue index f0f2ea263..efa035d7a 100644 --- a/app/components/Header/AuthModal.client.vue +++ b/app/components/Header/AtprotoModal.client.vue @@ -54,7 +54,7 @@ watch(handleInput, newHandleInput => {