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>
32 lines
902 B
TypeScript
32 lines
902 B
TypeScript
import { ReactElement } from "react";
|
|
import { observer } from "mobx-react";
|
|
// components
|
|
import { PageHead } from "components/core";
|
|
import { ProjectCardList } from "components/project";
|
|
import { ProjectsHeader } from "components/headers";
|
|
// layouts
|
|
import { AppLayout } from "layouts/app-layout";
|
|
// type
|
|
import { NextPageWithLayout } from "lib/types";
|
|
import { useWorkspace } from "hooks/store";
|
|
|
|
const ProjectsPage: NextPageWithLayout = observer(() => {
|
|
// store
|
|
const { currentWorkspace } = useWorkspace();
|
|
// derived values
|
|
const pageTitle = currentWorkspace?.name ? `${currentWorkspace?.name} - Projects` : undefined;
|
|
|
|
return (
|
|
<>
|
|
<PageHead title={pageTitle} />
|
|
<ProjectCardList />
|
|
</>
|
|
);
|
|
});
|
|
|
|
ProjectsPage.getLayout = function getLayout(page: ReactElement) {
|
|
return <AppLayout header={<ProjectsHeader />}>{page}</AppLayout>;
|
|
};
|
|
|
|
export default ProjectsPage;
|