diff --git a/space/app/[workspaceSlug]/[projectId]/layout.tsx b/space/app/[workspaceSlug]/[projectId]/layout.tsx index 4c3da9f94..a205d599f 100644 --- a/space/app/[workspaceSlug]/[projectId]/layout.tsx +++ b/space/app/[workspaceSlug]/[projectId]/layout.tsx @@ -1,3 +1,5 @@ +"use client"; + type Props = { children: React.ReactNode; params: { @@ -6,7 +8,7 @@ type Props = { }; }; -const IssuesLayout = async (props: Props) => { +const IssuesLayout = (props: Props) => { const { children } = props; return <>{children}; diff --git a/space/app/[workspaceSlug]/[projectId]/page.tsx b/space/app/[workspaceSlug]/[projectId]/page.tsx index b95855be4..04d60fce9 100644 --- a/space/app/[workspaceSlug]/[projectId]/page.tsx +++ b/space/app/[workspaceSlug]/[projectId]/page.tsx @@ -1,11 +1,9 @@ "use client"; import { useEffect, useState } from "react"; -import { notFound, useSearchParams } from "next/navigation"; +import { notFound, useSearchParams, useRouter } from "next/navigation"; // components import { LogoSpinner } from "@/components/common"; -// helpers -import { navigate } from "@/helpers/actions"; // services import PublishService from "@/services/publish.service"; const publishService = new PublishService(); @@ -22,6 +20,8 @@ const IssuesPage = (props: Props) => { const { workspaceSlug, projectId } = params; // states const [error, setError] = useState(false); + // router + const router = useRouter(); // params const searchParams = useSearchParams(); const board = searchParams.get("board"); @@ -39,11 +39,12 @@ const IssuesPage = (props: Props) => { if (board) params.append("board", board); if (peekId) params.append("peekId", peekId); if (params.toString()) url += `?${params.toString()}`; - navigate(url); + router.push(url); + // navigate(url); } else throw Error("Invalid entity name"); }) .catch(() => setError(true)); - }, [board, peekId, projectId, workspaceSlug]); + }, [board, peekId, projectId, router, workspaceSlug]); if (error) notFound(); diff --git a/space/helpers/actions.ts b/space/helpers/actions.ts deleted file mode 100644 index 5e85029ca..000000000 --- a/space/helpers/actions.ts +++ /dev/null @@ -1,5 +0,0 @@ -"use server"; - -import { redirect } from "next/navigation"; - -export const navigate = async (path: string) => redirect(path);