Skip to content

Commit cf53a63

Browse files
committed
fix(mobile-nav): address PR feedback (dedupe Docs, i18n labels, link rel)
1 parent f7bc83d commit cf53a63

5 files changed

Lines changed: 12 additions & 14 deletions

File tree

app/components/Header/MobileBottomBar.client.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ function handleThemeClick() {
8787
/>
8888
<ButtonBase
8989
type="button"
90-
:aria-label="colorMode.value === 'dark' ? 'Switch to light theme' : 'Switch to dark theme'"
90+
:aria-label="
91+
colorMode.value === 'dark'
92+
? $t('nav.switch_to_light_theme')
93+
: $t('nav.switch_to_dark_theme')
94+
"
9195
:classicon="colorMode.value === 'dark' ? 'i-lucide:sun' : 'i-lucide:moon'"
9296
@click="handleThemeClick"
9397
/>

app/components/Header/MobileMenuDocsView.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const emit = defineEmits<{
66
close: []
77
}>()
88
9-
const docsLinks = [{ label: 'Docs home', href: NPMX_DOCS_SITE, external: true }]
9+
const docsLinks = [{ labelKey: 'nav.docs_home', href: NPMX_DOCS_SITE, external: true }]
1010
</script>
1111

1212
<template>
@@ -18,15 +18,15 @@ const docsLinks = [{ label: 'Docs home', href: NPMX_DOCS_SITE, external: true }]
1818
</span>
1919
<NuxtLink
2020
v-for="link in docsLinks"
21-
:key="link.label"
21+
:key="link.href"
2222
:href="link.href"
2323
target="_blank"
2424
rel="noopener noreferrer"
2525
class="flex items-center gap-3 px-3 py-2 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
2626
@click="emit('close')"
2727
>
2828
<span class="i-lucide:file-text w-5 h-5 text-fg-muted" aria-hidden="true" />
29-
<span class="flex-1">{{ link.label }}</span>
29+
<span class="flex-1">{{ $t(link.labelKey) }}</span>
3030
<span
3131
v-if="link.external"
3232
class="i-lucide:external-link rtl-flip w-3 h-3 ms-auto text-fg-subtle"

app/components/Header/MobileMenuRootView.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ const { user: atprotoUser } = useAtproto()
137137
:to="link.to"
138138
:href="link.href"
139139
:target="link.target"
140+
:rel="link.external ? 'noopener noreferrer' : undefined"
140141
class="flex items-center gap-3 px-3 py-2 rounded-md font-mono text-sm text-fg hover:bg-bg-subtle transition-colors duration-200"
141142
@click="emit('close')"
142143
>

app/composables/useGlobalNavLinks.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { NavigationConfig, NavigationConfigWithGroups } from '~/types'
2-
import { NPMX_DOCS_SITE } from '#shared/utils/constants'
32

43
export function useGlobalNavLinks() {
54
const discord = useDiscordLink()
@@ -97,15 +96,6 @@ export function useGlobalNavLinks() {
9796
type: 'group',
9897
label: $t('nav.links'),
9998
items: [
100-
{
101-
name: 'Docs',
102-
label: $t('footer.docs'),
103-
href: NPMX_DOCS_SITE,
104-
target: '_blank',
105-
type: 'link',
106-
external: true,
107-
iconClass: 'i-lucide:file-text',
108-
},
10999
{
110100
name: 'Source',
111101
label: $t('footer.source'),

i18n/locales/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@
198198
"back_to_main_menu": "Back to main menu",
199199
"docs_label": "Docs",
200200
"close_menu": "Close menu",
201+
"switch_to_light_theme": "Switch to light theme",
202+
"switch_to_dark_theme": "Switch to dark theme",
203+
"docs_home": "Docs home",
201204
"links": "Links",
202205
"tap_to_search": "Tap to search"
203206
},

0 commit comments

Comments
 (0)