forked from github/plane
cf3b888465
* chore: adding page titles * chore: added title to remaining pages * fix: added observer at required places --------- Co-authored-by: LAKHAN BAHETI <lakhanbaheti9@gmail.com>
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { ReactElement } from "react";
|
|
import { useRouter } from "next/router";
|
|
import { observer } from "mobx-react";
|
|
// components
|
|
import { ProjectViewsHeader } from "components/headers";
|
|
import { ProjectViewsList } from "components/views";
|
|
import { PageHead } from "components/core";
|
|
// hooks
|
|
import { useProject } from "hooks/store";
|
|
// layouts
|
|
import { AppLayout } from "layouts/app-layout";
|
|
// types
|
|
import { NextPageWithLayout } from "lib/types";
|
|
|
|
const ProjectViewsPage: NextPageWithLayout = observer(() => {
|
|
// router
|
|
const router = useRouter();
|
|
const { projectId } = router.query;
|
|
// store
|
|
const { getProjectById } = useProject();
|
|
// derived values
|
|
const project = projectId ? getProjectById(projectId.toString()) : undefined;
|
|
const pageTitle = project?.name ? `${project?.name} - Views` : undefined;
|
|
|
|
return (
|
|
<>
|
|
<PageHead title={pageTitle} />
|
|
<ProjectViewsList />
|
|
</>
|
|
);
|
|
});
|
|
|
|
ProjectViewsPage.getLayout = function getLayout(page: ReactElement) {
|
|
return (
|
|
<AppLayout header={<ProjectViewsHeader />} withProjectWrapper>
|
|
{page}
|
|
</AppLayout>
|
|
);
|
|
};
|
|
|
|
export default ProjectViewsPage;
|