@@ -3,6 +3,7 @@ import { NPMX_DOCS_SITE } from '#shared/utils/constants'
33
44const route = useRoute ()
55const isHome = computed (() => route .name === ' index' )
6+ const { t } = useI18n ()
67
78const discord = useDiscordLink ()
89const { commandPaletteShortcutLabel } = usePlatformModifierKey ()
@@ -11,8 +12,8 @@ const showModal = () => modalRef.value?.showModal?.()
1112const closeModal = () => modalRef .value ?.close ?.()
1213
1314type FooterLink =
14- | { name: string ; href: string ; kbd ? : never ; type? : never }
15- | { name: string ; type: ' button' ; href ? : never ; kbd ? : never }
15+ | { name: string ; href: string ; type? : never }
16+ | { name: string ; type: ' button' ; onClick : () => void }
1617
1718const socialLinks = computed (() => [
1819 {
@@ -37,52 +38,53 @@ const socialLinks = computed(() => [
3738
3839const footerSections: Array <{ label: string ; links: FooterLink [] }> = [
3940 {
40- label: ' resources' ,
41+ label: t ( ' footer. resources' ) ,
4142 links: [
4243 {
43- name: ' footer.blog' ,
44- href: ' blog' ,
44+ name: t ( ' footer.blog' ) ,
45+ href: ' / blog' ,
4546 },
4647 {
47- name: ' footer.about' ,
48- href: ' about' ,
48+ name: t ( ' footer.about' ) ,
49+ href: ' / about' ,
4950 },
5051 {
51- name: ' a11y.footer_title' ,
52- href: ' accessibility' ,
52+ name: t ( ' a11y.footer_title' ) ,
53+ href: ' / accessibility' ,
5354 },
5455 {
55- name: ' privacy_policy.title' ,
56- href: ' privacy' ,
56+ name: t ( ' privacy_policy.title' ) ,
57+ href: ' / privacy' ,
5758 },
5859 ],
5960 },
6061 {
61- label: ' features' ,
62+ label: t ( ' footer. features' ) ,
6263 links: [
6364 {
64- name: ' shortcuts.compare' ,
65- href: ' compare' ,
65+ name: t ( ' shortcuts.compare' ) ,
66+ href: ' / compare' ,
6667 },
6768 {
68- name: ' shortcuts.settings' ,
69- href: ' settings' ,
69+ name: t ( ' shortcuts.settings' ) ,
70+ href: ' / settings' ,
7071 },
7172 {
72- name: ' footer.keyboard_shortcuts' ,
73+ name: t ( ' footer.keyboard_shortcuts' ) ,
7374 type: ' button' ,
75+ onClick: showModal ,
7476 },
7577 ],
7678 },
7779 {
78- label: ' other' ,
80+ label: t ( ' footer. other' ) ,
7981 links: [
8082 {
81- name: ' pds.title' ,
82- href: ' pds' ,
83+ name: t ( ' pds.title' ) ,
84+ href: ' / pds' ,
8385 },
8486 {
85- name: ' footer.docs' ,
87+ name: t ( ' footer.docs' ) ,
8688 href: NPMX_DOCS_SITE ,
8789 },
8890 ],
@@ -91,11 +93,11 @@ const footerSections: Array<{ label: string; links: FooterLink[] }> = [
9193 </script >
9294
9395<template >
94- <footer class =" border-t border-border md :mt-auto md :pt-8 duration-200 transition-all" >
96+ <footer class =" border-t border-border sm :mt-auto sm :pt-8 duration-200 transition-all" >
9597 <div class =" container flex flex-col gap-3" >
9698 <!-- Desktop: Show all links. Mobile: Links are in MobileMenu -->
9799 <div
98- class =" hidden md :flex flex-col lg:flex-row gap-6 lg:gap-0 lg:justify-between py-3 duration-200 transition-all"
100+ class =" hidden sm :flex flex-col lg:flex-row gap-6 lg:gap-0 lg:justify-between py-3 duration-200 transition-all"
99101 >
100102 <div class =" flex flex-col gap-6" >
101103 <div class =" flex flex-col items-start gap-3" >
@@ -129,22 +131,29 @@ const footerSections: Array<{ label: string; links: FooterLink[] }> = [
129131 <button
130132 v-if =" link.type === 'button'"
131133 type =" button"
134+ aria-haspopup =" dialog"
135+ @click =" link.onClick"
132136 class =" cursor-pointer text-start font-mono text-fg-subtle text-sm lowercase hover:text-accent transition-colors duration-200"
133- @click.prevent =" showModal"
134137 >
135- {{ $t( link.name) }}
138+ {{ link.name }}
136139 </button >
137140
138- <LinkBase v-else :to =" link?.href" variant =" footer" >
139- {{ $t(link.name) }}
141+ <LinkBase
142+ v-else
143+ :to =" link?.href"
144+ variant =" link"
145+ noUnderline
146+ class =" text-fg-subtle text-sm lowercase"
147+ >
148+ {{ link.name }}
140149 </LinkBase >
141150 </template >
142151 </div >
143152 </div >
144153 </div >
145154
146155 <small
147- class =" border-border py-7.75 md :border-t md :py-4 duration-200 transition-all text-xs text-fg-muted text-center md :text-start m-0"
156+ class =" border-border py-7.75 sm :border-t sm :py-4 duration-200 transition-all text-xs text-fg-muted text-center sm :text-start m-0"
148157 >
149158 <span class =" lg:hidden" >{{ $t('non_affiliation_disclaimer') }}</span >
150159 <span class =" hidden lg:block" >{{ $t('trademark_disclaimer') }}</span >
0 commit comments