feat(InviteMore): Relocate invite prompt for mobile friendliness.

This commit is contained in:
Mihai-Andrei Uscat 2021-03-18 14:09:22 +02:00 committed by GitHub
parent 7fce181080
commit a22d054b10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 94 additions and 53 deletions

View File

@ -98,6 +98,12 @@
}
}
.toolbox-content-wrapper {
display: flex;
flex-direction: column;
margin: 0 auto;
max-width: 100%;
}
.toolbox-content-items {
background: $newToolbarBackgroundColor;
@ -295,12 +301,16 @@
}
/**
* On small mobile devices make the toolbar full width.
* On small mobile devices make the toolbar full width and pad the invite prompt.
*/
.toolbox-content-mobile {
@media (max-width: 500px) {
margin-bottom: 0;
.toolbox-content-wrapper {
width: 100%;
}
.toolbox-content-items {
border-radius: 0;
display: flex;
@ -308,5 +318,13 @@
padding: 6px 0;
width: 100%;
}
.invite-more-container {
margin: 0 16px 8px;
}
.invite-more-container.elevated {
margin-bottom: 52px;
}
}
}

View File

@ -1,31 +1,42 @@
.invite-more {
&-container {
margin-bottom: 8px;
transition: margin-bottom 0.3s;
&.elevated {
margin-bottom: 36px;
}
}
&-content {
display: flex;
flex-direction: column;
align-items: center;
padding: 16px;
background: rgba(0, 0, 0, 0.7);
border-radius: 8px;
color: #fff;
font-size: 16px;
line-height: 24px;
font-weight: 600;
position: absolute;
width: 100%;
text-align: center;
z-index: $zindex2;
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
}
&-header {
font-size: 19px;
line-height: 28px;
margin: 24px 0 16px 0;
max-width: 100%;
margin-bottom: 16px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
&-button {
display: flex;
margin: auto;
padding: 8px 16px;
width: fit-content;
width: -moz-fit-content;
height: 24px;
max-width: 100%;
height: 48px;
box-sizing: border-box;
padding: 12px 16px;
background: #0376DA;
border-radius: 3px;
font-size: 14px;
line-height: 24px;
cursor: pointer;
@media (hover: hover) and (pointer: fine) {
@ -36,8 +47,9 @@
&-text {
margin-left: 8px;
font-size: 15px;
line-height: 24px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
}
&-dialog {

View File

@ -14,10 +14,14 @@ declare var interfaceConfig: Object;
type Props = {
/**
* Whether to show the option to invite more people
* instead of the subject.
* Whether to show the option to invite more people.
*/
_visible: boolean,
_shouldShow: boolean,
/**
* Whether the toolbox is visible.
*/
_toolboxVisible: boolean,
/**
* Handler to open the invite dialog.
@ -38,22 +42,25 @@ type Props = {
* @returns {React$Element<any>}
*/
function InviteMore({
_visible,
_shouldShow,
_toolboxVisible,
onClick,
t
}: Props) {
return (
_visible
? <div className = 'invite-more-container'>
<div className = 'invite-more-header'>
{t('addPeople.inviteMoreHeader')}
</div>
<div
className = 'invite-more-button'
onClick = { onClick }>
<Icon src = { IconInviteMore } />
<div className = 'invite-more-button-text'>
{t('addPeople.inviteMorePrompt')}
_shouldShow
? <div className = { `invite-more-container${_toolboxVisible ? '' : ' elevated'}` }>
<div className = 'invite-more-content'>
<div className = 'invite-more-header'>
{t('addPeople.inviteMoreHeader')}
</div>
<div
className = 'invite-more-button'
onClick = { onClick }>
<Icon src = { IconInviteMore } />
<div className = 'invite-more-button-text'>
{t('addPeople.inviteMorePrompt')}
</div>
</div>
</div>
</div> : null
@ -74,7 +81,8 @@ function mapStateToProps(state) {
const hide = interfaceConfig.HIDE_INVITE_MORE_HEADER;
return {
_visible: isToolboxVisible(state) && isButtonEnabled('invite', state) && isAlone && !hide
_shouldShow: isButtonEnabled('invite', state) && isAlone && !hide,
_toolboxVisible: isToolboxVisible(state)
};
}

View File

@ -96,7 +96,7 @@ function _mapStateToProps(state) {
_showParticipantCount: participantCount > 2 && !hideParticipantsStats,
_showSubject: !hideConferenceSubject,
_subject: getConferenceName(state),
_visible: isToolboxVisible(state) && participantCount > 1
_visible: isToolboxVisible(state)
};
}

View File

@ -4,7 +4,7 @@ import React, { Component } from 'react';
import { Watermarks } from '../../base/react';
import { connect } from '../../base/redux';
import { InviteMore, Subject } from '../../conference';
import { Subject } from '../../conference';
import { fetchCustomBrandingData } from '../../dynamic-branding';
import { Captions } from '../../subtitles/';
@ -71,7 +71,6 @@ class LargeVideo extends Component<Props> {
id = 'largeVideoContainer'
style = { style }>
<Subject />
<InviteMore />
<div id = 'sharedVideo'>
<div id = 'sharedVideoIFrame' />
</div>

View File

@ -36,6 +36,7 @@ import { OverflowMenuItem } from '../../../base/toolbox/components';
import { getLocalVideoTrack, toggleScreensharing } from '../../../base/tracks';
import { isVpaasMeeting } from '../../../billing-counter/functions';
import { CHAT_SIZE, ChatCounter, toggleChat } from '../../../chat';
import { InviteMore } from '../../../conference';
import { EmbedMeetingDialog } from '../../../embed-meeting';
import { SharedDocumentButton } from '../../../etherpad';
import { openFeedbackDialog } from '../../../feedback';
@ -1264,22 +1265,25 @@ class Toolbox extends Component<Props, State> {
return (
<div className = { containerClassName }>
<div className = 'toolbox-content-items'>
{ this._renderAudioButton() }
{ this._renderVideoButton() }
{ mainMenuAdditionalButtons }
{ showOverflowMenuButton && <OverflowMenuButton
isOpen = { _overflowMenuVisible }
onVisibilityChange = { this._onSetOverflowVisible }>
<ul
aria-label = { t(toolbarAccLabel) }
className = 'overflow-menu'>
{ this._renderOverflowMenuContent(overflowMenuAdditionalButtons) }
</ul>
</OverflowMenuButton>}
<HangupButton
customClass = 'hangup-button'
visible = { this._shouldShowButton('hangup') } />
<div className = 'toolbox-content-wrapper'>
<InviteMore />
<div className = 'toolbox-content-items'>
{ this._renderAudioButton() }
{ this._renderVideoButton() }
{ mainMenuAdditionalButtons }
{ showOverflowMenuButton && <OverflowMenuButton
isOpen = { _overflowMenuVisible }
onVisibilityChange = { this._onSetOverflowVisible }>
<ul
aria-label = { t(toolbarAccLabel) }
className = 'overflow-menu'>
{ this._renderOverflowMenuContent(overflowMenuAdditionalButtons) }
</ul>
</OverflowMenuButton>}
<HangupButton
customClass = 'hangup-button'
visible = { this._shouldShowButton('hangup') } />
</div>
</div>
</div>
);