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
jitsi#15340)

On mobile web we want to keep both toolbox and hang up menu visible because they depend on each other.
  • Loading branch information
Calinteodor authored Dec 3, 2024
1 parent ef992ea commit c11147b
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 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 All @@ -61,7 +52,7 @@ const useStyles = makeStyles()(() => {
rowGap: '8px',
margin: 0,
padding: '16px',
marginBottom: '4px'
marginBottom: '8px'
}
};
});
Expand Down Expand Up @@ -111,6 +102,8 @@ export default function Toolbox({
const mainToolbarButtonsThresholds
= useSelector((state: IReduxState) => state['features/toolbox'].mainToolbarButtonsThresholds);
const allButtons = useToolboxButtons(customToolbarButtons);
const isMobile = isMobileBrowser();
const endConferenceSupported = Boolean(conference?.isEndConferenceSupported() && isModerator);

useKeyboardShortcuts(toolbarButtonsToUse);

Expand Down Expand Up @@ -150,7 +143,12 @@ export default function Toolbox({
}, [ dispatch ]);

useEffect(() => {
if (hangupMenuVisible && !toolbarVisible) {

// On mobile web we want to keep both toolbox and hang up menu visible
// because they depend on each other.
if (endConferenceSupported && isMobile) {
hangupMenuVisible && dispatch(setToolboxVisible(true));
} else if (hangupMenuVisible && !toolbarVisible) {
onSetHangupVisible(false);
dispatch(setToolbarHovered(false));
}
Expand Down Expand Up @@ -219,8 +217,6 @@ export default function Toolbox({
return null;
}

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 c11147b

Please sign in to comment.