Skip to content

Commit

Permalink
Merge pull request #99 from 1chooo/chore/next-js-react
Browse files Browse the repository at this point in the history
[Chore] migrate create-reate-app to next (#90)
  • Loading branch information
1chooo authored Aug 17, 2024
2 parents 59c96f9 + 73fe34c commit 24ca94d
Show file tree
Hide file tree
Showing 117 changed files with 8,812 additions and 21,438 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.next

# dependencies
/node_modules
/.pnp
Expand Down
5 changes: 5 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
10 changes: 10 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// next.config.js
const nextConfig = {
images: {
domains: ['skillicons.dev', 'blog.1chooo.com'], // Use domains instead of remotePatterns
dangerouslyAllowSVG: true, // Enable SVG support for remote SVG images
unoptimized: true, // Disable image optimization to avoid issues with remote images
},
};

module.exports = nextConfig;
22,604 changes: 5,581 additions & 17,023 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,29 @@
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.18",
"bootstrap": "^5.3.3",
"caniuse-lite": "^1.0.30001651",
"next": "^14.2.5",
"react": "^18.2.0",
"react-bootstrap": "^2.10.4",
"react-dom": "^18.2.0",
"react-github-calendar": "^4.1.1",
"react-icons": "^5.0.1",
"react-loading-skeleton": "^3.4.0",
"react-markdown": "^9.0.1",
"react-router-dom": "^6.26.0",
"react-scripts": "5.0.1",
"react-syntax-highlighter": "^15.5.0",
"remark-gfm": "^4.0.0",
"sharp": "^0.33.4",
"tailwindcss": "^3.4.9",
"typescript": "^5.5.4",
"web-vitals": "^4.2.2"
},
"overrides": {
"typescript": "^5.5.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"dev": "next dev --turbo",
"build": "next build",
"start": "next start"
},
"eslintConfig": {
"extends": [
Expand All @@ -55,6 +56,9 @@
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@types/react-syntax-highlighter": "^15.5.13",
"eslint": "^8",
"eslint-config-next": "14.2.5",
"postcss": "^8",
"sass": "^1.77.8",
"sass-loader": "^16.0.0"
}
Expand Down
8 changes: 8 additions & 0 deletions postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};

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
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
95 changes: 0 additions & 95 deletions public/index.html

This file was deleted.

3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

38 changes: 20 additions & 18 deletions src/page/Blog/index.tsx → src/app/blog/page.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
import { useLocation } from "react-router-dom";
import React, { useState, useEffect } from 'react';

import NavBar from "../../components/NavBar";
import Sidebar from "../../components/sideBar/SideBar";
import FilterList from '../../components/blog/FilterList';
import FilterSelectBox from '../../components/blog/FilterSelectBox';
import BlogPostList from '../../components/blog/BlogPostList';
import Pagination from '../../components/blog/Pagination';
import Header from "../../components/Header";
'use client';

import { postsData } from '../../config/BlogData';
import { IPost } from "../../interface/iPost";
import React, { useState, useEffect } from 'react';
import { usePathname } from 'next/navigation';
import SideBar from '@/components/side-bar';
import NavBar from '@/components/nav-bar';
import Header from '@/components/header';
import FilterList from "@/components/blog/filter-list";
import FilterSelectBox from "@/components/blog/filter-select-box";
import BlogPostList from "@/components/blog/blog-post-list";
import Pagination from "@/components/blog/pagination";
import { initializeCustomSelect, filterItemsByCategory } from '@/utils/dom-utils';

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

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

const Blog: React.FC = () => {
const location = useLocation();
const Blog = () => {
const pathname = usePathname();

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



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

return (
<main>
<Sidebar />
<SideBar />
<div className="main-content">
<NavBar />
<article
className={`blog ${location.pathname === '/blog' ? 'active' : ''}`}
className={`blog ${pathname === '/blog' ? 'active' : ''}`}
data-page="blog"
>
<Header title="Hugo's Blog" />
Expand Down
29 changes: 16 additions & 13 deletions src/page/Contact/index.tsx → src/app/contact/page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import React, {useEffect} from "react";
import { useLocation } from 'react-router-dom';
'use client';

import React, { useEffect } from "react";
import { usePathname } from 'next/navigation';
import SideBar from '@/components/side-bar';
import NavBar from '@/components/nav-bar';
import Header from '@/components/header';
import MapBox from '@/components/contact/map-box';
import { FaRegPaperPlane } from "react-icons/fa";
import { initializeCustomSelect, filterItemsByCategory } from '@/utils/dom-utils';

import MapBox from "../../components/contact/MapBox";
import NavBar from "../../components/NavBar";
import SideBar from "../../components/sideBar/SideBar";

const Contract: React.FC = () => {
const Contact = () => {
const pathname = usePathname();

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

return (
Expand All @@ -19,12 +24,10 @@ const Contract: React.FC = () => {
<div className="main-content">
<NavBar />
<article
className={`resume ${location.pathname === '/contact' ? 'active' : ''}`}
className={`contact ${pathname === '/contact' ? 'active' : ''}`}
data-page="contact"
>
<header>
<h2 className="h2 article-title">Contact</h2>
</header>
<Header title="Hugo's Contact" />
<section className="contact-form">
<MapBox />
<h3 className="h3 form-title">Contact Form</h3>
Expand Down Expand Up @@ -71,4 +74,4 @@ const Contract: React.FC = () => {
);
}

export default Contract;
export default Contact
Binary file added src/app/favicon.ico
Binary file not shown.
Loading

0 comments on commit 24ca94d

Please sign in to comment.