diff --git a/packages/platform/examples/base/src/pages/[bookingUid].tsx b/packages/platform/examples/base/src/pages/[bookingUid].tsx index 0c4cc8250d..54968af26b 100644 --- a/packages/platform/examples/base/src/pages/[bookingUid].tsx +++ b/packages/platform/examples/base/src/pages/[bookingUid].tsx @@ -1,14 +1,26 @@ import { Navbar } from "@/components/Navbar"; +import { CheckCircle2Icon } from "lucide-react"; +import { X } from "lucide-react"; import { Inter } from "next/font/google"; import { useRouter } from "next/router"; import { useGetBooking, useCancelBooking } from "@calcom/atoms"; +import dayjs from "@calcom/dayjs"; const inter = Inter({ subsets: ["latin"] }); export default function Bookings(props: { calUsername: string; calEmail: string }) { const router = useRouter(); + const { isLoading, data: booking, refetch } = useGetBooking((router.query.bookingUid as string) ?? ""); + const startTime = dayjs(booking?.startTime).format(12 === 12 ? "h:mma" : "HH:mm"); + const endTime = dayjs(booking?.endTime).format(12 === 12 ? "h:mma" : "HH:mm"); + const date = dayjs(booking?.startTime).toDate(); + const dateToday = dayjs(booking?.startTime).date(); + const year = dayjs(booking?.startTime).year(); + const day = dayjs(date).format("dddd"); + const month = dayjs(date).format("MMMM"); + const { mutate: cancelBooking } = useCancelBooking({ onSuccess: () => { refetch(); @@ -20,41 +32,118 @@ export default function Bookings(props: { calUsername: string; calEmail: string {isLoading &&

Loading...

} {!isLoading && booking && ( -
-
-
-

{booking.title}

+
+ {booking.status === "ACCEPTED" ? ( +
+ +

This meeting is scheduled

+

We sent an email with a calendar invitation with the details to everyone.

+ ) : ( +
+ +

This event is cancelled

+
+ )} +
+
+
+
+

What

+
+
+

{booking.title}

+
+
+
+
+

When

+
+
+
+

+ {`${day}, ${month} ${dateToday}, ${year}`} +

+
+
+

+ {`${startTime}`} - {`${endTime}`} +

+
+
+
+
+
Who
+
+
+
+

+ {booking.user.name}{" "} + Host +

+

{booking.user.email}

+
+
+
+
+

{`${booking.responses.name}`}

+

{`${booking.responses.email}`}

+
+
+
+
+ {booking.responses.notes && ( +
+
+

Additional notes

+
+
+

{`${booking.responses.notes}`}

+
+
+ )}
-
-

{booking.description}

-

{booking.startTime}

-

{booking.endTime}

-

{booking.status}

-
-
- - -
+ + {booking.status === "ACCEPTED" && ( + <> +
+
+

+ Need to make a change?{" "} + {" "} + or{" "} + +

+
+ + )}
)} diff --git a/packages/platform/examples/base/src/pages/booking.tsx b/packages/platform/examples/base/src/pages/booking.tsx index e0606fdb01..1a8f8c81ef 100644 --- a/packages/platform/examples/base/src/pages/booking.tsx +++ b/packages/platform/examples/base/src/pages/booking.tsx @@ -19,20 +19,29 @@ export default function Bookings(props: { calUsername: string; calEmail: string className={`flex min-h-screen flex-col ${inter.className} main text-default flex min-h-full w-full flex-col items-center overflow-visible`}>
-

{props.calUsername} Public Booking Page

+

{props.calUsername} Public Booking Page

{isLoadingEvents && !eventTypeSlug &&

Loading...

} {!isLoadingEvents && !eventTypeSlug && Boolean(eventTypes?.length) && !rescheduleUid && ( -
- {eventTypes?.map((event: { id: number; slug: string; title: string }) => ( - - ))} +
+ {eventTypes?.map((event: { id: number; slug: string; title: string }) => { + const formatEventSlug = event.slug + .split("-") + .map((item) => `${item[0].toLocaleUpperCase()}${item.slice(1)}`) + .join(" "); + + return ( +
setEventTypeSlug(event.slug)} + className="mx-10 w-[80vw] cursor-pointer rounded-md border-[0.8px] border-black px-10 py-4" + key={event.id}> +

{formatEventSlug}

+

{`/${event.slug}`}

+ {event?.length} +
+ ); + })}
)} diff --git a/packages/platform/examples/base/src/pages/bookings.tsx b/packages/platform/examples/base/src/pages/bookings.tsx index 00f2067c52..d9d38c4db5 100644 --- a/packages/platform/examples/base/src/pages/bookings.tsx +++ b/packages/platform/examples/base/src/pages/bookings.tsx @@ -3,6 +3,7 @@ import { Inter } from "next/font/google"; import { useRouter } from "next/router"; import { useGetBookings } from "@calcom/atoms"; +import dayjs from "@calcom/dayjs"; const inter = Inter({ subsets: ["latin"] }); @@ -29,25 +30,45 @@ export default function Bookings(props: { calUsername: string; calEmail: string {isLoading &&

Loading...

} {!isLoading && (Boolean(upcomingBookings?.bookings.length) || Boolean(pastBookings?.bookings.length)) && - [...pastBookings?.bookings, ...upcomingBookings?.bookings].map((booking) => ( -
{ - router.push(`/${booking.uid}`); - }}> -
-
-

{booking.title}

+ [...pastBookings?.bookings, ...upcomingBookings?.bookings].map((booking) => { + const date = dayjs(booking.startTime).toDate(); + const startTime = dayjs(booking?.startTime).format(12 === 12 ? "h:mma" : "HH:mm"); + const endTime = dayjs(booking?.endTime).format(12 === 12 ? "h:mma" : "HH:mm"); + const day = dayjs(date).format("dddd"); + const month = dayjs(date).format("MMMM"); + + return ( +
{ + router.push(`/${booking.uid}`); + }}> +
+
{`${day}, ${dayjs(booking.startTime).date()} ${month}`}
+
+

+ {startTime} - {endTime} +

{" "} +

+

+
+
+
+
+

{booking.title}

+
+
+
+

+ {booking.user.name} and {booking.attendees[0].name} +

{" "} +

+

-
-

{booking.startTime}

-

{booking.endTime}

-

{booking.status}

-
-
- ))} + ); + })} ); } diff --git a/packages/platform/examples/base/src/pages/calendars.tsx b/packages/platform/examples/base/src/pages/calendars.tsx index d8452ceda7..0a273b3061 100644 --- a/packages/platform/examples/base/src/pages/calendars.tsx +++ b/packages/platform/examples/base/src/pages/calendars.tsx @@ -13,7 +13,13 @@ export default function Calendars(props: { calUsername: string; calEmail: string
-

Your Connected Calendars

+ {!!connectedCalendars?.length ? ( +

Your Connected Calendars

+ ) : ( +

+ You have not connected any calendars yet, please connect your Google calendar. +

+ )} {isLoading ? (
Loading...
) : ( @@ -29,7 +35,7 @@ export default function Calendars(props: { calUsername: string; calEmail: string
)) )} -
+ {!!connectedCalendars?.length &&
} {!isLoading && destinationCalendar.id && (

Destination Calendar: {destinationCalendar.name}

diff --git a/packages/platform/examples/base/src/pages/index.tsx b/packages/platform/examples/base/src/pages/index.tsx index 3014ea30aa..525ffe1a79 100644 --- a/packages/platform/examples/base/src/pages/index.tsx +++ b/packages/platform/examples/base/src/pages/index.tsx @@ -8,12 +8,12 @@ const poppins = Poppins({ subsets: ["latin"], weight: ["400", "800"] }); export default function Home(props: { calUsername: string; calEmail: string }) { return ( -
+
-
-

+ className={` h-[100vh] w-full items-center justify-center gap-y-3 font-mono lg:flex ${inter.className} gap-16 `}> +
+

The all in one Scheduling marketplace

@@ -21,12 +21,13 @@ export default function Home(props: { calUsername: string; calEmail: string }) {

-
+
cover image