From 81568a536392712bbf9c5ea56ae0574c107b731b Mon Sep 17 00:00:00 2001 From: Jason Park Date: Tue, 10 Oct 2023 00:00:51 +0900 Subject: [PATCH] feat: adding hashrouting functionalities --- apps/forum/src/components/App.tsx | 4 ++-- apps/forum/src/components/BoardMenu.tsx | 2 +- apps/forum/src/components/ThreadBlock.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/forum/src/components/App.tsx b/apps/forum/src/components/App.tsx index f06be79c..36daf93e 100644 --- a/apps/forum/src/components/App.tsx +++ b/apps/forum/src/components/App.tsx @@ -54,11 +54,11 @@ const InnerApp = () => { const [filterButtonClicked, setFilterButtonClicked] = useState(false); const isThreadRoute = - location.pathname.includes("forum/") && + location.pathname.includes("forum#/") && location.pathname.split("/").length === 4; const handleReset = () => { - navigate("/forum"); + navigate("/"); setRefresh(!refresh); }; diff --git a/apps/forum/src/components/BoardMenu.tsx b/apps/forum/src/components/BoardMenu.tsx index 9a5264c2..2d3757f1 100644 --- a/apps/forum/src/components/BoardMenu.tsx +++ b/apps/forum/src/components/BoardMenu.tsx @@ -14,7 +14,7 @@ const BoardMenu = () => { > {/* */}
- + {board.title}
diff --git a/apps/forum/src/components/ThreadBlock.tsx b/apps/forum/src/components/ThreadBlock.tsx index cb76eafe..eb46576e 100644 --- a/apps/forum/src/components/ThreadBlock.tsx +++ b/apps/forum/src/components/ThreadBlock.tsx @@ -164,7 +164,7 @@ const ThreadBlock = ({ isPreview, fromRoot, thread, onDelete }: Props) => { }; const handleShare = () => { - const url = `${window.location.origin}/forum/${thread.board_id}/${thread.thread_id}`; + const url = `${window.location.origin}/forum#/${thread.board_id}/${thread.thread_id}`; navigator.clipboard.writeText(url).then( () => {