mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
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>
60 lines
1.8 KiB
TypeScript
60 lines
1.8 KiB
TypeScript
import { observer } from "mobx-react-lite";
|
|
// hooks
|
|
import { useUser, useWorkspace } from "hooks/store";
|
|
// layout
|
|
import { AppLayout } from "layouts/app-layout";
|
|
import { WorkspaceSettingLayout } from "layouts/settings-layout";
|
|
// components
|
|
import { WorkspaceSettingHeader } from "components/headers";
|
|
import ExportGuide from "components/exporter/guide";
|
|
import { PageHead } from "components/core";
|
|
// types
|
|
import { NextPageWithLayout } from "lib/types";
|
|
// constants
|
|
import { EUserWorkspaceRoles } from "constants/workspace";
|
|
|
|
const ExportsPage: NextPageWithLayout = observer(() => {
|
|
// store hooks
|
|
const {
|
|
membership: { currentWorkspaceRole },
|
|
} = useUser();
|
|
const { currentWorkspace } = useWorkspace();
|
|
|
|
// derived values
|
|
const hasPageAccess =
|
|
currentWorkspaceRole && [EUserWorkspaceRoles.ADMIN, EUserWorkspaceRoles.MEMBER].includes(currentWorkspaceRole);
|
|
const pageTitle = currentWorkspace?.name ? `${currentWorkspace.name} - Exports` : undefined;
|
|
|
|
if (!hasPageAccess)
|
|
return (
|
|
<>
|
|
<PageHead title={pageTitle} />
|
|
<div className="mt-10 flex h-full w-full justify-center p-4">
|
|
<p className="text-sm text-custom-text-300">You are not authorized to access this page.</p>
|
|
</div>
|
|
</>
|
|
);
|
|
|
|
return (
|
|
<>
|
|
<PageHead title={pageTitle} />
|
|
<div className="w-full overflow-y-auto py-8 pr-9">
|
|
<div className="flex items-center border-b border-custom-border-100 py-3.5">
|
|
<h3 className="text-xl font-medium">Exports</h3>
|
|
</div>
|
|
<ExportGuide />
|
|
</div>
|
|
</>
|
|
);
|
|
});
|
|
|
|
ExportsPage.getLayout = function getLayout(page: React.ReactElement) {
|
|
return (
|
|
<AppLayout header={<WorkspaceSettingHeader title="Export Settings" />}>
|
|
<WorkspaceSettingLayout>{page}</WorkspaceSettingLayout>
|
|
</AppLayout>
|
|
);
|
|
};
|
|
|
|
export default ExportsPage;
|