mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
5b0066140f
* chore: format all files in the project * fix: removing @types/react from dependencies * fix: adding prettier and eslint config * chore: format files * fix: upgrading turbo version * chore: ignoring warnings and adding todos * fix: updated the type of bubble menu item in the document editor * chore: format files --------- Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
49 lines
1.6 KiB
TypeScript
49 lines
1.6 KiB
TypeScript
import { ReactElement } from "react";
|
|
import { useRouter } from "next/router";
|
|
import useSWR from "swr";
|
|
// mobx store
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
// layouts
|
|
import { AppLayout } from "layouts/app-layout";
|
|
import { ProjectSettingLayout } from "layouts/settings-layout";
|
|
// components
|
|
import { ProjectSettingHeader } from "components/headers";
|
|
import { ProjectFeaturesList } from "components/project";
|
|
// types
|
|
import { NextPageWithLayout } from "types/app";
|
|
|
|
const FeaturesSettingsPage: NextPageWithLayout = () => {
|
|
const router = useRouter();
|
|
const { workspaceSlug, projectId } = router.query;
|
|
// store
|
|
const {
|
|
user: { fetchUserProjectInfo },
|
|
} = useMobxStore();
|
|
|
|
const { data: memberDetails } = useSWR(
|
|
workspaceSlug && projectId ? `PROJECT_MEMBERS_ME_${workspaceSlug}_${projectId}` : null,
|
|
workspaceSlug && projectId ? () => fetchUserProjectInfo(workspaceSlug.toString(), projectId.toString()) : null
|
|
);
|
|
|
|
const isAdmin = memberDetails?.role === 20;
|
|
|
|
return (
|
|
<section className={`w-full overflow-y-auto py-8 pr-9 ${isAdmin ? "" : "opacity-60"}`}>
|
|
<div className="flex items-center border-b border-custom-border-100 py-3.5">
|
|
<h3 className="text-xl font-medium">Features</h3>
|
|
</div>
|
|
<ProjectFeaturesList />
|
|
</section>
|
|
);
|
|
};
|
|
|
|
FeaturesSettingsPage.getLayout = function getLayout(page: ReactElement) {
|
|
return (
|
|
<AppLayout header={<ProjectSettingHeader title="Features Settings" />} withProjectWrapper>
|
|
<ProjectSettingLayout>{page}</ProjectSettingLayout>
|
|
</AppLayout>
|
|
);
|
|
};
|
|
|
|
export default FeaturesSettingsPage;
|