Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

revert contact create and edit

Jean-Baptiste Kaiser11ee627cf4be
diff --git a/src/components/atomic-crm/contacts/ContactCreate.tsx b/src/components/atomic-crm/contacts/ContactCreate.tsx
index f9c9a320..ecbeff76 100644
--- a/src/components/atomic-crm/contacts/ContactCreate.tsx
+++ b/src/components/atomic-crm/contacts/ContactCreate.tsx
@@ -1,11 +1,12 @@
-import { Card, CardContent } from "@/components/ui/card";
import { CreateBase, Form, useGetIdentity } from "ra-core";
+import { Card, CardContent } from "@/components/ui/card";
-import { FormToolbar } from "../layout/FormToolbar";
import type { Contact } from "../types";
import { ContactInputs } from "./ContactInputs";
+import { FormToolbar } from "../layout/FormToolbar";
export const ContactCreate = () => {
+ const { identity } = useGetIdentity();
return (
<CreateBase
redirect="show"
@@ -16,25 +17,18 @@ export const ContactCreate = () => {
tags: [],
})}
>
- <ContactCreateContent />
- </CreateBase>
- );
-};
-
-const ContactCreateContent = () => {
- const { identity } = useGetIdentity();
- return (
- <div className="mt-2 flex lg:mr-72">
- <div className="flex-1">
- <Form defaultValues={{ sales_id: identity?.id }}>
- <Card>
- <CardContent>
- <ContactInputs />
- <FormToolbar />
- </CardContent>
- </Card>
- </Form>
+ <div className="mt-2 flex lg:mr-72">
+ <div className="flex-1">
+ <Form defaultValues={{ sales_id: identity?.id }}>
+ <Card>
+ <CardContent>
+ <ContactInputs />
+ <FormToolbar />
+ </CardContent>
+ </Card>
+ </Form>
+ </div>
</div>
- </div>
+ </CreateBase>
);
};
diff --git a/src/components/atomic-crm/contacts/ContactEdit.tsx b/src/components/atomic-crm/contacts/ContactEdit.tsx
index e0d14978..fe5e4d0d 100644
--- a/src/components/atomic-crm/contacts/ContactEdit.tsx
+++ b/src/components/atomic-crm/contacts/ContactEdit.tsx
@@ -1,18 +1,16 @@
import { Card, CardContent } from "@/components/ui/card";
import { EditBase, Form, useEditContext } from "ra-core";
-import { FormToolbar } from "../layout/FormToolbar";
import type { Contact } from "../types";
import { ContactAside } from "./ContactAside";
import { ContactInputs } from "./ContactInputs";
+import { FormToolbar } from "../layout/FormToolbar";
-export const ContactEdit = () => {
- return (
- <EditBase redirect="show">
- <ContactEditContent />
- </EditBase>
- );
-};
+export const ContactEdit = () => (
+ <EditBase redirect="show">
+ <ContactEditContent />
+ </EditBase>
+);
const ContactEditContent = () => {
const { isPending, record } = useEditContext<Contact>();