Files
cv/src/components/layout/ResumeNavButton.tsx
T
dong.nguyen e6b4d83084 refactor(i18n): split content into structure JSON and per-language dictionaries
Phase 1 of spec-v4-live-edit: data/i18n foundation, no visible feature.

- src/data/{profile,skills,experience,projects}.json: language-neutral
  structure documents with thin typed loaders; all prose moved to
  src/i18n/locales/{vi,en}/content.json; chrome strings to ui.json
- src/i18n/: dict-types, cross-document validator (runs at module load and
  via pnpm validate:content), loader joining structure+text once (UI/CONTENT),
  I18nProvider/useI18n mounted in App under LanguageProvider
- all 22 consumers read joined records via useI18n(); field.ts and
  strings.ts deleted; *En field pairs removed from the domain types
- hero tagline renders as plain-text segments (D9); philosophy quotes as
  paragraph arrays; footer display name now localizes per language (D6)
- resume generator consumes UI/CONTENT; generated resume HTML verified
  byte-identical (EN+VI) before/after the migration
- AGENTS.md and v3/v3-i18n + v4 specs updated; deploy.yml concurrency group
2026-10-22 07:29:06 +07:00

37 lines
1.3 KiB
TypeScript

import { resumeAvailable } from '@/data/resume'
import { useI18n } from '@/i18n/provider'
import { useResumeDialog } from '@/hooks/useResumeDialog'
import { ResumeDialog } from '@/components/ui/ResumeDialog'
import { ResumeIcon } from '@/components/ui/icons'
/**
* Bar entry for the resume: an icon-only `.nav-control` in the brand group, right after the home
* icon, opening the same language dialog the hero CTA opens. The icon is decorative — the
* accessible name is the translated action in `aria-label`, the hint is the `title`.
*/
export function ResumeNavButton() {
const { ui: s } = useI18n()
const { open, openDialog, close, containerRef, triggerRef, panelRef } = useResumeDialog()
if (!resumeAvailable) return null
return (
<div ref={containerRef} className="nav-resume">
<button
ref={triggerRef}
type="button"
className={`nav-control nav-resume-trigger ${open ? 'open' : ''}`}
aria-haspopup="dialog"
aria-expanded={open}
aria-controls="resume-modal-nav"
aria-label={s.nav.resume}
title={s.common.resumeModalHint}
onClick={openDialog}
>
<ResumeIcon size={24} />
</button>
<ResumeDialog open={open} close={close} panelRef={panelRef} dialogId="resume-modal-nav" />
</div>
)
}