1
1
// Get router variables
2
2
import { EventType } from "@prisma/client" ;
3
+ import { SchedulingType } from "@prisma/client" ;
3
4
import * as Collapsible from "@radix-ui/react-collapsible" ;
4
5
import { TFunction } from "next-i18next" ;
5
6
import { useRouter } from "next/router" ;
@@ -18,7 +19,7 @@ import {
18
19
import { useContracts } from "@calcom/features/ee/web3/contexts/contractsContext" ;
19
20
import CustomBranding from "@calcom/lib/CustomBranding" ;
20
21
import classNames from "@calcom/lib/classNames" ;
21
- import { CAL_URL , WEBSITE_URL } from "@calcom/lib/constants" ;
22
+ import { WEBSITE_URL } from "@calcom/lib/constants" ;
22
23
import { useLocale } from "@calcom/lib/hooks/useLocale" ;
23
24
import useTheme from "@calcom/lib/hooks/useTheme" ;
24
25
import notEmpty from "@calcom/lib/notEmpty" ;
@@ -37,9 +38,9 @@ import { isBrandingHidden } from "@lib/isBrandingHidden";
37
38
38
39
import AvailableTimes from "@components/booking/AvailableTimes" ;
39
40
import TimeOptions from "@components/booking/TimeOptions" ;
41
+ import { UserAvatars } from "@components/booking/UserAvatars" ;
40
42
import EventTypeDescriptionSafeHTML from "@components/eventtype/EventTypeDescriptionSafeHTML" ;
41
43
import { HeadSeo } from "@components/seo/head-seo" ;
42
- import AvatarGroup from "@components/ui/AvatarGroup" ;
43
44
import PoweredByCal from "@components/ui/PoweredByCal" ;
44
45
45
46
import type { AvailabilityPageProps } from "../../../pages/[user]/[type]" ;
@@ -235,8 +236,6 @@ const SlotPicker = ({
235
236
eventTypeSlug = { eventType . slug }
236
237
seatsPerTimeSlot = { seatsPerTimeSlot }
237
238
recurringCount = { recurringEventCount }
238
- schedulingType = { eventType . schedulingType }
239
- users = { [ ] }
240
239
/>
241
240
) }
242
241
</ >
@@ -425,20 +424,10 @@ const AvailabilityPage = ({ profile, eventType }: Props) => {
425
424
{ /* mobile: details */ }
426
425
< div className = "block px-4 pt-4 sm:p-8 md:hidden" >
427
426
< div >
428
- < AvatarGroup
429
- border = "border-2 dark:border-gray-800 border-white"
430
- items = {
431
- [
432
- { image : profile . image , alt : profile . name , title : profile . name } ,
433
- ...eventType . users
434
- . filter ( ( user ) => user . name !== profile . name )
435
- . map ( ( user ) => ( {
436
- title : user . name ,
437
- image : `${ CAL_URL } /${ user . username } /avatar.png` ,
438
- alt : user . name || undefined ,
439
- } ) ) ,
440
- ] . filter ( ( item ) => ! ! item . image ) as { image : string ; alt ?: string ; title ?: string } [ ]
441
- }
427
+ < UserAvatars
428
+ profile = { profile }
429
+ users = { eventType . users }
430
+ showMembers = { eventType . schedulingType !== SchedulingType . ROUND_ROBIN }
442
431
size = { 9 }
443
432
truncateAfter = { 5 }
444
433
/>
@@ -566,20 +555,10 @@ const AvailabilityPage = ({ profile, eventType }: Props) => {
566
555
"hidden overflow-hidden border-gray-200 p-5 sm:border-r sm:dark:border-gray-700 md:flex md:flex-col " +
567
556
( isAvailableTimesVisible ? "sm:w-1/3" : recurringEventCount ? "sm:w-2/3" : "sm:w-1/2" )
568
557
} >
569
- < AvatarGroup
570
- border = "border-2 dark:border-gray-800 border-white"
571
- items = {
572
- [
573
- { image : profile . image , alt : profile . name , title : profile . name } ,
574
- ...eventType . users
575
- . filter ( ( user ) => user . name !== profile . name )
576
- . map ( ( user ) => ( {
577
- title : user . name ,
578
- alt : user . name ,
579
- image : `${ CAL_URL } /${ user . username } /avatar.png` ,
580
- } ) ) ,
581
- ] . filter ( ( item ) => ! ! item . image ) as { image : string ; alt ?: string ; title ?: string } [ ]
582
- }
558
+ < UserAvatars
559
+ profile = { profile }
560
+ users = { eventType . users }
561
+ showMembers = { eventType . schedulingType !== SchedulingType . ROUND_ROBIN }
583
562
size = { 10 }
584
563
truncateAfter = { 3 }
585
564
/>
0 commit comments