@@ -12,14 +12,26 @@ const {
1212} = useConnector ()
1313
1414const { user : atprotoUser } = useAtproto ()
15+ const { isConnected : isGitHubConnected, user : githubUser } = useGitHub ()
1516
1617const isOpen = shallowRef (false )
1718
1819/** Check if connected to at least one service */
19- const hasAnyConnection = computed (() => isNpmConnected .value || !! atprotoUser .value )
20+ const hasAnyConnection = computed (
21+ () => isNpmConnected .value || !! atprotoUser .value || isGitHubConnected .value ,
22+ )
2023
21- /** Check if connected to both services */
22- const hasBothConnections = computed (() => isNpmConnected .value && !! atprotoUser .value )
24+ /** Count of connected services for avatar stacking */
25+ const connectedCount = computed (() => {
26+ let count = 0
27+ if (isNpmConnected .value ) count ++
28+ if (atprotoUser .value ) count ++
29+ if (isGitHubConnected .value ) count ++
30+ return count
31+ })
32+
33+ /** Check if connected to more than one service */
34+ const hasMultipleConnections = computed (() => connectedCount .value > 1 )
2335
2436/** Only show count of active (pending/approved/running) operations */
2537const operationCount = computed (() => activeOperations .value .length )
@@ -45,12 +57,21 @@ function openConnectorModal() {
4557 }
4658}
4759
48- const authModal = useModal (' auth -modal' )
60+ const atprotoModal = useModal (' atproto -modal' )
4961
50- function openAuthModal () {
51- if (authModal ) {
62+ function openAtprotoModal () {
63+ if (atprotoModal ) {
5264 isOpen .value = false
53- authModal .open ()
65+ atprotoModal .open ()
66+ }
67+ }
68+
69+ const githubModal = useModal (' github-modal' )
70+
71+ function openGitHubModal() {
72+ if (githubModal ) {
73+ isOpen .value = false
74+ githubModal .open ()
5475 }
5576}
5677 </script >
@@ -68,7 +89,7 @@ function openAuthModal() {
6889 <span
6990 v-if =" hasAnyConnection"
7091 class =" flex items-center"
71- :class =" hasBothConnections ? '-space-x-2' : ''"
92+ :class =" hasMultipleConnections ? '-space-x-2' : ''"
7293 >
7394 <!-- npm avatar (first/back) -->
7495 <img
@@ -94,15 +115,24 @@ function openAuthModal() {
94115 width =" 24"
95116 height =" 24"
96117 class =" w-6 h-6 rounded-full ring-2 ring-bg object-cover"
97- :class =" hasBothConnections ? 'relative z-10' : ''"
118+ :class =" hasMultipleConnections ? 'relative z-10' : ''"
98119 />
99120 <span
100121 v-else-if =" atprotoUser"
101122 class =" w-6 h-6 rounded-full bg-bg-muted ring-2 ring-bg flex items-center justify-center"
102- :class =" hasBothConnections ? 'relative z-10' : ''"
123+ :class =" hasMultipleConnections ? 'relative z-10' : ''"
103124 >
104125 <span class =" i-lucide:at-sign w-3 h-3 text-fg-muted" aria-hidden =" true" />
105126 </span >
127+
128+ <!-- GitHub avatar (overlapping) -->
129+ <span
130+ v-if =" isGitHubConnected"
131+ class =" w-6 h-6 rounded-full bg-bg-muted ring-2 ring-bg flex items-center justify-center"
132+ :class =" hasMultipleConnections ? 'relative z-20' : ''"
133+ >
134+ <span class =" i-simple-icons:github w-3 h-3 text-fg-muted" aria-hidden =" true" />
135+ </span >
106136 </span >
107137
108138 <!-- "connect" text when not connected -->
@@ -189,7 +219,7 @@ function openAuthModal() {
189219 v-if =" atprotoUser"
190220 role =" menuitem"
191221 class =" w-full text-start gap-x-3 border-none"
192- @click =" openAuthModal "
222+ @click =" openAtprotoModal "
193223 >
194224 <img
195225 v-if =" atprotoUser.avatar"
@@ -212,16 +242,34 @@ function openAuthModal() {
212242 <span class =" text-xs text-fg-subtle" >{{ $t('account_menu.atmosphere') }}</span >
213243 </span >
214244 </ButtonBase >
245+
246+ <!-- GitHub connection -->
247+ <ButtonBase
248+ v-if =" isGitHubConnected && githubUser"
249+ role =" menuitem"
250+ class =" w-full text-start gap-x-3 border-none"
251+ @click =" openGitHubModal"
252+ >
253+ <span class =" w-8 h-8 rounded-full bg-bg-muted flex items-center justify-center" >
254+ <span class =" i-simple-icons:github w-4 h-4 text-fg-muted" aria-hidden =" true" />
255+ </span >
256+ <span class =" flex-1 min-w-0" >
257+ <span class =" font-mono text-sm text-fg truncate block" >{{
258+ githubUser.username
259+ }}</span >
260+ <span class =" text-xs text-fg-subtle" >{{ $t('account_menu.github') }}</span >
261+ </span >
262+ </ButtonBase >
215263 </div >
216264
217265 <!-- Divider (only if we have connections AND options to connect) -->
218266 <div
219- v-if =" hasAnyConnection && (!isNpmConnected || !atprotoUser)"
267+ v-if =" hasAnyConnection && (!isNpmConnected || !atprotoUser || !isGitHubConnected )"
220268 class =" border-t border-border"
221269 />
222270
223271 <!-- Connect options -->
224- <div v-if =" !isNpmConnected || !atprotoUser" class =" py-1" >
272+ <div v-if =" !isNpmConnected || !atprotoUser || !isGitHubConnected " class =" py-1" >
225273 <ButtonBase
226274 v-if =" !isNpmConnected"
227275 role =" menuitem"
@@ -252,7 +300,7 @@ function openAuthModal() {
252300 v-if =" !atprotoUser"
253301 role =" menuitem"
254302 class =" w-full text-start gap-x-3 border-none"
255- @click =" openAuthModal "
303+ @click =" openAtprotoModal "
256304 >
257305 <span class =" w-8 h-8 rounded-full bg-bg-muted flex items-center justify-center" >
258306 <span class =" i-lucide:at-sign w-4 h-4 text-fg-muted" aria-hidden =" true" />
@@ -264,11 +312,29 @@ function openAuthModal() {
264312 <span class =" text-xs text-fg-subtle" >{{ $t('account_menu.atmosphere_desc') }}</span >
265313 </span >
266314 </ButtonBase >
315+
316+ <ButtonBase
317+ v-if =" !isGitHubConnected"
318+ role =" menuitem"
319+ class =" w-full text-start gap-x-3 border-none"
320+ @click =" openGitHubModal"
321+ >
322+ <span class =" w-8 h-8 rounded-full bg-bg-muted flex items-center justify-center" >
323+ <span class =" i-simple-icons:github w-4 h-4 text-fg-muted" aria-hidden =" true" />
324+ </span >
325+ <span class =" flex-1 min-w-0" >
326+ <span class =" font-mono text-sm text-fg block" >
327+ {{ $t('account_menu.connect_github') }}
328+ </span >
329+ <span class =" text-xs text-fg-subtle" >{{ $t('account_menu.github_desc') }}</span >
330+ </span >
331+ </ButtonBase >
267332 </div >
268333 </div >
269334 </div >
270335 </Transition >
271336 </div >
272337 <HeaderConnectorModal />
273- <HeaderAuthModal />
338+ <HeaderAtprotoModal />
339+ <HeaderGitHubModal />
274340</template >
0 commit comments