feat(tileView): Display 3 participants in 1 row

This commit is contained in:
Hristo Terezov 2022-01-26 16:52:47 -06:00
parent eb70c611c2
commit 8cb1e1e233
1 changed files with 5 additions and 1 deletions

View File

@ -109,8 +109,12 @@ export function getTileViewGridDimensions(state: Object) {
const numberOfParticipants = getParticipantCountWithFake(state)
- (iAmRecorder ? 1 : 0)
- (disableSelfView ? 1 : 0);
const isWeb = navigator.product !== 'ReactNative';
const columnsToMaintainASquare = Math.ceil(Math.sqrt(numberOfParticipants));
// When there are 3 participants in the call we want them to be placed on a single row unless the maxColumn setting
// is lower.
const columnsToMaintainASquare
= isWeb && numberOfParticipants === 3 ? 3 : Math.ceil(Math.sqrt(numberOfParticipants));
const columns = Math.min(columnsToMaintainASquare, maxColumns);
const rows = Math.ceil(numberOfParticipants / columns);
const minVisibleRows = Math.min(maxColumns, rows);