@@ -148,7 +148,7 @@ type SuccessProps = inferSSRProps<typeof getServerSideProps>;
148
148
export default function Success ( props : SuccessProps ) {
149
149
const { t } = useLocale ( ) ;
150
150
const router = useRouter ( ) ;
151
- const { location : _location , name, reschedule, status } = router . query ;
151
+ const { location : _location , name, reschedule, listingStatus , status } = router . query ;
152
152
const location = Array . isArray ( _location ) ? _location [ 0 ] : _location ;
153
153
const [ is24h , setIs24h ] = useState ( isBrowserLocale24h ( ) ) ;
154
154
const { data : session } = useSession ( ) ;
@@ -176,6 +176,7 @@ export default function Success(props: SuccessProps) {
176
176
177
177
const eventName = getEventName ( eventNameObject ) ;
178
178
const needsConfirmation = eventType . requiresConfirmation && reschedule != "true" ;
179
+ const isCancelled = status === "CANCELLED" || status === "REJECTED" ;
179
180
const telemetry = useTelemetry ( ) ;
180
181
useEffect ( ( ) => {
181
182
telemetry . withJitsu ( ( jitsu ) =>
@@ -238,6 +239,9 @@ export default function Success(props: SuccessProps) {
238
239
239
240
function getTitle ( ) : string {
240
241
const titleSuffix = props . recurringBookings ? "_recurring" : "" ;
242
+ if ( isCancelled ) {
243
+ return t ( "emailed_information_about_cancelled_event" ) ;
244
+ }
241
245
if ( needsConfirmation ) {
242
246
if ( props . profile . name !== null ) {
243
247
return t ( "user_needs_to_confirm_or_reject_booking" + titleSuffix , {
@@ -298,25 +302,31 @@ export default function Success(props: SuccessProps) {
298
302
< div
299
303
className = { classNames (
300
304
"mx-auto flex items-center justify-center" ,
301
- ! giphyImage ? "h-12 w-12 rounded-full bg-green-100" : ""
305
+ ! giphyImage && ! isCancelled ? "h-12 w-12 rounded-full bg-green-100" : "" ,
306
+ isCancelled ? "h-12 w-12 rounded-full bg-red-100" : ""
302
307
) } >
303
308
{ giphyImage && ! needsConfirmation && (
304
309
// eslint-disable-next-line @next/next/no-img-element
305
310
< img src = { giphyImage } alt = { "Gif from Giphy" } />
306
311
) }
307
- { ! giphyImage && ! needsConfirmation && (
312
+ { ! giphyImage && ! needsConfirmation && ! isCancelled && (
308
313
< CheckIcon className = "h-8 w-8 text-green-600" />
309
314
) }
310
- { needsConfirmation && < ClockIcon className = "h-8 w-8 text-green-600" /> }
315
+ { needsConfirmation && ! isCancelled && (
316
+ < ClockIcon className = "h-8 w-8 text-green-600" />
317
+ ) }
318
+ { isCancelled && < XIcon className = "h-8 w-8 text-red-600" /> }
311
319
</ div >
312
320
< div className = "mt-3 text-center sm:mt-5" >
313
321
< h3
314
322
className = "text-2xl font-semibold leading-6 text-neutral-900 dark:text-white"
315
323
id = "modal-headline" >
316
- { needsConfirmation
324
+ { needsConfirmation && ! isCancelled
317
325
? props . recurringBookings
318
326
? t ( "submitted_recurring" )
319
327
: t ( "submitted" )
328
+ : isCancelled
329
+ ? t ( "event_cancelled" )
320
330
: props . recurringBookings
321
331
? t ( "meeting_is_scheduled_recurring" )
322
332
: t ( "meeting_is_scheduled" ) }
@@ -333,32 +343,36 @@ export default function Success(props: SuccessProps) {
333
343
isReschedule = { reschedule === "true" }
334
344
eventType = { props . eventType }
335
345
recurringBookings = { props . recurringBookings }
336
- status = { ( status as string ) || "upcoming" }
346
+ listingStatus = { ( listingStatus as string ) || "upcoming" }
337
347
date = { date }
338
348
is24h = { is24h }
339
349
/>
340
350
</ div >
341
- < div className = "font-medium" > { t ( "who" ) } </ div >
342
- < div className = "col-span-2 mb-6" >
343
- { bookingInfo ?. user && (
344
- < div className = "mb-3" >
345
- < p > { bookingInfo . user . name } </ p >
346
- < p className = "text-bookinglight" > { bookingInfo . user . email } </ p >
347
- </ div >
348
- ) }
349
- { bookingInfo ?. attendees . map ( ( attendee , index ) => (
350
- < div
351
- key = { attendee . name }
352
- className = { index === bookingInfo . attendees . length - 1 ? "" : "mb-3" } >
353
- < p > { attendee . name } </ p >
354
- < p className = "text-bookinglight" > { attendee . email } </ p >
351
+ { ( bookingInfo ?. user || bookingInfo ?. attendees ) && (
352
+ < >
353
+ < div className = "font-medium" > { t ( "who" ) } </ div >
354
+ < div className = "col-span-2 mb-6" >
355
+ { bookingInfo ?. user && (
356
+ < div className = "mb-3" >
357
+ < p > { bookingInfo . user . name } </ p >
358
+ < p className = "text-bookinglight" > { bookingInfo . user . email } </ p >
359
+ </ div >
360
+ ) }
361
+ { bookingInfo ?. attendees . map ( ( attendee , index ) => (
362
+ < div
363
+ key = { attendee . name }
364
+ className = { index === bookingInfo . attendees . length - 1 ? "" : "mb-3" } >
365
+ < p > { attendee . name } </ p >
366
+ < p className = "text-bookinglight" > { attendee . email } </ p >
367
+ </ div >
368
+ ) ) }
355
369
</ div >
356
- ) ) }
357
- </ div >
370
+ </ >
371
+ ) }
358
372
{ location && (
359
373
< >
360
- < div className = "mt-6 font-medium" > { t ( "where" ) } </ div >
361
- < div className = "col-span-2 mt-6 " >
374
+ < div className = "mt-3 font-medium" > { t ( "where" ) } </ div >
375
+ < div className = "col-span-2 mt-3 " >
362
376
{ location . startsWith ( "http" ) ? (
363
377
< a title = "Meeting Link" href = { location } >
364
378
{ location }
@@ -401,6 +415,7 @@ export default function Success(props: SuccessProps) {
401
415
</ div >
402
416
</ div >
403
417
{ ! needsConfirmation &&
418
+ ! isCancelled &&
404
419
( ! isCancellationMode ? (
405
420
< div className = "border-bookinglightest text-bookingdark mt-2 grid grid-cols-3 border-b py-4 text-left dark:border-gray-900" >
406
421
< span className = "flex self-center font-medium text-gray-700 ltr:mr-2 rtl:ml-2 dark:text-gray-50" >
@@ -425,7 +440,7 @@ export default function Success(props: SuccessProps) {
425
440
theme = { userIsOwner ? "light" : props . profile . theme }
426
441
/>
427
442
) ) }
428
- { userIsOwner && ! needsConfirmation && ! isCancellationMode && (
443
+ { userIsOwner && ! needsConfirmation && ! isCancellationMode && ! isCancelled && (
429
444
< div className = "border-bookinglightest mt-9 flex border-b pt-2 pb-4 text-center dark:border-gray-900 sm:mt-0 sm:pt-4" >
430
445
< span className = "flex self-center font-medium text-gray-700 ltr:mr-2 rtl:ml-2 dark:text-gray-50" >
431
446
{ t ( "add_to_calendar" ) }
@@ -591,19 +606,19 @@ type RecurringBookingsProps = {
591
606
recurringBookings : SuccessProps [ "recurringBookings" ] ;
592
607
date : dayjs . Dayjs ;
593
608
is24h : boolean ;
594
- status : string ;
609
+ listingStatus : string ;
595
610
} ;
596
611
597
612
function RecurringBookings ( {
598
613
isReschedule = false ,
599
614
eventType,
600
615
recurringBookings,
601
616
date,
602
- status ,
617
+ listingStatus ,
603
618
} : RecurringBookingsProps ) {
604
619
const [ moreEventsVisible , setMoreEventsVisible ] = useState ( false ) ;
605
620
const { t } = useLocale ( ) ;
606
- return ! isReschedule && recurringBookings && status === "upcoming" ? (
621
+ return ! isReschedule && recurringBookings && listingStatus === "upcoming" ? (
607
622
< >
608
623
{ eventType . recurringEvent ?. count &&
609
624
recurringBookings . slice ( 0 , 4 ) . map ( ( dateStr , idx ) => (
0 commit comments