Skip to content

Commit

Permalink
Remove pinned controls that do nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
robintown committed Dec 18, 2023
1 parent feabd12 commit 2d894b8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 45 deletions.
3 changes: 0 additions & 3 deletions public/locales/en-GB/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,10 @@
"unmute_microphone_button_label": "Unmute microphone",
"version": "Version: {{version}}",
"video_tile": {
"always_show": "Always show",
"exit_full_screen": "Exit full screen",
"full_screen": "Full screen",
"mute_for_me": "Mute for me",
"pin": "Pin",
"sfu_participant_local": "You",
"unpin": "Unpin",
"volume": "Volume"
},
"waiting_for_participants": "Waiting for other participants…"
Expand Down
10 changes: 0 additions & 10 deletions src/state/TileViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,6 @@ export class UserMediaTileViewModel extends BaseTileViewModel {
).pipe(map((p) => p.isSpeaking)),
);

private readonly _pinned = new BehaviorSubject(false);
/**
* Whether this tile is "pinned" to appear before other tiles in the layout.
*/
public readonly pinned = state(this._pinned);

private readonly _locallyMuted = new BehaviorSubject(false);
/**
* Whether we've disabled this participant's audio.
Expand Down Expand Up @@ -207,10 +201,6 @@ export class UserMediaTileViewModel extends BaseTileViewModel {
});
}

public togglePinned(): void {
this._pinned.next(!this._pinned.value);
}

public toggleLocallyMuted(): void {
this._locallyMuted.next(!this._locallyMuted.value);
}
Expand Down
32 changes: 0 additions & 32 deletions src/video-grid/VideoTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ import MicOffSolidIcon from "@vector-im/compound-design-tokens/icons/mic-off-sol
import ErrorIcon from "@vector-im/compound-design-tokens/icons/error.svg?react";
import MicOffOutlineIcon from "@vector-im/compound-design-tokens/icons/mic-off-outline.svg?react";
import OverflowHorizontalIcon from "@vector-im/compound-design-tokens/icons/overflow-horizontal.svg?react";
import PinOnIcon from "@vector-im/compound-design-tokens/icons/pin-on.svg?react";
import PinOffIcon from "@vector-im/compound-design-tokens/icons/pin-off.svg?react";
import VolumeOnIcon from "@vector-im/compound-design-tokens/icons/volume-on.svg?react";
import VolumeOffIcon from "@vector-im/compound-design-tokens/icons/volume-off.svg?react";
import VisibilityOnIcon from "@vector-im/compound-design-tokens/icons/visibility-on.svg?react";
import UserProfileIcon from "@vector-im/compound-design-tokens/icons/user-profile.svg?react";
import ExpandIcon from "@vector-im/compound-design-tokens/icons/expand.svg?react";
import CollapseIcon from "@vector-im/compound-design-tokens/icons/collapse.svg?react";
Expand Down Expand Up @@ -215,11 +212,8 @@ const UserMediaTile = subscribe<UserMediaTileProps, HTMLDivElement>(
const unencryptedWarning = useStateObservable(vm.unencryptedWarning);
const mirror = useStateObservable(vm.mirror);
const speaking = useStateObservable(vm.speaking);
const pinned = useStateObservable(vm.pinned);
const locallyMuted = useStateObservable(vm.locallyMuted);
const localVolume = useStateObservable(vm.localVolume);
const onChangePin = useCallback(() => vm.togglePinned(), [vm]);
const onSelectPin = useCallback(() => {}, []);
const onChangeMute = useCallback(() => vm.toggleLocallyMuted(), [vm]);
const onSelectMute = useCallback((e: Event) => e.preventDefault(), []);
const onChangeLocalVolume = useCallback(
Expand All @@ -228,19 +222,11 @@ const UserMediaTile = subscribe<UserMediaTileProps, HTMLDivElement>(
);

const MicIcon = audioEnabled ? MicOnSolidIcon : MicOffSolidIcon;
const PinIcon = pinned ? PinOnIcon : PinOffIcon;
const VolumeIcon = locallyMuted ? VolumeOffIcon : VolumeOnIcon;

const [menuOpen, setMenuOpen] = useState(false);
const menu = vm.local ? (
<>
<ToggleMenuItem
Icon={VisibilityOnIcon}
label={t("video_tile.always_show")}
checked={pinned}
onChange={onChangePin}
onSelect={onSelectPin}
/>
<MenuItem
Icon={UserProfileIcon}
label={t("common.profile")}
Expand All @@ -249,13 +235,6 @@ const UserMediaTile = subscribe<UserMediaTileProps, HTMLDivElement>(
</>
) : (
<>
<ToggleMenuItem
Icon={PinOffIcon}
label={t("video_tile.pin")}
checked={pinned}
onChange={onChangePin}
onSelect={onSelectPin}
/>
<ToggleMenuItem
Icon={MicOffOutlineIcon}
label={t("video_tile.mute_for_me")}
Expand Down Expand Up @@ -321,17 +300,6 @@ const UserMediaTile = subscribe<UserMediaTileProps, HTMLDivElement>(
{menu}
</Menu>
}
secondaryButton={
!vm.local && (
<button
aria-label={pinned ? t("video_tile.unpin") : t("video_tile.pin")}
onClick={onChangePin}
data-enabled={pinned}
>
<PinIcon aria-hidden width={20} height={20} />
</button>
)
}
/>
);

Expand Down

0 comments on commit 2d894b8

Please sign in to comment.