From 3d387c2791ddf01a6ea61e9348bb787be101d133 Mon Sep 17 00:00:00 2001 From: yun Date: Wed, 17 Aug 2022 09:26:03 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=E5=BB=BA=E7=AB=8B=20register?= =?UTF-8?q?=EF=BC=88=E8=A8=BB=E5=86=8A=EF=BC=89,=20login=EF=BC=88=E7=99=BB?= =?UTF-8?q?=E5=85=A5=EF=BC=89,=20todo=EF=BC=88=E5=BE=85=E8=BE=A6=E4=BA=8B?= =?UTF-8?q?=E9=A0=85=EF=BC=89=20=E4=B8=89=E5=80=8B=E9=A0=81=E9=9D=A2?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=EF=BC=8C=E8=AE=93=E4=B8=8A=E6=96=B9=E7=9A=84?= =?UTF-8?q?=20Nav=20=E9=81=B8=E5=96=AE=E5=8F=AF=E5=88=87=E6=8F=9B=E5=88=B0?= =?UTF-8?q?=E5=90=84=E9=A0=81=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 415b36d..8821413 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,8 @@ import './App.css'; import { + BrowserRouter, + Route, + Routes, HashRouter, NavLink, } from 'react-router-dom'; @@ -18,7 +21,7 @@ const Register = () => { function App() { return (
- +

回到首頁

@@ -34,8 +37,13 @@ function App() {
{/* Routes, Route 練習區 */} + + } /> + } /> + } /> + {/* 練習區 */} -
+
); } From fb81791fc553d4ec62360a2933a8a56675f24792 Mon Sep 17 00:00:00 2001 From: yun Date: Thu, 18 Aug 2022 09:13:25 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=20Todo=20=E5=85=83=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E5=8A=A0=E5=85=A5=20Logout=20=E5=85=83=E4=BB=B6?= =?UTF-8?q?=EF=BC=8CLogout=20=E5=85=83=E4=BB=B6=E6=9C=89=E4=B8=80=E9=A1=86?= =?UTF-8?q?=E7=99=BB=E5=87=BA=E6=8C=89=E9=88=95=EF=BC=8C=E9=BB=9E=E9=81=B8?= =?UTF-8?q?=E7=99=BB=E5=87=BA=E5=BE=8C=EF=BC=8C=E4=BD=BF=E7=94=A8=20naviga?= =?UTF-8?q?te=20=E5=B0=8E=E5=9B=9E=20/login=20=E7=95=AB=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 8821413..bea0fd1 100644 --- a/src/App.js +++ b/src/App.js @@ -5,11 +5,23 @@ import { Routes, HashRouter, NavLink, + useNavigate, } from 'react-router-dom'; +const Logout = () => { + let navigate = useNavigate(); + return( + + ) +} + const Todo = () => { - return

這是 Todo 頁面 -

; + return ( + <> +

這是 Todo 頁面

+ + + ) }; const Login = () => { return

這是登入頁面

; From e240e83b1a6ab116983569b63e4e3f1c2ca80245 Mon Sep 17 00:00:00 2001 From: yun Date: Fri, 19 Aug 2022 09:16:28 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20(React=20Router=20=E5=8B=95?= =?UTF-8?q?=E6=85=8B=E8=B7=AF=E7=94=B1)=20=E5=AE=9A=E7=BE=A9=20Post=20?= =?UTF-8?q?=E5=92=8C=20PostId=20=E5=85=A9=E5=80=8B=E5=85=83=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=88=86=E5=88=A5=E6=9C=83=E7=9C=8B=E5=88=B0=20Post?= =?UTF-8?q?=20=E8=A9=B3=E7=B4=B0=E8=B3=87=E6=96=99=E9=A0=81=E9=9D=A2?= =?UTF-8?q?=E3=80=81=E9=BB=9E=E5=85=A5=20/:postId=20=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E6=9C=83=E9=A1=AF=E7=A4=BA=20Post=20ID=20=E3=80=82=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=20NavLink=EF=BC=8C=E8=AE=93=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E8=80=85=E5=8F=AF=E4=BB=A5=E7=9B=B4=E6=8E=A5=E9=BB=9E=E6=93=8A?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E9=80=99=E4=BA=9B=E9=A0=81=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/App.js b/src/App.js index bea0fd1..5f0399e 100644 --- a/src/App.js +++ b/src/App.js @@ -6,6 +6,8 @@ import { HashRouter, NavLink, useNavigate, + Outlet, + useParams, } from 'react-router-dom'; const Logout = () => { @@ -23,6 +25,21 @@ const Todo = () => { ) }; + +const Post = () => { + return ( +
+

Post 頁面

+ +
+ ); +}; +const PostId = () => { + let params = useParams(); + return

Post ID: {params.postId}

; +}; + + const Login = () => { return

這是登入頁面

; }; @@ -47,12 +64,24 @@ function App() {

Todo 頁面

+ +

Post 頁面

+
+ +

Post 詳細頁面1

+
+ +

Post 詳細頁面2

+
{/* Routes, Route 練習區 */} } /> } /> } /> + }> + } /> + {/* 練習區 */} From f811fc28d55c5ca8f6fcb6e0cdb58b04f599b3c0 Mon Sep 17 00:00:00 2001 From: yun Date: Fri, 26 Aug 2022 09:07:42 +0800 Subject: [PATCH 4/5] =?UTF-8?q?feat:=E7=B6=B2=E7=AB=99=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e91bfac..7db8a29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-daily-sample", - "homepage": "https://hexschool.github.io/react-daily-task-router", + "homepage": "https://github.com/yunniyunyun/react-daily-task-router", "version": "0.1.0", "private": true, "dependencies": { From 709bef1ef9874676c63daabd04b2c97fd13131f5 Mon Sep 17 00:00:00 2001 From: yun Date: Fri, 26 Aug 2022 10:31:42 +0800 Subject: [PATCH 5/5] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E7=B6=B2?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7db8a29..633ce0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-daily-sample", - "homepage": "https://github.com/yunniyunyun/react-daily-task-router", + "homepage": "https://yunniyunyun.github.io/react-daily-task-router", "version": "0.1.0", "private": true, "dependencies": {