@@ -3,6 +3,9 @@ import { useFocusTrap } from '@vueuse/integrations/useFocusTrap'
33import { useAtproto } from ' ~/composables/atproto/useAtproto'
44
55const isOpen = defineModel <boolean >(' open' , { default: false })
6+ const { links } = defineProps <{
7+ links: NavigationConfigWithGroups
8+ }>()
69
710const { isConnected, npmUser, avatar : npmAvatar } = useConnector ()
811const { user : atprotoUser } = useAtproto ()
@@ -175,137 +178,41 @@ onUnmounted(deactivate)
175178
176179 <!-- Navigation links -->
177180 <div class =" flex-1 overflow-y-auto overscroll-contain py-2" >
178- <!-- App navigation -->
179- <div class =" px-2 py-2" >
180- <NuxtLink
181- :to =" { name: 'compare' }"
182- class =" flex items-center gap-3 px-3 py-3 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
183- @click =" closeMenu"
184- >
185- <span class =" i-carbon:compare w-5 h-5 text-fg-muted" aria-hidden =" true" />
186- {{ $t('nav.compare') }}
187- </NuxtLink >
188-
189- <NuxtLink
190- :to =" { name: 'settings' }"
191- class =" flex items-center gap-3 px-3 py-3 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
192- @click =" closeMenu"
193- >
194- <span class =" i-carbon:settings w-5 h-5 text-fg-muted" aria-hidden =" true" />
195- {{ $t('nav.settings') }}
196- </NuxtLink >
197-
198- <!-- Connected user links -->
199- <template v-if =" isConnected && npmUser " >
200- <NuxtLink
201- :to =" { name: '~username', params: { username: npmUser } }"
202- class =" flex items-center gap-3 px-3 py-3 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
203- @click =" closeMenu"
204- >
205- <span class =" i-carbon:package w-5 h-5 text-fg-muted" aria-hidden =" true" />
206- {{ $t('header.packages') }}
207- </NuxtLink >
208-
209- <NuxtLink
210- :to =" { name: '~username-orgs', params: { username: npmUser } }"
211- class =" flex items-center gap-3 px-3 py-3 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
212- @click =" closeMenu"
213- >
214- <span class =" i-carbon:enterprise w-5 h-5 text-fg-muted" aria-hidden =" true" />
215- {{ $t('header.orgs') }}
216- </NuxtLink >
217- </template >
218- </div >
219-
220- <!-- Divider -->
221- <div class =" mx-4 my-2 border-t border-border" />
222-
223- <!-- Informational links -->
224- <div class =" px-2 py-2" >
225- <NuxtLink
226- :to =" { name: 'about' }"
227- class =" flex items-center gap-3 px-3 py-3 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
228- @click =" closeMenu"
229- >
230- <span class =" i-carbon:information w-5 h-5 text-fg-muted" aria-hidden =" true" />
231- {{ $t('footer.about') }}
232- </NuxtLink >
233-
234- <NuxtLink
235- :to =" { name: 'privacy' }"
236- class =" flex items-center gap-3 px-3 py-3 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
237- @click =" closeMenu"
238- >
239- <span class =" i-carbon:security w-5 h-5 text-fg-muted" aria-hidden =" true" />
240- {{ $t('privacy_policy.title') }}
241- </NuxtLink >
242- </div >
243-
244- <!-- Divider -->
245- <div class =" mx-4 my-2 border-t border-border" />
181+ <template v-for =" group in links " >
182+ <div v-if =" group.type === 'separator'" class =" mx-4 my-2 border-t border-border" />
246183
247- <!-- External links -->
248- <div class =" px-2 py-2" >
249- <span class =" px-3 py-2 font-mono text-xs text-fg-subtle uppercase tracking-wider" >
250- {{ $t('nav.links') }}
251- </span >
252-
253- <a
254- href =" https://docs.npmx.dev"
255- target =" _blank"
256- rel =" noopener noreferrer"
257- class =" flex items-center gap-3 px-3 py-3 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
258- >
259- <span class =" i-carbon:document w-5 h-5 text-fg-muted" aria-hidden =" true" />
260- {{ $t('footer.docs') }}
184+ <div v-if =" group.type === 'group'" :key =" group.name" class =" p-2" >
261185 <span
262- class =" i-carbon:launch rtl-flip w-3 h-3 ms-auto text-fg-subtle"
263- aria-hidden =" true"
264- />
265- </a >
266-
267- <a
268- href =" https://repo.npmx.dev"
269- target =" _blank"
270- rel =" noopener noreferrer"
271- class =" flex items-center gap-3 px-3 py-3 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
272- >
273- <span class =" i-carbon:logo-github w-5 h-5 text-fg-muted" aria-hidden =" true" />
274- {{ $t('footer.source') }}
275- <span
276- class =" i-carbon:launch rtl-flip w-3 h-3 ms-auto text-fg-subtle"
277- aria-hidden =" true"
278- />
279- </a >
280-
281- <a
282- href =" https://social.npmx.dev"
283- target =" _blank"
284- rel =" noopener noreferrer"
285- class =" flex items-center gap-3 px-3 py-3 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
286- >
287- <span class =" i-simple-icons:bluesky w-5 h-5 text-fg-muted" aria-hidden =" true" />
288- {{ $t('footer.social') }}
289- <span
290- class =" i-carbon:launch rtl-flip w-3 h-3 ms-auto text-fg-subtle"
291- aria-hidden =" true"
292- />
293- </a >
294-
295- <a
296- href =" https://chat.npmx.dev"
297- target =" _blank"
298- rel =" noopener noreferrer"
299- class =" flex items-center gap-3 px-3 py-3 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
300- >
301- <span class =" i-carbon:chat w-5 h-5 text-fg-muted" aria-hidden =" true" />
302- {{ $t('footer.chat') }}
303- <span
304- class =" i-carbon:launch rtl-flip w-3 h-3 ms-auto text-fg-subtle"
305- aria-hidden =" true"
306- />
307- </a >
308- </div >
186+ v-if =" group.label"
187+ class =" px-3 py-2 font-mono text-xs text-fg-subtle uppercase tracking-wider"
188+ >
189+ {{ group.label }}
190+ </span >
191+ <div >
192+ <NuxtLink
193+ v-for =" link in group.items"
194+ :key =" link.name"
195+ :to =" link.to"
196+ :href =" link.href"
197+ :target =" link.target"
198+ class =" flex items-center gap-3 px-3 py-3 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
199+ @click =" link?.to && closeMenu"
200+ >
201+ <span
202+ :class =" link.iconClass"
203+ class =" w-5 h-5 text-fg-muted"
204+ aria-hidden =" true"
205+ />
206+ {{ link.label }}
207+ <span
208+ v-if =" link.external"
209+ class =" i-carbon:launch rtl-flip w-3 h-3 ms-auto text-fg-subtle"
210+ aria-hidden =" true"
211+ />
212+ </NuxtLink >
213+ </div >
214+ </div >
215+ </template >
309216 </div >
310217 </nav >
311218 </Transition >
0 commit comments