chore(tileview) Add config for disabling tileview (#13692)

- show fixed number of toolbar buttons in toolbar (including custom buttons) instead of sending to overflow menu
This commit is contained in:
Horatiu Muresan
2023-08-10 16:31:32 +03:00
committed by GitHub
parent 91de33550d
commit 5345a77092
7 changed files with 34 additions and 10 deletions

View File

@@ -290,7 +290,7 @@ const Toolbox = ({
setButtonsNotifyClickMode(buttons);
const isHangupVisible = isToolbarButtonEnabled('hangup', _toolbarButtons);
let { order } = THRESHOLDS.find(({ width }) => _clientWidth > width)
const { order } = THRESHOLDS.find(({ width }) => _clientWidth > width)
|| THRESHOLDS[THRESHOLDS.length - 1];
const keys = Object.keys(buttons);
@@ -302,11 +302,8 @@ const Toolbox = ({
!_jwtDisabledButtons.includes(key)
&& (isToolbarButtonEnabled(key, _toolbarButtons) || isToolbarButtonEnabled(alias, _toolbarButtons))
);
const filteredKeys = filtered.map(button => button.key);
order = order.filter(key => filteredKeys.includes(buttons[key as keyof typeof buttons].key));
let sliceIndex = order.length + 2;
let sliceIndex = _overflowDrawer ? order.length + 2 : order.length + 1;
if (isHangupVisible) {
sliceIndex -= 1;