fix(presentation): toolbar width on small screens

Forces the toolbar width to be the maximum available width, which is
the width of the media area, on mobile devices. Also allow the toolbar to
overflow with an horizontal scroll when the available width is not enough
to display all of its contents.
This commit is contained in:
Arthurk12 2024-04-05 10:29:52 -03:00
parent 31537b1910
commit 45e1724954
3 changed files with 14 additions and 6 deletions

View File

@ -792,17 +792,21 @@ class Presentation extends PureComponent {
const { presentationToolbarMinWidth } = DEFAULT_VALUES; const { presentationToolbarMinWidth } = DEFAULT_VALUES;
const isLargePresentation = const isLargePresentation =
(svgWidth > presentationToolbarMinWidth || isMobile) && (svgWidth > presentationToolbarMinWidth) &&
!( !(
layoutType === LAYOUT_TYPE.VIDEO_FOCUS && layoutType === LAYOUT_TYPE.VIDEO_FOCUS
numCameras > 0 && && numCameras > 0
!fullscreenContext && !fullscreenContext
); );
const containerWidth = isLargePresentation const containerWidth = isLargePresentation
? svgWidth ? svgWidth
: presentationToolbarMinWidth; : presentationToolbarMinWidth;
const mobileAwareContainerWidth = isMobile
? presentationBounds.width
: containerWidth;
const slideContent = currentSlide?.content const slideContent = currentSlide?.content
? `${intl.formatMessage(intlMessages.slideContentStart)} ? `${intl.formatMessage(intlMessages.slideContentStart)}
${currentSlide.content} ${currentSlide.content}
@ -901,7 +905,7 @@ class Presentation extends PureComponent {
this.refPresentationToolbar = ref; this.refPresentationToolbar = ref;
}} }}
style={{ style={{
width: containerWidth, width: mobileAwareContainerWidth,
}} }}
> >
{this.renderPresentationToolbar(svgWidth)} {this.renderPresentationToolbar(svgWidth)}

View File

@ -319,6 +319,7 @@ class PresentationToolbar extends PureComponent {
return ( return (
<Styled.PresentationToolbarWrapper <Styled.PresentationToolbarWrapper
id="presentationToolbarWrapper" id="presentationToolbarWrapper"
isMobile={isMobile}
> >
{this.renderAriaDescs()} {this.renderAriaDescs()}
<Styled.QuickPollButtonWrapper> <Styled.QuickPollButtonWrapper>

View File

@ -25,12 +25,15 @@ const PresentationToolbarWrapper = styled.div`
z-index: 1; z-index: 1;
background-color: ${colorOffWhite}; background-color: ${colorOffWhite};
border-top: 1px solid ${colorBlueLightest}; border-top: 1px solid ${colorBlueLightest};
min-width: fit-content;
width: 100%; width: 100%;
bottom: 0px; bottom: 0px;
display: grid; display: grid;
grid-template-columns: 1fr 1fr 1fr; grid-template-columns: 1fr 1fr 1fr;
padding: 2px; padding: 2px;
${({ isMobile }) => (isMobile
? 'overflow: auto;'
: 'min-width: fit-content;'
)};
select { select {
&:-moz-focusring { &:-moz-focusring {