Move feedback button to overflow menu
To be consistent with normal view and avoid nested dialogs. Also disable space for the PTT key when the feedback dialog is visible, since otherwise you can't type a space. Involves some rearrangement of modal state. Remove accidentally comitted vite port config.
This commit is contained in:
@@ -21,9 +21,8 @@ import { GroupCall, MatrixClient, RoomMember } from "matrix-js-sdk";
|
||||
import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed";
|
||||
|
||||
import { useModalTriggerState } from "../Modal";
|
||||
import { SettingsModal } from "../settings/SettingsModal";
|
||||
import { InviteModal } from "./InviteModal";
|
||||
import { HangupButton, InviteButton, SettingsButton } from "../button";
|
||||
import { HangupButton, InviteButton } from "../button";
|
||||
import { Header, LeftNav, RightNav, RoomSetupHeaderInfo } from "../Header";
|
||||
import styles from "./PTTCallView.module.css";
|
||||
import { Facepile } from "../Facepile";
|
||||
@@ -38,7 +37,7 @@ import { ReactComponent as AudioIcon } from "../icons/Audio.svg";
|
||||
import { usePTTSounds } from "../sound/usePttSounds";
|
||||
import { PTTClips } from "../sound/PTTClips";
|
||||
import { GroupCallInspector } from "./GroupCallInspector";
|
||||
import { FeedbackModal } from "./FeedbackModal";
|
||||
import { OverflowMenu } from "./OverflowMenu";
|
||||
|
||||
function getPromptText(
|
||||
showTalkOverError: boolean,
|
||||
@@ -102,8 +101,6 @@ export const PTTCallView: React.FC<Props> = ({
|
||||
}) => {
|
||||
const { modalState: inviteModalState, modalProps: inviteModalProps } =
|
||||
useModalTriggerState();
|
||||
const { modalState: settingsModalState, modalProps: settingsModalProps } =
|
||||
useModalTriggerState();
|
||||
const { modalState: feedbackModalState, modalProps: feedbackModalProps } =
|
||||
useModalTriggerState();
|
||||
const [containerRef, bounds] = useMeasure({ polyfill: ResizeObserver });
|
||||
@@ -125,7 +122,13 @@ export const PTTCallView: React.FC<Props> = ({
|
||||
startTalking,
|
||||
stopTalking,
|
||||
transmitBlocked,
|
||||
} = usePTT(client, groupCall, userMediaFeeds, playClip);
|
||||
} = usePTT(
|
||||
client,
|
||||
groupCall,
|
||||
userMediaFeeds,
|
||||
playClip,
|
||||
!feedbackModalState.isOpen
|
||||
);
|
||||
|
||||
const showTalkOverError = pttButtonHeld && transmitBlocked;
|
||||
|
||||
@@ -179,7 +182,17 @@ export const PTTCallView: React.FC<Props> = ({
|
||||
/>
|
||||
</div>
|
||||
<div className={styles.footer}>
|
||||
<SettingsButton onPress={() => settingsModalState.open()} />
|
||||
<OverflowMenu
|
||||
inCall
|
||||
roomId={roomId}
|
||||
setShowInspector={setShowInspector}
|
||||
showInspector={showInspector}
|
||||
client={client}
|
||||
groupCall={groupCall}
|
||||
showInvite={false}
|
||||
feedbackModalState={feedbackModalState}
|
||||
feedbackModalProps={feedbackModalProps}
|
||||
/>
|
||||
<HangupButton onPress={onLeave} />
|
||||
<InviteButton onPress={() => inviteModalState.open()} />
|
||||
</div>
|
||||
@@ -238,21 +251,6 @@ export const PTTCallView: React.FC<Props> = ({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{settingsModalState.isOpen && (
|
||||
<SettingsModal
|
||||
{...settingsModalProps}
|
||||
setShowInspector={setShowInspector}
|
||||
showInspector={showInspector}
|
||||
showFeedbackDialog={feedbackModalState.open}
|
||||
/>
|
||||
)}
|
||||
{feedbackModalState.isOpen && (
|
||||
<FeedbackModal
|
||||
{...feedbackModalProps}
|
||||
roomId={groupCall?.room.roomId}
|
||||
inCall
|
||||
/>
|
||||
)}
|
||||
{inviteModalState.isOpen && (
|
||||
<InviteModal roomId={roomId} {...inviteModalProps} />
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user