@@ -111,7 +126,8 @@ const SingleProject = () => {
diff --git a/src/pages/w/[workspaceId]/projects/[projectId]/settings/index.tsx b/src/pages/w/[workspaceId]/projects/[projectId]/settings/index.tsx
index 5314cad..059902c 100644
--- a/src/pages/w/[workspaceId]/projects/[projectId]/settings/index.tsx
+++ b/src/pages/w/[workspaceId]/projects/[projectId]/settings/index.tsx
@@ -1,17 +1,15 @@
import React from 'react';
-import Board from '../../../../../../layout/Board';
-import { Button, Input, Form, Select, Badge, Breadcrumb, message } from 'antd';
+import { Button, Input, Form, Select, Badge, message, Skeleton, Typography } from 'antd';
import { api } from '../../../../../../utils/api';
import { useRouter } from 'next/router';
import Image from 'next/image';
import AddUserPopUp from '../../../../../../components/AddUserPopUp.tsx/AddUserPopUp';
import CustomDivider from '../../../../../../components/CustomDivider/CustomDivider';
-import Link from 'next/link';
import { ProjectStatus } from '@prisma/client'
-import { HomeOutlined } from '@ant-design/icons';
import type { FormInstance } from 'antd/lib/form/Form';
import type { User } from '@prisma/client';
+import SettingsLayout from '../../../../../../layout/SettingsLayout';
type FormInitialValues = {
name: string | undefined;
@@ -19,6 +17,8 @@ type FormInitialValues = {
defaultAssignee: string | undefined | null;
};
+const { Text, Title } = Typography;
+
const Settings = () => {
const router = useRouter();
@@ -52,7 +52,7 @@ const Settings = () => {
defaultAssignee: projectDetails.data?.defaultAssigneeId ?? 'unassigned',
})
}
- }, [projectDetails]);
+ }, [form, projectDetails]);
const { mutate: updateProject, isLoading: isUpdating } = api.project.updateProject.useMutation({
onSuccess: () => {
@@ -74,7 +74,7 @@ const Settings = () => {
});
const handleSubmit = (values: FormInitialValues) => {
- updateProject({ name: values.name!, id: projectId as string, projectLeadId: values.projectLead!, defaultAssigneeId: values.defaultAssignee==='unassigned'?null:values.defaultAssignee! });
+ updateProject({ name: values.name!, id: projectId as string, projectLeadId: values.projectLead!, defaultAssigneeId: values.defaultAssignee === 'unassigned' ? null : values.defaultAssignee! });
};
const handleProjectDelete = () => {
@@ -85,96 +85,80 @@ const Settings = () => {
return (
<>
-
,
- },
- {
- title: (
-
- {projectDetails.data?.name}
-
- ),
- },
- {
- title: 'Settings',
- },
- ]}
- />
-
-
-
-
-
{projectDetails.data?.name} {projectDetails.data?.status == ProjectStatus.ACTIVE ? :
- }
-
-
+
+
+
+
+
+
{projectDetails.data?.name} {projectDetails.data?.status == ProjectStatus.ACTIVE ? :
+ }
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
Danger Zone
-
When deleting a project, all of the data and resources within that project will be permanently removed and cannot be recovered.
-
+ isLoading={isUpdating}
+ />
+
+
+
+
+
+
Danger Zone
+ When deleting a project, all of the data and resources within that project will be permanently removed and cannot be recovered.
+
+
+
-
-
+
>
);
};
-
Settings.getLayout = function getLayout(page: React.ReactElement) {
return (
-
{page}
+
{page}
)
}
export default Settings
@@ -199,7 +183,7 @@ const SubmitButton = ({ form, initialValues, isLoading }: { form: FormInstance,
setSubmittable(false);
},
);
- }, [values]);
+ }, [form, initialValues, values]);
return (