diff --git a/src/button/ReactionToggleButton.tsx b/src/button/ReactionToggleButton.tsx index 583a1cd2..984d2f4c 100644 --- a/src/button/ReactionToggleButton.tsx +++ b/src/button/ReactionToggleButton.tsx @@ -211,7 +211,7 @@ export function ReactionPopupMenu({ ); } -interface ReactionToggleButtonProps { +interface ReactionToggleButtonProps extends ComponentPropsWithoutRef<"button"> { rtcSession: MatrixRTCSession; client: MatrixClient; } @@ -219,6 +219,7 @@ interface ReactionToggleButtonProps { export function ReactionToggleButton({ client, rtcSession, + ...props }: ReactionToggleButtonProps): ReactNode { const { t } = useTranslation(); const { raisedHands, lowerHand, reactions } = useReactions(); @@ -327,6 +328,7 @@ export function ReactionToggleButton({ onClick={() => setShowReactionsMenu((show) => !show)} raised={isHandRaised} open={showReactionsMenu} + {...props} /> = ({ const containerRef1 = useRef(null); const [containerRef2, bounds] = useMeasure(); - const boundsValid = bounds.height > 0; // Merge the refs so they can attach to the same element const containerRef = useMergedRefs(containerRef1, containerRef2); @@ -241,10 +240,6 @@ export const InCallView: FC = ({ (muted) => muteStates.audio.setEnabled?.(!muted), ); - const mobile = boundsValid && bounds.width <= 660; - const reducedControls = boundsValid && bounds.width <= 340; - const noControls = reducedControls && bounds.height <= 400; - const windowMode = useObservableEagerState(vm.windowMode); const layout = useObservableEagerState(vm.layout); const gridMode = useObservableEagerState(vm.gridMode); @@ -526,95 +521,94 @@ export const InCallView: FC = ({ .catch(logger.error); }, [localParticipant, isScreenShareEnabled]); - let footer: JSX.Element | null; - - if (noControls) { - footer = null; - } else { - const buttons: JSX.Element[] = []; + const buttons: JSX.Element[] = []; + buttons.push( + , + , + ); + if (switchCamera !== null) buttons.push( - , - , ); - if (!reducedControls) { - if (switchCamera !== null) - buttons.push( - , - ); - if (canScreenshare && !hideScreensharing) { - buttons.push( - , - ); - } - if (supportsReactions) { - buttons.push( - , - ); - } - buttons.push(); - } - + if (canScreenshare && !hideScreensharing) { buttons.push( - , ); - footer = ( -
- {!mobile && !hideHeader && ( -
- - -
- )} - {showControls &&
{buttons}
} - {!mobile && showControls && ( - - )} -
- ); } + if (supportsReactions) { + buttons.push( + , + ); + } + if (layout.type !== "pip") + buttons.push(); + + buttons.push( + , + ); + const footer = ( +
+ {!hideHeader && ( +
+ + +
+ )} + {showControls &&
{buttons}
} + {showControls && ( + + )} +
+ ); return (
= ({ /> - {!reducedControls && showControls && onShareClick !== null && ( - + {showControls && onShareClick !== null && ( + )} @@ -669,15 +666,19 @@ export const InCallView: FC = ({ ))} {footer} - {!noControls && } - + {layout.type !== "pip" && ( + <> + + + + )}
); };