diff --git a/src/button/RaisedHandToggleButton.tsx b/src/button/RaisedHandToggleButton.tsx index 42006f6a..bc62163a 100644 --- a/src/button/RaisedHandToggleButton.tsx +++ b/src/button/RaisedHandToggleButton.tsx @@ -53,7 +53,8 @@ const InnerButton: FC = ({ raised, ...props }) => { ); }; -interface RaisedHandToggleButtonProps { +interface RaisedHandToggleButtonProps + extends ComponentPropsWithoutRef<"button"> { rtcSession: MatrixRTCSession; client: MatrixClient; } @@ -61,6 +62,7 @@ interface RaisedHandToggleButtonProps { export function RaiseHandToggleButton({ client, rtcSession, + ...props }: RaisedHandToggleButtonProps): ReactNode { const { raisedHands, lowerHand } = useReactions(); const [busy, setBusy] = useState(false); @@ -121,6 +123,7 @@ export function RaiseHandToggleButton({ disabled={busy} onClick={toggleRaisedHand} raised={isHandRaised} + {...props} /> ); } diff --git a/src/room/InCallView.module.css b/src/room/InCallView.module.css index 14e58be7..fdd37537 100644 --- a/src/room/InCallView.module.css +++ b/src/room/InCallView.module.css @@ -36,12 +36,14 @@ Please see LICENSE in the repository root for full details. inset-block-end: 0; z-index: 1; display: grid; - grid-template-columns: 1fr auto 1fr; - grid-template-areas: "logo buttons layout"; + grid-template-columns: minmax(0, var(--inline-content-inset)) 1fr auto 1fr minmax( + 0, + var(--inline-content-inset) + ); + grid-template-areas: ". logo buttons layout ."; align-items: center; gap: var(--cpd-space-3x); - padding-block: var(--cpd-space-4x); - padding-inline: var(--inline-content-inset); + padding-block: var(--cpd-space-10x); background: linear-gradient( 180deg, rgba(0, 0, 0, 0) 0%, @@ -83,6 +85,7 @@ Please see LICENSE in the repository root for full details. .buttons { grid-area: buttons; + justify-self: center; display: flex; gap: var(--cpd-space-3x); } @@ -92,15 +95,49 @@ Please see LICENSE in the repository root for full details. justify-self: end; } -@media (min-height: 400px) { +@media (max-width: 660px) { .footer { - padding-block: var(--cpd-space-8x); + grid-template-areas: ". buttons buttons buttons ."; + } + + .logo { + display: none; + } + + .layout { + display: none !important; } } -@media (min-height: 800px) { +@media (max-width: 370px) { + .raiseHand { + display: none; + } +} + +@media (max-width: 340px) { + .invite, + .switchCamera, + .shareScreen { + display: none; + } + + @media (max-height: 400px) { + .footer { + display: none; + } + } +} + +@media (max-height: 400px) { .footer { - padding-block: var(--cpd-space-10x); + padding-block: var(--cpd-space-4x); + } +} + +@media (max-height: 800px) { + .footer { + padding-block: var(--cpd-space-8x); } } diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index bad58be3..93103997 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -198,7 +198,6 @@ export const InCallView: FC = ({ 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); @@ -226,10 +225,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); @@ -511,95 +506,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 && ( + )} @@ -644,15 +641,19 @@ export const InCallView: FC = ({ {footer} - {!noControls && } - + {layout.type !== "pip" && ( + <> + + + + )}
); };