Skip to content

Commit 90f1016

Browse files
authored
Merge pull request #330 from twtwkim/React-김태완-sprint11
[김태완] Sprint 11
2 parents cb854cf + 0d0d30b commit 90f1016

File tree

18 files changed

+681
-260
lines changed

18 files changed

+681
-260
lines changed

package-lock.json

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

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
"version": "0.1.0",
55
"private": true,
66
"dependencies": {
7+
"@reduxjs/toolkit": "^2.4.0",
78
"@testing-library/jest-dom": "^5.17.0",
89
"@testing-library/react": "^13.4.0",
910
"@testing-library/user-event": "^13.5.0",
1011
"@types/jest": "^27.5.2",
1112
"@types/node": "^16.18.119",
1213
"@types/react": "^18.3.12",
1314
"@types/react-dom": "^18.3.1",
15+
"axios": "^1.7.9",
16+
"jwt-decode": "^4.0.0",
1417
"react": "^18.3.1",
1518
"react-dom": "^18.3.1",
19+
"react-hook-form": "^7.53.2",
20+
"react-redux": "^9.1.2",
1621
"react-router-dom": "^6.28.0",
1722
"react-scripts": "5.0.1",
23+
"redux": "^5.0.1",
1824
"typescript": "^4.9.5",
1925
"web-vitals": "^2.1.4"
2026
},

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
manifest.json provides metadata used when your web app is installed on a
1919
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
2020
-->
21-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
21+
<link rel="/manifest" href="%PUBLIC_URL%/manifest.json" />
2222
<!--
2323
Notice the use of %PUBLIC_URL% in the tags above.
2424
It will be replaced with the URL of the `public` folder during the build.

src/App.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Route, Routes } from "react-router-dom";
1+
import { Navigate, Route, Routes } from "react-router-dom";
22
import "./App.css";
33
import MainPage from "./page/MainPage";
44
import AddItemPage from "./page/AddItemPage";
@@ -9,13 +9,25 @@ import Privacy from "./components/Privacy";
99
import FAQ from "./components/FAQ";
1010
import LoginPage from "./page/LoginPage";
1111
import RegisterPage from "./page/RegisterPage";
12+
import { useSelector } from "react-redux";
1213

1314
function App() {
15+
const count = useSelector((state: any) => state.counter.value);
1416
return (
1517
<Routes>
1618
<Route path={ROUTES.LANDING} element={<LandingPage />} />
17-
<Route path={ROUTES.LOGIN} element={<LoginPage />} />
18-
<Route path={ROUTES.REGISTER} element={<RegisterPage />} />
19+
<Route
20+
path={ROUTES.LOGIN}
21+
element={
22+
count === true ? <Navigate to={ROUTES.LANDING} /> : <LoginPage />
23+
}
24+
/>
25+
<Route
26+
path={ROUTES.REGISTER}
27+
element={
28+
count === true ? <Navigate to={ROUTES.LANDING} /> : <RegisterPage />
29+
}
30+
/>
1931
<Route path={ROUTES.PRIVACY} element={<Privacy />} />
2032
<Route path={ROUTES.FAQ} element={<FAQ />} />
2133
<Route path={ROUTES.MAIN}>

0 commit comments

Comments
 (0)