diff --git a/pages/event-types/[type].tsx b/pages/event-types/[type].tsx index 81071a84f1..bc17c0bdf4 100644 --- a/pages/event-types/[type].tsx +++ b/pages/event-types/[type].tsx @@ -2,6 +2,7 @@ import { GetServerSideProps } from "next"; import Head from "next/head"; import Link from "next/link"; import { useRouter } from "next/router"; +import Modal from "../../components/Modal"; import React, { useEffect, useRef, useState } from "react"; import Select, { OptionBase } from "react-select"; import prisma from "@lib/prisma"; @@ -104,6 +105,7 @@ export default function EventTypePage({ availability, }: Props): JSX.Element { const router = useRouter(); + const [successModalOpen, setSuccessModalOpen] = useState(false); const inputOptions: OptionBase[] = [ { value: EventTypeCustomInputType.TEXT, label: "Text" }, @@ -235,7 +237,7 @@ export default function EventTypePage({ }, }); - router.push("/event-types"); + setSuccessModalOpen(true); } async function deleteEventTypeHandler(event) { @@ -268,6 +270,10 @@ export default function EventTypePage({ setSelectedCustomInput(undefined); }; + const closeSuccessModal = () => { + setSuccessModalOpen(false); + }; + const updateLocations = (e) => { e.preventDefault(); @@ -841,6 +847,12 @@ export default function EventTypePage({ +