diff --git a/src/Room.jsx b/src/Room.jsx index 60ccd20d..e935841e 100644 --- a/src/Room.jsx +++ b/src/Room.jsx @@ -335,6 +335,31 @@ function InRoomView({ return participants; }, [userMediaFeeds, activeSpeaker, screenshareFeeds]); + const onFocusTile = useCallback( + (tiles, focusedTile) => { + if (layout === "gallery") { + return tiles.map((tile) => { + if (tile === focusedTile) { + return { ...tile, presenter: !tile.presenter }; + } + + return tile; + }); + } else { + toggleLayout(); + + return tiles.map((tile) => { + if (tile === focusedTile) { + return { ...tile, presenter: true }; + } + + return { ...tile, presenter: false }; + }); + } + }, + [layout, toggleLayout] + ); + return ( <>
@@ -355,7 +380,7 @@ function InRoomView({

Waiting for other participants...

) : ( - + )}