diff --git a/packages/react-sdk/src/components/Button/CompositeButton.tsx b/packages/react-sdk/src/components/Button/CompositeButton.tsx index 9940828587..2e3f5fe9c3 100644 --- a/packages/react-sdk/src/components/Button/CompositeButton.tsx +++ b/packages/react-sdk/src/components/Button/CompositeButton.tsx @@ -11,8 +11,10 @@ export type IconButtonWithMenuProps = PropsWithChildren<{ active?: boolean; Menu?: ComponentType | JSX.Element; caption?: string; + className?: string; menuPlacement?: Placement; ToggleMenuButton?: any; + title?: string; variant?: 'primary' | 'secondary'; }>; @@ -24,9 +26,11 @@ export const CompositeButton = forwardRef< { caption, children, + className, active, Menu, menuPlacement, + title, ToggleMenuButton = DefaultToggleMenuButton, variant, }, @@ -34,9 +38,10 @@ export const CompositeButton = forwardRef< ) => { return (
{
- + void; }; -export const ParticipantsPreview = ({ onJoin }: Props) => { +const ParticipantsPreview = ({ onJoin }: Props) => { const { useCallSession, useCallThumbnail } = useCallStateHooks(); const session = useCallSession(); const { t } = useI18n(); @@ -33,7 +33,7 @@ export const ParticipantsPreview = ({ onJoin }: Props) => { {thumbnail && }

- {`${first.user.name} ${session.participants.length - 1} other${ + {`${first.user.name} and ${session.participants.length - 1} other${ session.participants.length - 1 > 1 ? 's' : '' } are in this call.`}

@@ -50,18 +50,29 @@ export const ParticipantsPreview = ({ onJoin }: Props) => { ); }; -export const ToggleMenuButton = forwardRef< - HTMLDivElement, - ToggleMenuButtonProps ->((props, ref) => { - return ( - - - - ); -}); +const ToggleMenuButton = forwardRef( + (props, ref) => { + const { useCallSession } = useCallStateHooks(); + const session = useCallSession(); + const total = session?.participants?.length || 0; + return ( + + + {total > 0 && ( + {total} + )} + + ); + }, +); -export const ToggleParticipansPreviewButton = ({ onJoin }: Props) => { +export const ToggleParticipantsPreviewButton = ({ onJoin }: Props) => { const { useCallSession } = useCallStateHooks(); const session = useCallSession(); diff --git a/sample-apps/react/react-dogfood/style/ToggleParticipantsPreview/ToggleParticipantsPreview.scss b/sample-apps/react/react-dogfood/style/ToggleParticipantsPreview/ToggleParticipantsPreview.scss index 40a8485338..2fe8f6a651 100644 --- a/sample-apps/react/react-dogfood/style/ToggleParticipantsPreview/ToggleParticipantsPreview.scss +++ b/sample-apps/react/react-dogfood/style/ToggleParticipantsPreview/ToggleParticipantsPreview.scss @@ -11,6 +11,27 @@ box-shadow: 0px 14px 34px rgba(0, 0, 0, 0.75); } + &__participants-preview__button { + position: relative; + } + + &__participants-preview__count { + font-size: 10px; + display: flex; + align-items: center; + justify-content: center; + border-radius: var(--str-video__border-radius-circle); + position: absolute; + + top: 0; + background: var(--str-video__brand-color3); + color: var(--str-video__base-color4); + padding: 5px; + height: 16px; + width: 16px; + margin-left: 20px; + } + &__participants-preview__heading { font-size: 20px; font-weight: 500;