feat(navigation): add services section to header and translations

- Add 'nav.services' translations in both English and Chinese
- Include services link in desktop and mobile navigation
- Add id to services section for navigation
- Use personalInfo.name instead of translation for header name
This commit is contained in:
joyzhao
2025-06-16 18:37:28 +08:00
parent 1ace97c5e1
commit 89cfeff439
4 changed files with 8 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import ThemeToggle from "./ui/theme-toggle";
import { personalInfo } from "@/lib/data";
import LanguageSwitcher from "./LanguageSwitcher";
import { useTranslations, getLocalizedPath, type Lang } from "@/i18n/utils";
import { useState, useEffect } from "react";
@@ -35,13 +36,14 @@ export default function GlassHeader({ lang }: GlassHeaderProps) {
className="flex items-center text-lg font-medium transition-opacity duration-150 hover:opacity-80"
href={getLocalizedPath('/', lang)}
>
{t('personal.name')}
{personalInfo.name}
</a>
{/* Desktop Navigation */}
<nav className="hidden md:flex items-center space-x-6 text-sm font-medium">
{[
{ key: 'nav.about', icon: '👨‍💻 ', sectionId: 'about' },
{ key: 'nav.services', icon: '🛠️ ', sectionId: 'services' },
{ key: 'nav.projects', icon: '🚀 ', sectionId: 'projects' },
].map((item) => (
<a
@@ -83,6 +85,7 @@ export default function GlassHeader({ lang }: GlassHeaderProps) {
<nav className="flex flex-col space-y-3 text-sm font-medium">
{[
{ key: 'nav.about', icon: '👨‍💻 ', sectionId: 'about' },
{ key: 'nav.services', icon: '🛠️ ', sectionId: 'services' },
{ key: 'nav.projects', icon: '🚀 ', sectionId: 'projects' },
].map((item) => (
<a