Skip to content

Commit

Permalink
feat(toolbox): adapt toolbox and hang up menu visibility to mobile web
Browse files Browse the repository at this point in the history
  • Loading branch information
Calinteodor committed Nov 27, 2024
1 parent 4d7c051 commit e428519
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions react/features/toolbox/components/web/Toolbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ interface IProps {

const useStyles = makeStyles()(() => {
return {
contextMenu: {
position: 'relative',
right: 'auto',
margin: 0,
marginBottom: '8px',
maxHeight: 'calc(100dvh - 100px)',
minWidth: '240px'
},

hangupMenu: {
position: 'relative',
right: 'auto',
Expand Down Expand Up @@ -111,6 +102,7 @@ export default function Toolbox({
const mainToolbarButtonsThresholds
= useSelector((state: IReduxState) => state['features/toolbox'].mainToolbarButtonsThresholds);
const allButtons = useToolboxButtons(customToolbarButtons);
const isMobile = isMobileBrowser();

useKeyboardShortcuts(toolbarButtonsToUse);

Expand Down Expand Up @@ -150,9 +142,16 @@ export default function Toolbox({
}, [ dispatch ]);

useEffect(() => {
if (hangupMenuVisible && !toolbarVisible) {
onSetHangupVisible(false);
dispatch(setToolbarHovered(false));

// On mobile web we want to keep both toolbox and hang up menu visible
// because they depend on each other.
if (isMobile) {
hangupMenuVisible && dispatch(setToolboxVisible(true));
} else {
if (hangupMenuVisible && !toolbarVisible) {

Check failure on line 151 in react/features/toolbox/components/web/Toolbox.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected if as the only statement in an else block
onSetHangupVisible(false)

Check failure on line 152 in react/features/toolbox/components/web/Toolbox.tsx

View workflow job for this annotation

GitHub Actions / Lint

Missing semicolon
dispatch(setToolbarHovered(false));
}
}
}, [ dispatch, hangupMenuVisible, toolbarVisible, onSetHangupVisible ]);

Expand Down Expand Up @@ -220,7 +219,6 @@ export default function Toolbox({
}

const endConferenceSupported = Boolean(conference?.isEndConferenceSupported() && isModerator);
const isMobile = isMobileBrowser();

const rootClassNames = `new-toolbox ${toolbarVisible ? 'visible' : ''} ${
toolbarButtonsToUse.length ? '' : 'no-buttons'} ${chatOpen ? 'shift-right' : ''}`;
Expand Down

0 comments on commit e428519

Please sign in to comment.