Skip to content

Commit

Permalink
feat: disable zoom feature for screen share [WPB-14947] (#18475)
Browse files Browse the repository at this point in the history
* feat: enable conference feature check

* feat: remove zoom icons
  • Loading branch information
EnricoSchw authored Dec 11, 2024
1 parent 888e5ac commit d1a063c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
25 changes: 2 additions & 23 deletions src/script/components/calling/GroupVideoGridTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
*/

import React, {useState} from 'react';
import React from 'react';

import {QualifiedId} from '@wireapp/api-client/lib/user';
import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums';
Expand Down Expand Up @@ -89,8 +89,6 @@ const GroupVideoGridTile: React.FC<GroupVideoGridTileProps> = ({
'isSwitchingVideoResolution',
]);

const [isZoomedIn, setIsZoomedIn] = useState(false);

const {name} = useKoSubscribableChildren(participant?.user, ['name']);

const sharesScreen = videoState === VIDEO_STATE.SCREENSHARE;
Expand All @@ -108,24 +106,8 @@ const GroupVideoGridTile: React.FC<GroupVideoGridTileProps> = ({
}
};

const handleZoomClick = () => {
setIsZoomedIn(prev => !prev);
};

const participantNameColor = getParticipantNameColor({isActivelySpeaking, isAudioEstablished});

const actionItem = !minimized && sharesScreen && (
<button
data-uie-name="item-grid"
data-user-id={participant?.user.id}
className="group-video-grid__element__action_icon"
onClick={handleZoomClick}
>
{!isZoomedIn && <Icon.ZoomInIcon data-uie-name="zoom-in-icon" />}
{isZoomedIn && <Icon.ZoomOutIcon data-uie-name="zoom-out-icon" />}
</button>
);

const nameContainer = !minimized && (
<div
className="group-video-grid__element__label"
Expand Down Expand Up @@ -179,7 +161,7 @@ const GroupVideoGridTile: React.FC<GroupVideoGridTileProps> = ({
tabIndex={isMaximized ? TabIndex.FOCUSABLE : TabIndex.UNFOCUSABLE}
>
{hasActiveVideo ? (
<div className="tile-wrapper" css={{overflow: isZoomedIn ? 'auto' : 'unset', zIndex: isZoomedIn ? 1 : 'unset'}}>
<div className="tile-wrapper">
<Video
autoPlay
playsInline
Expand All @@ -193,7 +175,6 @@ const GroupVideoGridTile: React.FC<GroupVideoGridTileProps> = ({
css={{
objectFit: isMaximized || sharesScreen ? 'contain' : 'cover',
transform: participant === selfParticipant && sharesCamera ? 'rotateY(180deg)' : 'initial',
height: isZoomedIn ? 'unset' : '100%',
}}
/>
</div>
Expand Down Expand Up @@ -250,8 +231,6 @@ const GroupVideoGridTile: React.FC<GroupVideoGridTileProps> = ({
</div>
)}

{actionItem}

{nameContainer}

{(hasPausedVideo || isSwitchingVideoResolution) && (
Expand Down
4 changes: 3 additions & 1 deletion src/script/team/TeamState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ export class TeamState {
() => this.teamFeatures()?.mls?.config.protocolToggleUsers.includes(this.userState.self().id) ?? false,
);

this.isConferenceCallingEnabled = ko.pureComputed(() => true);
this.isConferenceCallingEnabled = ko.pureComputed(
() => this.teamFeatures()?.conferenceCalling?.status === FeatureStatus.ENABLED,
);

this.isGuestLinkEnabled = ko.pureComputed(
() => this.teamFeatures()?.conversationGuestLinks?.status === FeatureStatus.ENABLED,
Expand Down

0 comments on commit d1a063c

Please sign in to comment.