Skip to content

Commit 1dbab4e

Browse files
committed
chore: update dependencies and improve header component
- Added "globals" package version 16.1.0 to package.json. - Updated pnpm-lock.yaml to include the "globals" package and its version. - Created pnpm-workspace.yaml to define ignored built dependencies. - Enhanced Header component to include a responsive mobile dropdown menu for action buttons. - Updated button titles and aria-labels in PDFButton, PrinterButton, and ShareButton components for better accessibility.
1 parent 1b50f43 commit 1dbab4e

File tree

12 files changed

+75
-46
lines changed

12 files changed

+75
-46
lines changed

edit-me/config/links.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
SiLinuxprofessionalinstitute,
33
SiGithub,
4-
// SiNpm,
54
} from '@icons-pack/react-simple-icons';
65
import { CMSLink } from 'edit-me/types/cms-link';
76
import LinkedInIcon from './LinkedInIcon';

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"class-variance-authority": "0.7.1",
1818
"clsx": "2.1.1",
1919
"contentlayer2": "0.5.8",
20+
"globals": "16.1.0",
2021
"next": "15.3.2",
2122
"next-contentlayer2": "0.5.8",
2223
"next-themes": "0.4.6",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ignoredBuiltDependencies:
2+
- '@tailwindcss/oxide'
3+
- contentlayer2
4+
- esbuild
5+
- protobufjs
6+
- sharp
7+
- unrs-resolver

src/app/layout.tsx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
// import { personal } from '@content';
21
import { Metadata, Viewport } from 'next';
32
import { ThemeProvider } from 'next-themes';
43
import { Albert_Sans, JetBrains_Mono } from 'next/font/google';
5-
// import { headers } from 'next/headers';
64
import { PropsWithChildren, ReactNode } from 'react';
75
import Footer from 'src/components/footer/footer';
86
import Header from 'src/components/header/header';
@@ -25,8 +23,7 @@ const jetBrainsMono = JetBrains_Mono({
2523
export const dynamic = 'force-static';
2624

2725
export function generateMetadata(): Metadata {
28-
// const requestHeaders = await headers();
29-
const host = `qiang.li`; //requestHeaders.get('host');
26+
const host = `qiang.li`;
3027
const baseURL = `${protocol}://${host}`;
3128
const siteName = `${fullName} Professional Résumé`;
3229
const title = `Résumé | ${fullName}`;
@@ -40,22 +37,7 @@ export function generateMetadata(): Metadata {
4037
generator: 'Next.js',
4138
keywords: ['resume', fullName, 'next.js', 'pdf'],
4239
metadataBase: new URL(baseURL),
43-
// openGraph: {
44-
// type: 'profile',
45-
// firstName: personal.givenName,
46-
// lastName: personal.familyName,
47-
// title,
48-
// description,
49-
// siteName,
50-
// url: baseURL,
51-
// },
5240
title,
53-
// twitter: {
54-
// site: siteName,
55-
// creator: fullName,
56-
// description,
57-
// title,
58-
// },
5941
};
6042
}
6143

src/app/print/pdf/route.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,11 @@ import { renderToBuffer } from '@react-pdf/renderer';
33
import { NextResponse } from 'next/server';
44
import PDF from 'src/components/pdf/pdf';
55

6-
// const privateKey = process.env.PRIVATE_KEY;
7-
86
export const dynamic = 'force-static';
97

108
// eslint-disable-next-line @typescript-eslint/no-unused-vars
119
export async function GET(request: Request): Promise<NextResponse> {
12-
// const { searchParams } = new URL(request.url);
13-
// const secret = searchParams.get('secret');
14-
15-
// let privateInformation;
16-
// if (secret !== null) {
17-
// if (secret !== privateKey) {
18-
// return new NextResponse('Not authorized', { status: 401 });
19-
// }
2010
const privateInformation = allPrivateFields;
21-
// }
2211

2312
const pdfStream = await renderToBuffer(
2413
<PDF privateInformation={privateInformation} />,

src/components/articles/contact-card.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import styles from '@styles/contact-card.module.css';
55

66
// https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css
77
// https://fontawesome.com/search
8-
98
export default function ContactCard(): ReactNode {
109
return (
1110
<>

src/components/footer/footer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { links } from '@config/links';
44
import { personal } from '@content';
55
import { ReactNode } from 'react';
66
import { Button } from 'src/components/button/button';
7-
// import { fullName } from 'src/helpers/utilities';
87
import SimpleLink from '../link/simple-link';
98

109
const scrollTop = (): void => {

src/components/header/header.tsx

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
'use client';
2+
13
import { personal } from '@content';
2-
import { ReactNode } from 'react';
4+
import { ReactNode, useState } from 'react';
35
import { Heading } from 'src/components/heading/heading';
46
import { ThemeToggle } from 'src/components/theme-toggle/theme-toggle';
57
import { fullName } from 'src/helpers/utilities';
@@ -9,8 +11,44 @@ import PDFButton from './pdf-button';
911
import ShareButton from './share-button';
1012

1113
export default function Header(): ReactNode {
14+
const [menuOpen, setMenuOpen] = useState(false);
15+
1216
return (
13-
<header className="border-neutral-6 bg-neutral-1 border-b py-12">
17+
<header className="border-neutral-6 bg-neutral-1 relative border-b py-12">
18+
{/* Hamburger and dropdown are now outside the container */}
19+
<div className="md:hidden">
20+
<button
21+
className="hover:bg-neutral-3 fixed top-4 right-4 z-50 rounded p-2 focus:outline-none"
22+
aria-label="Open menu"
23+
onClick={() => {
24+
setMenuOpen(!menuOpen);
25+
}}
26+
>
27+
{/* Hamburger Icon */}
28+
<svg width="24" height="24" fill="none">
29+
<rect y="4" width="24" height="2" rx="1" fill="currentColor" />
30+
<rect y="11" width="24" height="2" rx="1" fill="currentColor" />
31+
<rect y="18" width="24" height="2" rx="1" fill="currentColor" />
32+
</svg>
33+
</button>
34+
{/* Mobile Dropdown Menu fixed to top-right */}
35+
{menuOpen && (
36+
<div className="bg-neutral-1 border-neutral-4 fixed top-16 right-0 z-40 flex w-16 flex-col items-stretch gap-2 rounded border p-2 shadow-lg">
37+
<PrinterButton />
38+
<PDFButton />
39+
<ShareButton />
40+
<ThemeToggle
41+
buttonTextVisible={false}
42+
labelButton="Select theme"
43+
themeNameDark="dark"
44+
themeNameLight="light"
45+
color={undefined}
46+
variant={undefined}
47+
/>
48+
</div>
49+
)}
50+
</div>
51+
1452
<div className="container">
1553
<div className="flex flex-col items-center gap-6 text-center md:flex-row md:text-left">
1654
<div className="flex-1 space-y-2">
@@ -19,15 +57,20 @@ export default function Header(): ReactNode {
1957
{personal.title}
2058
</Heading>
2159
</div>
22-
<PrinterButton />
23-
<PDFButton />
24-
<ShareButton />
25-
<ThemeToggle
26-
buttonTextVisible={false}
27-
labelButton="Select theme"
28-
themeNameDark="dark"
29-
themeNameLight="light"
30-
/>
60+
{/* Desktop Buttons */}
61+
<div className="hidden items-center gap-3 md:flex">
62+
<PrinterButton />
63+
<PDFButton />
64+
<ShareButton />
65+
<ThemeToggle
66+
buttonTextVisible={false}
67+
labelButton="Select theme"
68+
themeNameDark="dark"
69+
themeNameLight="light"
70+
color={undefined}
71+
variant={undefined}
72+
/>
73+
</div>
3174
</div>
3275
</div>
3376
</header>

src/components/header/pdf-button.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export default function PDFButton(): ReactNode {
1111
href="https://drive.google.com/file/d/1-3bW17BzpzygVsLCdCBHoZUadYAj5l70/view?usp=sharing"
1212
target="_blank"
1313
rel="noopener noreferrer"
14-
aria-label="Download PDF version from Google Drive"
14+
title="One page PDF version"
15+
aria-label="One page PDF version"
1516
>
1617
<svg
1718
xmlns="http://www.w3.org/2000/svg"

0 commit comments

Comments
 (0)