plane/web/pages/[workspaceSlug]/projects/[projectId]/views/public/[viewId].tsx

55 lines
1.6 KiB
TypeScript
Raw Normal View History

2024-02-09 16:46:17 +00:00
import { ReactElement, useMemo } from "react";
import { useRouter } from "next/router";
// layouts
import { AppLayout } from "layouts/app-layout";
// components
2024-02-13 06:58:05 +00:00
import { GlobalViewRoot } from "components/view";
2024-02-09 16:46:17 +00:00
// types
import { NextPageWithLayout } from "lib/types";
// constants
import { VIEW_TYPES } from "constants/view";
const ProjectPublicViewPage: NextPageWithLayout = () => {
const router = useRouter();
const { workspaceSlug, projectId, viewId } = router.query;
const workspaceViewTabOptions = useMemo(
() => [
{
key: VIEW_TYPES.PROJECT_PRIVATE_VIEWS,
title: "Private",
href: `/${workspaceSlug}/views/private/assigned`,
},
{
key: VIEW_TYPES.PROJECT_PUBLIC_VIEWS,
title: "Public",
href: `/${workspaceSlug}/views/public/all-issues`,
},
],
[workspaceSlug]
);
if (!workspaceSlug || !viewId) return <></>;
return (
<div className="w-full h-full overflow-hidden bg-custom-background-100 relative flex flex-col">
<div className="flex-shrink-0 w-full">
2024-02-13 06:58:05 +00:00
<GlobalViewRoot
2024-02-09 16:46:17 +00:00
workspaceSlug={workspaceSlug.toString()}
projectId={undefined}
viewId={viewId.toString()}
viewType={VIEW_TYPES.PROJECT_PUBLIC_VIEWS}
baseRoute={`/${workspaceSlug?.toString()}/views/public`}
workspaceViewTabOptions={workspaceViewTabOptions}
/>
</div>
<div className="w-full h-full overflow-hidden">Issues render</div>
</div>
);
};
ProjectPublicViewPage.getLayout = function getLayout(page: ReactElement) {
return <AppLayout header={<></>}>{page}</AppLayout>;
};
export default ProjectPublicViewPage;