mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
feat(nav): resume entry in the bar with a shared language dialog
ResumeNavButton is the third item in .nav-brand, right after the home icon: a 44px icon target named by strings.nav.resume, aria-haspopup=dialog on its own #resume-modal-nav, gated on resumeAvailable. The picker markup is no longer duplicated. ResumeDialog owns the overlay, panel and resumeLanguages options and takes a dialogId, so the hero keeps #resume-modal and the bar gets #resume-modal-nav. useResumeDialog holds the state both triggers share: open flag, container/trigger/panel refs, click-outside (close guarded on openRef, because the listener is live while closed and otherwise steals focus on every page click), Escape, body-overflow lock and focus return. Panel focus moved from onAnimationComplete to a one-frame effect: AnimatePresence keeps open=true on the exiting copy, so the old handler refired at the end of the exit and stranded focus on <body>. resumeAvailable now gates the leaf components, so Hero renders <DownloadResume /> plainly.
This commit is contained in:
1 parent
25b0ead76a
commit
4f1d4ebe30
8 files changed
+224
-90
No files matched your search
@@ -1,6 +1,7 @@
|
||||
export const strings = {
|
||||
nav: {
|
||||
home: {en: 'Home', vi: 'Trang chủ'},
|
||||
resume: {en: 'Get resume', vi: 'Tải CV'},
|
||||
about: {en: 'About', vi: 'Giới thiệu'},
|
||||
experience: {en: 'Experience', vi: 'Kinh nghiệm'},
|
||||
projects: {en: 'Projects', vi: 'Dự án'},
|
||||
@@ -118,6 +119,10 @@ export const strings = {
|
||||
},
|
||||
common: {
|
||||
resumeDownload: {en: 'Get Resume', vi: 'Tải CV'},
|
||||
resumeModalTitle: {en: 'Get Resume', vi: 'Tải CV'},
|
||||
resumeModalAria: {en: 'Choose resume language', vi: 'Chọn ngôn ngữ CV'},
|
||||
resumeModalHint: {en: 'Choose a language — the PDF downloads to your device.', vi: 'Chọn ngôn ngữ — PDF sẽ tải về máy của bạn.'},
|
||||
resumeModalClose: {en: 'Close resume options', vi: 'Đóng tùy chọn tải CV'},
|
||||
backToTop: {en: 'Scroll to top', vi: 'Cuộn lên đầu trang'},
|
||||
contactTag: {en: 'Contact', vi: 'Liên hệ'},
|
||||
experienceTag: {en: 'Experience', vi: 'Kinh nghiệm'},
|
||||
|
||||
Reference in new issue
Block a user