From e59d29a42963fd99cedab4b6d4527fe7280b9455 Mon Sep 17 00:00:00 2001 From: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com> Date: Fri, 18 Mar 2022 15:25:02 +0530 Subject: [PATCH] reverts to before dialog change state (#2195) --- apps/web/pages/cancel/[uid].tsx | 211 ++++++++++-------- apps/web/pages/cancel/success.tsx | 65 +++--- apps/web/pages/video/meeting-ended/[uid].tsx | 76 ++++--- .../pages/video/meeting-not-started/[uid].tsx | 77 ++++--- apps/web/pages/video/no-meeting-found.tsx | 55 +++-- 5 files changed, 275 insertions(+), 209 deletions(-) diff --git a/apps/web/pages/cancel/[uid].tsx b/apps/web/pages/cancel/[uid].tsx index feec8ff2..3f64966e 100644 --- a/apps/web/pages/cancel/[uid].tsx +++ b/apps/web/pages/cancel/[uid].tsx @@ -5,7 +5,6 @@ import { useRouter } from "next/router"; import { useState } from "react"; import { Button } from "@calcom/ui/Button"; -import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/Dialog"; import { TextField } from "@calcom/ui/form/fields"; import { asStringOrUndefined } from "@lib/asStringOrNull"; @@ -39,107 +38,123 @@ export default function Type(props: inferSSRProps) { />
- - { - e.preventDefault(); - }}> - {error && ( -
-
- -
-
- -
-
- )} - {!error && ( - <> -
-
- -
-
- -
-

- {props.cancellationAllowed ? t("reschedule_instead") : t("event_is_in_the_past")} -

+
+
+
+ {!error && ( + <> +
+
+ +
+
+ +
+

+ {props.cancellationAllowed ? t("reschedule_instead") : t("event_is_in_the_past")} +

+
+
+

+ {props.booking?.title} +

+

+ + {dayjs(props.booking?.startTime).format( + detectBrowserTimeFormat + ", dddd DD MMMM YYYY" + )} +

+
+
+
+ {props.cancellationAllowed && ( +
+ setCancellationReason(e.target.value)} + className="mb-5 sm:mb-6" + /> +
+ + +
+
+ )} + + )} + + + +
); diff --git a/apps/web/pages/cancel/success.tsx b/apps/web/pages/cancel/success.tsx index a744df7f..e2c2af98 100644 --- a/apps/web/pages/cancel/success.tsx +++ b/apps/web/pages/cancel/success.tsx @@ -5,7 +5,6 @@ import { useRouter } from "next/router"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import Button from "@calcom/ui/Button"; -import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/Dialog"; import { HeadSeo } from "@components/seo/head-seo"; @@ -23,34 +22,46 @@ export default function CancelSuccess() { description={`${t("cancelled")} ${title} | ${name}`} />
- - { - e.preventDefault(); - }}> -
- -
-
- -
- {!loading && !session?.user && ( -
-

{t("free_to_pick_another_event_type")}

+
+
+
+ +
); diff --git a/apps/web/pages/video/meeting-ended/[uid].tsx b/apps/web/pages/video/meeting-ended/[uid].tsx index 6a504d8e..0484b979 100644 --- a/apps/web/pages/video/meeting-ended/[uid].tsx +++ b/apps/web/pages/video/meeting-ended/[uid].tsx @@ -6,9 +6,7 @@ import { getSession } from "next-auth/react"; import { useRouter } from "next/router"; import { useEffect } from "react"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; import Button from "@calcom/ui/Button"; -import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/Dialog"; import prisma from "@lib/prisma"; import { detectBrowserTimeFormat } from "@lib/timeFormat"; @@ -18,7 +16,6 @@ import { HeadSeo } from "@components/seo/head-seo"; export default function MeetingUnavailable(props: inferSSRProps) { const router = useRouter(); - const { t } = useLocale(); // if no booking redirectis to the 404 page const emptyBooking = props.booking === null; useEffect(() => { @@ -31,38 +28,49 @@ export default function MeetingUnavailable(props: inferSSRProps
- - { - e.preventDefault(); - }}> -
- +
+
+ -
- -
- -

- - {dayjs(props.booking.startTime).format(detectBrowserTimeFormat + ", dddd DD MMMM YYYY")} -

-

- This meeting will be accessible 60 minutes in advance. -

-
- - - -
- -
+ +
); diff --git a/apps/web/pages/video/meeting-not-started/[uid].tsx b/apps/web/pages/video/meeting-not-started/[uid].tsx index 765af769..c3ad5686 100644 --- a/apps/web/pages/video/meeting-not-started/[uid].tsx +++ b/apps/web/pages/video/meeting-not-started/[uid].tsx @@ -6,9 +6,7 @@ import { getSession } from "next-auth/react"; import { useRouter } from "next/router"; import { useEffect } from "react"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; import Button from "@calcom/ui/Button"; -import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/Dialog"; import prisma from "@lib/prisma"; import { detectBrowserTimeFormat } from "@lib/timeFormat"; @@ -18,7 +16,7 @@ import { HeadSeo } from "@components/seo/head-seo"; export default function MeetingNotStarted(props: inferSSRProps) { const router = useRouter(); - const { t } = useLocale(); + //if no booking redirectis to the 404 page const emptyBooking = props.booking === null; useEffect(() => { @@ -31,33 +29,54 @@ export default function MeetingNotStarted(props: inferSSRProps
- - { - e.preventDefault(); - }}> -
- +
+
+ -
- -
-

- - {dayjs(props.booking.startTime).format(detectBrowserTimeFormat + ", dddd DD MMMM YYYY")} -

-

- This meeting will be accessible 60 minutes in advance. -

-
- - - -
- -
+ +
); diff --git a/apps/web/pages/video/no-meeting-found.tsx b/apps/web/pages/video/no-meeting-found.tsx index c048e392..f8882dab 100644 --- a/apps/web/pages/video/no-meeting-found.tsx +++ b/apps/web/pages/video/no-meeting-found.tsx @@ -3,7 +3,6 @@ import { ArrowRightIcon } from "@heroicons/react/solid"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import Button from "@calcom/ui/Button"; -import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/Dialog"; import { HeadSeo } from "@components/seo/head-seo"; @@ -14,27 +13,41 @@ export default function NoMeetingFound() {
- - { - e.preventDefault(); - }}> -
- +
+
+ -
- -
-

{t("no_meeting_found_description")}

-
- - - -
- -
+
+ );