Skip to content

Commit 24ca94d

Browse files
authored
Merge pull request #99 from 1chooo/chore/next-js-react
[Chore] migrate create-reate-app to next (#90)
2 parents 59c96f9 + 73fe34c commit 24ca94d

File tree

117 files changed

+8812
-21438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+8812
-21438
lines changed

.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

3+
.next
4+
35
# dependencies
46
/node_modules
57
/.pnp

next-env.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

next.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// next.config.js
2+
const nextConfig = {
3+
images: {
4+
domains: ['skillicons.dev', 'blog.1chooo.com'], // Use domains instead of remotePatterns
5+
dangerouslyAllowSVG: true, // Enable SVG support for remote SVG images
6+
unoptimized: true, // Disable image optimization to avoid issues with remote images
7+
},
8+
};
9+
10+
module.exports = nextConfig;

package-lock.json

+5,581-17,023
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+10-6
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,29 @@
1111
"@types/react": "^18.2.48",
1212
"@types/react-dom": "^18.2.18",
1313
"bootstrap": "^5.3.3",
14+
"caniuse-lite": "^1.0.30001651",
15+
"next": "^14.2.5",
1416
"react": "^18.2.0",
1517
"react-bootstrap": "^2.10.4",
1618
"react-dom": "^18.2.0",
1719
"react-github-calendar": "^4.1.1",
1820
"react-icons": "^5.0.1",
1921
"react-loading-skeleton": "^3.4.0",
2022
"react-markdown": "^9.0.1",
21-
"react-router-dom": "^6.26.0",
22-
"react-scripts": "5.0.1",
2323
"react-syntax-highlighter": "^15.5.0",
2424
"remark-gfm": "^4.0.0",
25+
"sharp": "^0.33.4",
26+
"tailwindcss": "^3.4.9",
2527
"typescript": "^5.5.4",
2628
"web-vitals": "^4.2.2"
2729
},
2830
"overrides": {
2931
"typescript": "^5.5.4"
3032
},
3133
"scripts": {
32-
"start": "react-scripts start",
33-
"build": "react-scripts build",
34-
"test": "react-scripts test",
35-
"eject": "react-scripts eject"
34+
"dev": "next dev --turbo",
35+
"build": "next build",
36+
"start": "next start"
3637
},
3738
"eslintConfig": {
3839
"extends": [
@@ -55,6 +56,9 @@
5556
"devDependencies": {
5657
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
5758
"@types/react-syntax-highlighter": "^15.5.13",
59+
"eslint": "^8",
60+
"eslint-config-next": "14.2.5",
61+
"postcss": "^8",
5862
"sass": "^1.77.8",
5963
"sass-loader": "^16.0.0"
6064
}

postcss.config.mjs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @type {import('postcss-load-config').Config} */
2+
const config = {
3+
plugins: {
4+
tailwindcss: {},
5+
},
6+
};
7+
8+
export default config;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

public/index.html

-95
This file was deleted.

public/robots.txt

-3
This file was deleted.

src/page/Blog/index.tsx src/app/blog/page.tsx

+20-18
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
1-
import { useLocation } from "react-router-dom";
2-
import React, { useState, useEffect } from 'react';
3-
4-
import NavBar from "../../components/NavBar";
5-
import Sidebar from "../../components/sideBar/SideBar";
6-
import FilterList from '../../components/blog/FilterList';
7-
import FilterSelectBox from '../../components/blog/FilterSelectBox';
8-
import BlogPostList from '../../components/blog/BlogPostList';
9-
import Pagination from '../../components/blog/Pagination';
10-
import Header from "../../components/Header";
1+
'use client';
112

12-
import { postsData } from '../../config/BlogData';
13-
import { IPost } from "../../interface/iPost";
3+
import React, { useState, useEffect } from 'react';
4+
import { usePathname } from 'next/navigation';
5+
import SideBar from '@/components/side-bar';
6+
import NavBar from '@/components/nav-bar';
7+
import Header from '@/components/header';
8+
import FilterList from "@/components/blog/filter-list";
9+
import FilterSelectBox from "@/components/blog/filter-select-box";
10+
import BlogPostList from "@/components/blog/blog-post-list";
11+
import Pagination from "@/components/blog/pagination";
12+
import { initializeCustomSelect, filterItemsByCategory } from '@/utils/dom-utils';
1413

14+
import { filterCategory, handleItemClick } from "@/utils/filter-utils";
15+
import { IPost } from "@/interface/iPost";
16+
import { postsData } from "@/config/blog";
1517

16-
import { filterCategory, handleItemClick } from '../../utils/filterUtils';
17-
import { initializeCustomSelect, filterItemsByCategory } from "../../utils/domUtils";
1818

19-
const Blog: React.FC = () => {
20-
const location = useLocation();
19+
const Blog = () => {
20+
const pathname = usePathname();
2121

2222
useEffect(() => {
2323
initializeCustomSelect(filterItemsByCategory);
2424
handleItemClick('All', setSelectedValue);
2525
document.title = "Blog - Hugo ChunHo Lin (1chooo) | Open Source Enthusiast";
2626
}, []);
2727

28+
29+
2830
const [selectedValue, setSelectedValue] = useState('All');
2931
const [isSelectActive, setIsSelectActive] = useState(false);
3032
const [currentPage, setCurrentPage] = useState(1);
@@ -46,11 +48,11 @@ const Blog: React.FC = () => {
4648

4749
return (
4850
<main>
49-
<Sidebar />
51+
<SideBar />
5052
<div className="main-content">
5153
<NavBar />
5254
<article
53-
className={`blog ${location.pathname === '/blog' ? 'active' : ''}`}
55+
className={`blog ${pathname === '/blog' ? 'active' : ''}`}
5456
data-page="blog"
5557
>
5658
<Header title="Hugo's Blog" />

src/page/Contact/index.tsx src/app/contact/page.tsx

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
import React, {useEffect} from "react";
2-
import { useLocation } from 'react-router-dom';
1+
'use client';
2+
3+
import React, { useEffect } from "react";
4+
import { usePathname } from 'next/navigation';
5+
import SideBar from '@/components/side-bar';
6+
import NavBar from '@/components/nav-bar';
7+
import Header from '@/components/header';
8+
import MapBox from '@/components/contact/map-box';
39
import { FaRegPaperPlane } from "react-icons/fa";
10+
import { initializeCustomSelect, filterItemsByCategory } from '@/utils/dom-utils';
411

5-
import MapBox from "../../components/contact/MapBox";
6-
import NavBar from "../../components/NavBar";
7-
import SideBar from "../../components/sideBar/SideBar";
812

9-
const Contract: React.FC = () => {
13+
const Contact = () => {
14+
const pathname = usePathname();
1015

11-
const location = useLocation();
1216
useEffect(() => {
13-
document.title = "Contract - Hugo ChunHo Lin (1chooo) | Portfolio";
17+
initializeCustomSelect(filterItemsByCategory);
18+
document.title = "Contact - Hugo ChunHo Lin (1chooo) | Open Source Enthusiast";
1419
}, []);
1520

1621
return (
@@ -19,12 +24,10 @@ const Contract: React.FC = () => {
1924
<div className="main-content">
2025
<NavBar />
2126
<article
22-
className={`resume ${location.pathname === '/contact' ? 'active' : ''}`}
27+
className={`contact ${pathname === '/contact' ? 'active' : ''}`}
2328
data-page="contact"
2429
>
25-
<header>
26-
<h2 className="h2 article-title">Contact</h2>
27-
</header>
30+
<Header title="Hugo's Contact" />
2831
<section className="contact-form">
2932
<MapBox />
3033
<h3 className="h3 form-title">Contact Form</h3>
@@ -71,4 +74,4 @@ const Contract: React.FC = () => {
7174
);
7275
}
7376

74-
export default Contract;
77+
export default Contact

src/app/favicon.ico

25.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)