Skip to content

Commit

Permalink
Show raise hand status in call participant list
Browse files Browse the repository at this point in the history
  • Loading branch information
ayumi-signal committed Jan 17, 2024
1 parent 23e3883 commit 52d267f
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 51 deletions.
38 changes: 17 additions & 21 deletions stylesheets/_modules.scss
Expand Up @@ -4335,10 +4335,10 @@ button.module-image__border-overlay:focus {
@include font-body-1;
display: flex;
align-items: center;
justify-content: space-between;
margin-block: 2px;
padding-block: 5px;
padding-inline: 10px;
padding-block: 8px;
padding-inline-start: 10px;
padding-inline-end: 2px;
list-style-type: none;
border-radius: 6px;
&:hover {
Expand All @@ -4348,8 +4348,9 @@ button.module-image__border-overlay:focus {

&__avatar-and-name {
display: flex;
flex-grow: 1;
min-width: 0;
align-items: center;
max-width: 172px;
}

&__name {
Expand Down Expand Up @@ -4387,12 +4388,19 @@ button.module-image__border-overlay:focus {
}
}

&__status {
&__status-icon {
display: flex;
flex-basis: 64px;
flex-shrink: 0;
align-items: center;
justify-content: end;
flex: none;
margin-inline: 8px;
height: 16px;
width: 16px;
}

&__hand-raised {
@include color-svg(
'../images/icons/v3/raise_hand/raise_hand-light.svg',
$color-white
);
}

&__muted {
Expand All @@ -4401,21 +4409,13 @@ button.module-image__border-overlay:focus {
'../images/icons/v3/video/video-slash-compact-light.svg',
$color-white
);
display: inline-block;
margin-inline-start: 16px;
height: 16px;
width: 16px;
}

&--audio {
@include color-svg(
'../images/icons/v3/mic/mic-slash-compact-light.svg',
$color-white
);
display: inline-block;
margin-inline-start: 16px;
height: 16px;
width: 16px;
}
}

Expand All @@ -4424,10 +4424,6 @@ button.module-image__border-overlay:focus {
'../images/icons/v3/share_screen/share_screen-fill-light.svg',
$color-white
);
display: inline-block;
margin-inline-start: 16px;
height: 16px;
width: 16px;
}
}

Expand Down
7 changes: 2 additions & 5 deletions stylesheets/components/CallingRaisedHandsList.scss
Expand Up @@ -71,10 +71,6 @@
);
}

.CallingRaisedHandsList__AvatarAndName {
max-width: 205px;
}

.CallingRaisedHandsList__NameHandIcon {
display: inline-block;
$icon-size: 16px;
Expand All @@ -90,7 +86,8 @@

.CallingRaisedHandsList__LowerMyHandLink {
@include button-reset;
margin-inline-end: 24px;
display: flex;
margin-inline-end: 16px;
font-size: 13px;
font-weight: 500;
color: $color-ultramarine-pastel;
Expand Down
9 changes: 9 additions & 0 deletions ts/components/CallManager.tsx
Expand Up @@ -324,6 +324,14 @@ function ActiveCallManager({
);
}

let isHandRaised = false;
if (activeCall.callMode === CallMode.Group) {
const { raisedHands, localDemuxId } = activeCall;
if (localDemuxId) {
isHandRaised = raisedHands.has(localDemuxId);
}
}

const groupCallParticipantsForParticipantsList =
activeCall.callMode === CallMode.Group
? [
Expand All @@ -337,6 +345,7 @@ function ActiveCallManager({
...me,
hasRemoteAudio: hasLocalAudio,
hasRemoteVideo: hasLocalVideo,
isHandRaised,
presenting: Boolean(activeCall.presentingSource),
},
]
Expand Down
11 changes: 11 additions & 0 deletions ts/components/CallingParticipantsList.stories.tsx
Expand Up @@ -75,6 +75,7 @@ export function ManyParticipants(): JSX.Element {
}),
createParticipant({
hasRemoteAudio: true,
hasRemoteVideo: true,
presenting: true,
name: 'Rage Trunks',
title: 'Rage Trunks',
Expand All @@ -90,8 +91,18 @@ export function ManyParticipants(): JSX.Element {
title: 'Goku Black',
}),
createParticipant({
isHandRaised: true,
title: 'Supreme Kai Zamasu',
}),
createParticipant({
hasRemoteAudio: false,
hasRemoteVideo: true,
isHandRaised: true,
title: 'Chi Chi',
}),
createParticipant({
title: 'Someone With A Really Long Name',
}),
],
});
return <CallingParticipantsList {...props} />;
Expand Down
36 changes: 25 additions & 11 deletions ts/components/CallingParticipantsList.tsx
Expand Up @@ -6,6 +6,7 @@
import React, { useContext } from 'react';
import { createPortal } from 'react-dom';
import FocusTrap from 'focus-trap-react';
import classNames from 'classnames';

import { Avatar, AvatarSize } from './Avatar';
import { ContactName } from './conversation/ContactName';
Expand All @@ -20,6 +21,7 @@ import { ModalContainerContext } from './ModalHost';
type ParticipantType = ConversationType & {
hasRemoteAudio?: boolean;
hasRemoteVideo?: boolean;
isHandRaised?: boolean;
presenting?: boolean;
};

Expand Down Expand Up @@ -146,17 +148,29 @@ export const CallingParticipantsList = React.memo(
</>
)}
</div>
<div className="module-calling-participants-list__status">
{participant.hasRemoteVideo === false ? (
<span className="module-calling-participants-list__muted--video" />
) : null}
{participant.presenting ? (
<span className="module-calling-participants-list__presenting" />
) : null}
{participant.hasRemoteAudio === false ? (
<span className="module-calling-participants-list__muted--audio" />
) : null}
</div>
<span
className={classNames(
'module-calling-participants-list__status-icon',
participant.isHandRaised &&
'module-calling-participants-list__hand-raised'
)}
/>
<span
className={classNames(
'module-calling-participants-list__status-icon',
participant.presenting &&
'module-calling-participants-list__presenting',
!participant.hasRemoteVideo &&
'module-calling-participants-list__muted--video'
)}
/>
<span
className={classNames(
'module-calling-participants-list__status-icon',
!participant.hasRemoteAudio &&
'module-calling-participants-list__muted--audio'
)}
/>
</li>
)
)}
Expand Down
26 changes: 12 additions & 14 deletions ts/components/CallingRaisedHandsList.tsx
Expand Up @@ -114,20 +114,18 @@ export function CallingRaisedHandsList({
/>
)}
</div>
<div className="module-calling-participants-list__status">
{localHandRaised &&
ourServiceId &&
participant.serviceId === ourServiceId && (
<button
className="CallingRaisedHandsList__LowerMyHandLink"
type="button"
onClick={onLowerMyHand}
>
{i18n('icu:CallControls__RaiseHands--lower')}
</button>
)}
<div className="CallingRaisedHandsList__NameHandIcon" />
</div>
{localHandRaised &&
ourServiceId &&
participant.serviceId === ourServiceId && (
<button
className="CallingRaisedHandsList__LowerMyHandLink"
type="button"
onClick={onLowerMyHand}
>
{i18n('icu:CallControls__RaiseHands--lower')}
</button>
)}
<div className="module-calling-participants-list__status-icon CallingRaisedHandsList__NameHandIcon" />
</li>
))}
</ul>
Expand Down

0 comments on commit 52d267f

Please sign in to comment.