fix: event editor not rendered (#9172)
Co-authored-by: Keith Williams <keithwillcode@gmail.com>pull/9182/head^2
parent
951709edef
commit
e6f142dc9e
|
@ -1,23 +1,16 @@
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useEffect } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||||
import { useTypedQuery } from "@calcom/lib/hooks/useTypedQuery";
|
import { useTypedQuery } from "@calcom/lib/hooks/useTypedQuery";
|
||||||
import { HttpError } from "@calcom/lib/http-error";
|
import { HttpError } from "@calcom/lib/http-error";
|
||||||
|
import { md } from "@calcom/lib/markdownIt";
|
||||||
import slugify from "@calcom/lib/slugify";
|
import slugify from "@calcom/lib/slugify";
|
||||||
|
import turndown from "@calcom/lib/turndownService";
|
||||||
import { trpc } from "@calcom/trpc/react";
|
import { trpc } from "@calcom/trpc/react";
|
||||||
import {
|
import { Button, Dialog, DialogClose, DialogContent, Form, showToast, TextField, Editor } from "@calcom/ui";
|
||||||
Button,
|
|
||||||
Dialog,
|
|
||||||
DialogClose,
|
|
||||||
DialogContent,
|
|
||||||
Form,
|
|
||||||
showToast,
|
|
||||||
TextAreaField,
|
|
||||||
TextField,
|
|
||||||
} from "@calcom/ui";
|
|
||||||
|
|
||||||
const querySchema = z.object({
|
const querySchema = z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
|
@ -31,7 +24,7 @@ const querySchema = z.object({
|
||||||
const DuplicateDialog = () => {
|
const DuplicateDialog = () => {
|
||||||
const { t } = useLocale();
|
const { t } = useLocale();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const [firstRender, setFirstRender] = useState(true);
|
||||||
const {
|
const {
|
||||||
data: { pageSlug, slug, ...defaultValues },
|
data: { pageSlug, slug, ...defaultValues },
|
||||||
} = useTypedQuery(querySchema);
|
} = useTypedQuery(querySchema);
|
||||||
|
@ -125,10 +118,13 @@ const DuplicateDialog = () => {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<TextAreaField
|
<Editor
|
||||||
label={t("description")}
|
getText={() => md.render(form.getValues("description") || "")}
|
||||||
|
setText={(value: string) => form.setValue("description", turndown(value))}
|
||||||
|
excludedToolbarItems={["blockType", "link"]}
|
||||||
placeholder={t("quick_video_meeting")}
|
placeholder={t("quick_video_meeting")}
|
||||||
{...register("description")}
|
firstRender={firstRender}
|
||||||
|
setFirstRender={setFirstRender}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
|
|
Loading…
Reference in New Issue