diff --git a/app/components/AppFooter.vue b/app/components/AppFooter.vue index 2fdae41ff..6723549fd 100644 --- a/app/components/AppFooter.vue +++ b/app/components/AppFooter.vue @@ -3,173 +3,263 @@ import { NPMX_DOCS_SITE } from '#shared/utils/constants' const route = useRoute() const isHome = computed(() => route.name === 'index') +const { t } = useI18n() const discord = useDiscordLink() const { commandPaletteShortcutLabel } = usePlatformModifierKey() const modalRef = useTemplateRef('modalRef') const showModal = () => modalRef.value?.showModal?.() const closeModal = () => modalRef.value?.close?.() + +type FooterLink = + | { name: string; href: string; type?: never } + | { name: string; type: 'button'; onClick: () => void } + +const socialLinks = computed(() => [ + { + id: 'github', + label: 'GitHub', + href: 'https://repo.npmx.dev', + icon: 'i-simple-icons:github', + }, + { + id: 'discord', + label: 'Discord', + href: discord.value.url, + icon: 'i-simple-icons:discord', + }, + { + id: 'bluesky', + label: 'Bluesky', + href: 'https://social.npmx.dev', + icon: 'i-simple-icons:bluesky', + }, +]) + +const footerSections: Array<{ label: string; links: FooterLink[] }> = [ + { + label: t('footer.resources'), + links: [ + { + name: t('footer.blog'), + href: '/blog', + }, + { + name: t('footer.about'), + href: '/about', + }, + { + name: t('a11y.footer_title'), + href: '/accessibility', + }, + { + name: t('privacy_policy.title'), + href: '/privacy', + }, + ], + }, + { + label: t('footer.features'), + links: [ + { + name: t('shortcuts.compare'), + href: '/compare', + }, + { + name: t('shortcuts.settings'), + href: '/settings', + }, + { + name: t('footer.keyboard_shortcuts'), + type: 'button', + onClick: showModal, + }, + ], + }, + { + label: t('footer.other'), + links: [ + { + name: t('pds.title'), + href: '/pds', + }, + { + name: t('footer.docs'), + href: NPMX_DOCS_SITE, + }, + ], + }, +] diff --git a/i18n/locales/en.json b/i18n/locales/en.json index 63ff9394a..9c132582d 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -20,7 +20,10 @@ "chat": "chat", "builders_chat": "builders", "keyboard_shortcuts": "keyboard shortcuts", - "brand": "brand" + "brand": "brand", + "resources": "Resources", + "features": "Features", + "other": "Other" }, "shortcuts": { "section": { diff --git a/i18n/schema.json b/i18n/schema.json index 78051ebdb..f06f2f53a 100644 --- a/i18n/schema.json +++ b/i18n/schema.json @@ -66,6 +66,15 @@ }, "brand": { "type": "string" + }, + "resources": { + "type": "string" + }, + "features": { + "type": "string" + }, + "other": { + "type": "string" } }, "additionalProperties": false