mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-05 19:59:20 +00:00
move appBar hook to InCallView
This commit is contained in:
@@ -27,7 +27,6 @@ import {
|
|||||||
type CallViewModel,
|
type CallViewModel,
|
||||||
type GridMode,
|
type GridMode,
|
||||||
} from "../state/CallViewModel/CallViewModel";
|
} from "../state/CallViewModel/CallViewModel";
|
||||||
import { useAppBarSecondaryButton } from "../AppBar";
|
|
||||||
|
|
||||||
export interface AudioOutputSwitcher {
|
export interface AudioOutputSwitcher {
|
||||||
targetOutput: string;
|
targetOutput: string;
|
||||||
@@ -185,10 +184,6 @@ export const CallFooter: FC<FooterProps> = ({
|
|||||||
|
|
||||||
if (audioOutputButton) buttons.push(audioOutputButton);
|
if (audioOutputButton) buttons.push(audioOutputButton);
|
||||||
|
|
||||||
useAppBarSecondaryButton(
|
|
||||||
<SettingsIconButton key="settings" onClick={openSettings} />,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (hangup)
|
if (hangup)
|
||||||
buttons.push(
|
buttons.push(
|
||||||
<EndCallButton
|
<EndCallButton
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ import { LivekitRoomAudioRenderer } from "../livekit/MatrixAudioRenderer.tsx";
|
|||||||
import { muteAllAudio$ } from "../state/MuteAllAudioModel.ts";
|
import { muteAllAudio$ } from "../state/MuteAllAudioModel.ts";
|
||||||
import { useMediaDevices } from "../MediaDevicesContext.ts";
|
import { useMediaDevices } from "../MediaDevicesContext.ts";
|
||||||
import { EarpieceOverlay } from "./EarpieceOverlay.tsx";
|
import { EarpieceOverlay } from "./EarpieceOverlay.tsx";
|
||||||
import { useAppBarHidden } from "../AppBar.tsx";
|
import { useAppBarHidden, useAppBarSecondaryButton } from "../AppBar.tsx";
|
||||||
import { useBehavior } from "../useBehavior.ts";
|
import { useBehavior } from "../useBehavior.ts";
|
||||||
import { Toast } from "../Toast.tsx";
|
import { Toast } from "../Toast.tsx";
|
||||||
import overlayStyles from "../Overlay.module.css";
|
import overlayStyles from "../Overlay.module.css";
|
||||||
@@ -91,6 +91,7 @@ import { type Layout } from "../state/layout-types.ts";
|
|||||||
import { ObservableScope } from "../state/ObservableScope.ts";
|
import { ObservableScope } from "../state/ObservableScope.ts";
|
||||||
import { useLatest } from "../useLatest.ts";
|
import { useLatest } from "../useLatest.ts";
|
||||||
import { CallFooter } from "../components/CallFooter.tsx";
|
import { CallFooter } from "../components/CallFooter.tsx";
|
||||||
|
import { SettingsIconButton } from "../button/Button.tsx";
|
||||||
|
|
||||||
const logger = rootLogger.getChild("[InCallView]");
|
const logger = rootLogger.getChild("[InCallView]");
|
||||||
|
|
||||||
@@ -562,8 +563,13 @@ export const InCallView: FC<InCallViewProps> = ({
|
|||||||
matrixRoom.roomId,
|
matrixRoom.roomId,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const settingsButtonInAppBar =
|
||||||
|
headerStyle === HeaderStyle.AppBar && showHeader;
|
||||||
|
useAppBarSecondaryButton(
|
||||||
|
<SettingsIconButton key="settings" onClick={openSettings} />,
|
||||||
|
);
|
||||||
|
|
||||||
// Only hide the settings button if we have an AppBar header and we are showing the header
|
// Only hide the settings button if we have an AppBar header and we are showing the header
|
||||||
const hideSettings = headerStyle === HeaderStyle.AppBar && showHeader;
|
|
||||||
const footer = (
|
const footer = (
|
||||||
<CallFooter
|
<CallFooter
|
||||||
ref={footerRef}
|
ref={footerRef}
|
||||||
@@ -584,7 +590,9 @@ export const InCallView: FC<InCallViewProps> = ({
|
|||||||
reactionIdentifier={`${client.getUserId()}:${client.getDeviceId()}`}
|
reactionIdentifier={`${client.getUserId()}:${client.getDeviceId()}`}
|
||||||
reactionData={supportsReactions ? vm : undefined}
|
reactionData={supportsReactions ? vm : undefined}
|
||||||
audioOutputSwitcher={audioOutputSwitcher ?? undefined}
|
audioOutputSwitcher={audioOutputSwitcher ?? undefined}
|
||||||
openSettings={hideSettings ? undefined : openSettings}
|
// Only pass the openSettings function if the settings button is not in the app bar.
|
||||||
|
// If there is no fn the button will be hidden in the footer.
|
||||||
|
openSettings={settingsButtonInAppBar ? undefined : openSettings}
|
||||||
hangup={vm.hangup}
|
hangup={vm.hangup}
|
||||||
//Debug props
|
//Debug props
|
||||||
debugTileLayout={debugTileLayout}
|
debugTileLayout={debugTileLayout}
|
||||||
|
|||||||
Reference in New Issue
Block a user