From 432597ef5c1677667dc06ae5f6dc9219b752c6c4 Mon Sep 17 00:00:00 2001 From: Khang Le Date: Mon, 2 Dec 2024 12:02:28 -0800 Subject: [PATCH 1/4] upgrade from react v16 to react v18 --- package.json | 32 +++++++++++-------------- public/index.html | 2 +- src/App.js | 1 + src/components/About.js | 2 +- src/components/Footer.js | 2 +- src/components/Home.js | 31 ++++++++++++------------ src/components/NavBar.js | 5 ++-- src/components/Projects.js | 2 +- src/components/Skills.js | 2 +- src/components/Work.js | 2 +- src/index.js | 2 +- src/tests/About.test.js | 12 ++++------ src/tests/App.test.js | 48 +++++++++++++++++++------------------- src/tests/Footer.test.js | 11 ++++----- src/tests/Home.test.js | 20 +++++++--------- src/tests/NavBar.test.js | 48 +++++++++++++++++--------------------- src/tests/NavList.test.js | 41 ++++++++++++++++++++------------ src/tests/Projects.test.js | 11 ++++----- src/tests/Skills.test.js | 19 ++++++++------- src/tests/Work.test.js | 12 +++++----- src/tests/setup-jest.js | 3 --- src/tests/setupTests.js | 5 ---- 22 files changed, 152 insertions(+), 161 deletions(-) delete mode 100644 src/tests/setup-jest.js delete mode 100644 src/tests/setupTests.js diff --git a/package.json b/package.json index 8c6905a..8c16ed4 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,12 @@ "private": true, "homepage": "https://tkhang1999.github.io/about-me/", "dependencies": { - "@testing-library/jest-dom": "^5.14.1", - "@testing-library/react": "^11.2.7", - "@testing-library/user-event": "^12.8.3", - "react": "^16.14.0", - "react-dom": "^16.14.0", - "react-reveal": "^1.2.2", + "react": "^18.3.1", + "react-awesome-reveal": "^4.2.14", + "react-dom": "^18.3.1", "react-scripts": "^5.0.1", "react-toggle": "^4.1.2", - "web-vitals": "^1.1.2" + "web-vitals": "^4.2.4" }, "scripts": { "start": "react-scripts start", @@ -44,23 +41,22 @@ ] }, "devDependencies": { - "@babel/plugin-proposal-private-property-in-object": "7.21.11", - "enzyme": "^3.11.0", - "enzyme-adapter-react-16": "^1.15.6", - "gh-pages": "^5.0.0", - "prettier": "2.4.1", - "react-test-renderer": "^16.14.0", - "cheerio": "=1.0.0-rc.3" + "@babel/preset-env": "^7.26.0", + "@babel/preset-react": "^7.25.9", + "@testing-library/dom": "^10.4.0", + "@testing-library/react": "^16.0.1", + "@testing-library/user-event": "^14.5.2", + "babel-jest": "^29.7.0", + "gh-pages": "^6.2.0", + "jest": "^27.5.1", + "prettier": "3.4.1", + "react-test-renderer": "^18.3.1" }, "jest": { "moduleNameMapper": { "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/src/tests/fileMock.js", "\\.(css|less)$": "/src/tests/styleMock.js" }, - "setupFilesAfterEnv": [ - "/src/tests/setup-jest.js", - "/src/tests/setupTests.js" - ], "testEnvironment": "jsdom" } } diff --git a/public/index.html b/public/index.html index 827a29f..11e3c07 100644 --- a/public/index.html +++ b/public/index.html @@ -1,4 +1,4 @@ - + diff --git a/src/App.js b/src/App.js index e50b90f..40c0d5a 100644 --- a/src/App.js +++ b/src/App.js @@ -13,6 +13,7 @@ const App = () => { const onClick = () => { if (isMenuOpen) { + console.log("close menu"); setIsMenuOpen(false); } }; diff --git a/src/components/About.js b/src/components/About.js index 7a493b0..b3afa27 100644 --- a/src/components/About.js +++ b/src/components/About.js @@ -2,7 +2,7 @@ import aboutImg from "../images/about.png"; const About = () => { return ( -
+

About

diff --git a/src/components/Footer.js b/src/components/Footer.js index c74a120..ee0fd49 100644 --- a/src/components/Footer.js +++ b/src/components/Footer.js @@ -1,6 +1,6 @@ const Footer = () => { return ( -