Refactor: use EditableHeading in event-types/[type].tsx (#3468)

Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
Pavel ShapelandPeer Richelsen authored and GitHub committed 2022-07-22 20:51:38 +00:00
1 parent 982ca3a783
commit 342efaed31
6 files changed
+39 -106

No files matched your search

@@ -14,7 +14,7 @@ import { Form, TextArea } from "@calcom/ui/form/fields";
import { inferSSRProps } from "@lib/types/inferSSRProps";
import PencilEdit from "@components/PencilEdit";
import EditableHeading from "@components/ui/EditableHeading";
import RoutingShell from "../../components/RoutingShell";
import SideBar from "../../components/SideBar";
@@ -285,12 +285,8 @@ export default function FormEdit({
form={form}
appUrl={appUrl}
heading={
<PencilEdit
value={
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
hookForm.watch("name")
}
<EditableHeading
title={hookForm.watch("name")}
onChange={(value) => {
hookForm.setValue("name", value);
}}
@@ -13,7 +13,7 @@ import { inferSSRProps } from "@calcom/types/inferSSRProps";
import { Button } from "@calcom/ui";
import { Label } from "@calcom/ui/form/fields";
import PencilEdit from "@components/PencilEdit";
import EditableHeading from "@components/ui/EditableHeading";
import { SelectWithValidation as Select } from "@components/ui/form/Select";
import RoutingShell from "../../components/RoutingShell";
@@ -466,7 +466,10 @@ export default function RouteBuilder({
appUrl,
}: inferSSRProps<typeof getServerSideProps> & { appUrl: string }) {
return (
<RoutingShell appUrl={appUrl} heading={<PencilEdit value={form?.name} readOnly={true} />} form={form}>
<RoutingShell
appUrl={appUrl}
heading={<EditableHeading title={form?.name} readOnly={true} />}
form={form}>
<div className="route-config">
<Routes form={form} appUrl={appUrl} />
</div>