Skip to content

Commit 16fc511

Browse files
committed
refactor: vairous production build optimizations
1 parent 7315ace commit 16fc511

File tree

10 files changed

+24
-37
lines changed

10 files changed

+24
-37
lines changed

__tests__/config/setup-i18n.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { beforeAll, Mock, vi } from 'vitest';
21
import { createTranslator, useTranslations } from 'next-intl';
2+
import { beforeAll, Mock, vi } from 'vitest';
33
import messages from '@/messages/en.json';
44

55
vi.mock('next-intl', async () => {

__tests__/helpers/testing-library-helpers.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { render } from '@testing-library/react';
22
import { AbstractIntlMessages, NextIntlClientProvider } from 'next-intl';
3-
import messages from '@/messages/en.json';
43
import { ReactNode } from 'react';
4+
import messages from '@/messages/en.json';
55

66
export const renderI18n = (children: ReactNode) => {
77
const locale = 'en';

next.config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import createNextIntlPlugin from 'next-intl/plugin';
44
const withNextIntl = createNextIntlPlugin();
55

66
const nextConfig: NextConfig = {
7+
output: 'standalone',
78
eslint: {
8-
dirs: ['lib', 'messages', 'src'],
9+
dirs: ['lib', 'messages', 'src', '__tests__'],
910
},
1011
};
1112

public/github-mark.svg

+1
Loading

src/app/[locale]/components/Header/Header.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
'use client';
2+
import Image from 'next/image';
23
import { useTranslations } from 'next-intl';
34
import { FC } from 'react';
4-
import GithubIcon from '../../../icons/github';
55
import LangSwitcher from './LangSwitcher';
66
import ThemeSwitch from './ThemeSwitch';
7-
import { HomeIcon } from '@/src/app/icons/home';
7+
import githubMark from '@/public/github-mark.svg';
8+
import { HomeIcon } from '@/src/app/[locale]/components/Header/icons/home';
89
import { Link } from '@/src/i18n/routing';
910

1011
interface Props {
@@ -35,8 +36,8 @@ export const Header: FC<Props> = ({ locale }) => {
3536
title={t('githubPortfolio.label')}
3637
rel='noopener noreferrer'
3738
>
38-
<div className='size-8'>
39-
<GithubIcon />
39+
<div className='relative size-8'>
40+
<Image src={githubMark} alt={t('githubPortfolio.label')} fill />
4041
</div>
4142
</a>
4243
</div>

src/app/[locale]/components/Header/ThemeSwitch.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export default function ThemeSwitch() {
1414
const { setTheme, themes, theme } = useTheme();
1515
const ref = useRef(null);
1616
useEffect(() => setMounted(true), []);
17-
useOnClickOutside(ref, () => setIsOpen(false));
17+
useOnClickOutside(ref as unknown as React.RefObject<HTMLElement>, () =>
18+
setIsOpen(false),
19+
);
1820
if (!mounted)
1921
return (
2022
<Button
File renamed without changes.

src/app/[locale]/layout.tsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,16 @@ const notoSansJP = Noto_Sans_JP({
1717
variable: '--font-noto-sans-jp',
1818
});
1919
export const metadata: Metadata = {
20-
title: 'Stephen M. resume',
21-
description: 'Stephen M. resume - NextJs (React)',
20+
title: "Hi! I'm Stephen",
21+
description: 'Stephen Mehaut portfolio',
22+
robots: {
23+
index: true,
24+
follow: true,
25+
googleBot: {
26+
index: true,
27+
follow: true,
28+
},
29+
},
2230
};
2331

2432
export default function RootLayout(props: {

src/app/[locale]/page.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ export default function DashboardPage(): ReactNode {
4444
<>
4545
<div className='flex flex-col' onWheel={onLoadMore}>
4646
<Presentation className='flex-auto' />
47-
<Link href='#skills'>
47+
<Link href='#skills' title={t('viewMoreAlt')}>
4848
<div className='relative left-1/2 mt-8 h-12 w-12 pb-4 sm:h-15 sm:w-15 dark:invert'>
4949
<Image
50-
title={t('viewMoreAlt')}
5150
src={arrowDown}
5251
alt={t('viewMoreAlt')}
5352
sizes='10w'

src/app/icons/github.tsx

-25
This file was deleted.

0 commit comments

Comments
 (0)