Skip to content

Commit

Permalink
feat: adding hashrouting functionalities
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonNotJson committed Oct 9, 2023
1 parent ffff3c2 commit 81568a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/forum/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down
2 changes: 1 addition & 1 deletion apps/forum/src/components/BoardMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const BoardMenu = () => {
>
{/* <span className="text-left list-inside list-disc">•</span> */}
<div className="text-left cursor-pointer border p-2 rounded-lg gap-2">
<Link to={`forum/${board.slug}`} className="text-xl lg:text-2xl">
<Link to={`/${board.slug}`} className="text-xl lg:text-2xl">
{board.title}
</Link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/forum/src/components/ThreadBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
() => {
Expand Down

0 comments on commit 81568a5

Please sign in to comment.