feat(conference-info) Updated title bar (#10670)

Updated animations
Added raised hands counter
Added max width to title bar
This commit is contained in:
Robert Pintilii 2021-12-21 12:22:30 +02:00 committed by GitHub
parent d22d95e8a5
commit da2b920dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 136 additions and 18 deletions

View File

@ -1032,7 +1032,7 @@ var config = {
// If a label's id is not in any of the 2 arrays, it will not be visible at all on the header. // If a label's id is not in any of the 2 arrays, it will not be visible at all on the header.
// conferenceInfo: { // conferenceInfo: {
// // those labels will not be hidden in tandem with the toolbox. // // those labels will not be hidden in tandem with the toolbox.
// alwaysVisible: ['recording', 'local-recording'], // alwaysVisible: ['recording', 'local-recording', 'raised-hands-count'],
// // those labels will be auto-hidden in tandem with the toolbox buttons. // // those labels will be auto-hidden in tandem with the toolbox buttons.
// autoHide: [ // autoHide: [
// 'subject', // 'subject',

View File

@ -1,11 +1,25 @@
.subject { .subject {
color: #fff; color: #fff;
margin-top: -120px; transition: opacity .3s ease-in;
transition: margin-top .3s ease-in;
z-index: $zindex3; z-index: $zindex3;
margin-top: 20px;
opacity: 0;
&.visible { &.visible {
margin-top: 20px; opacity: 1;
}
&#autoHide.with-always-on {
overflow: hidden;
animation: hideSubject forwards .3s ease-out;
& > .subject-info-container {
justify-content: flex-start;
}
&.visible {
animation: showSubject forwards .3s ease-out;
}
} }
} }
@ -36,10 +50,7 @@
line-height: 28px; line-height: 28px;
padding: 0 16px; padding: 0 16px;
height: 28px; height: 28px;
max-width: 324px;
@media (max-width: 700px) {
max-width: 100px;
}
@media (max-width: 300px) { @media (max-width: 300px) {
display: none; display: none;
@ -74,8 +85,29 @@
position: absolute; position: absolute;
top: 0; top: 0;
height: 48px; height: 48px;
max-width: calc(100% - 24px);
} }
.shift-right .details-container { .shift-right .details-container {
margin-left: calc(#{$sidebarWidth} / 2); margin-left: calc(#{$sidebarWidth} / 2);
} }
@keyframes hideSubject {
0% {
max-width: 100%;
}
100% {
max-width: 0;
}
}
@keyframes showSubject {
0% {
max-width: 0%;
}
100% {
max-width: 100%;
}
}

View File

@ -784,6 +784,7 @@
"title": "Profile" "title": "Profile"
}, },
"raisedHand": "Would like to speak", "raisedHand": "Would like to speak",
"raisedHandsLabel": "Number of raised hands",
"recording": { "recording": {
"limitNotificationDescriptionWeb": "Due to high demand your recording will be limited to {{limit}} min. For unlimited recordings try <a href={{url}} rel='noopener noreferrer' target='_blank'>{{app}}</a>.", "limitNotificationDescriptionWeb": "Due to high demand your recording will be limited to {{limit}} min. For unlimited recordings try <a href={{url}} rel='noopener noreferrer' target='_blank'>{{app}}</a>.",
"limitNotificationDescriptionNative": "Due to high demand your recording will be limited to {{limit}} min. For unlimited recordings try <3>{{app}}</3>.", "limitNotificationDescriptionNative": "Due to high demand your recording will be limited to {{limit}} min. For unlimited recordings try <3>{{app}}</3>.",

View File

@ -34,6 +34,11 @@ type Props = AbstractProps & {
*/ */
id: string, id: string,
/**
* Color for the icon.
*/
iconColor?: string,
/** /**
* Click handler if any. * Click handler if any.
*/ */
@ -103,6 +108,7 @@ class Label extends AbstractLabel<Props, *> {
className, className,
color, color,
icon, icon,
iconColor,
id, id,
onClick, onClick,
text text
@ -120,6 +126,7 @@ class Label extends AbstractLabel<Props, *> {
id = { id } id = { id }
onClick = { onClick }> onClick = { onClick }>
{ icon && <Icon { icon && <Icon
color = { iconColor }
size = '16' size = '16'
src = { icon } /> } src = { icon } /> }
{ text && <span className = { icon && classes.withIcon }>{text}</span> } { text && <span className = { icon && classes.withIcon }>{text}</span> }

View File

@ -1,5 +1,5 @@
export const CONFERENCE_INFO = { export const CONFERENCE_INFO = {
alwaysVisible: [ 'recording', 'local-recording' ], alwaysVisible: [ 'recording', 'local-recording', 'raised-hands-count' ],
autoHide: [ autoHide: [
'subject', 'subject',
'conference-timer', 'conference-timer',

View File

@ -0,0 +1 @@
export * from './functions.any';

View File

@ -0,0 +1,14 @@
// @flow
export * from './functions.any';
/**
* Whether or not there are always on labels.
*
* @returns {boolean}
*/
export function isAlwaysOnTitleBarEmpty() {
const bar = document.querySelector('#alwaysVisible>div');
return bar?.childNodes.length === 0;
}

View File

@ -18,6 +18,7 @@ import { getConferenceInfo } from '../functions';
import ConferenceInfoContainer from './ConferenceInfoContainer'; import ConferenceInfoContainer from './ConferenceInfoContainer';
import InsecureRoomNameLabel from './InsecureRoomNameLabel'; import InsecureRoomNameLabel from './InsecureRoomNameLabel';
import ParticipantsCount from './ParticipantsCount'; import ParticipantsCount from './ParticipantsCount';
import RaisedHandsCountLabel from './RaisedHandsCountLabel';
import SubjectText from './SubjectText'; import SubjectText from './SubjectText';
/** /**
@ -66,6 +67,10 @@ const COMPONENTS = [
Component: LocalRecordingLabel, Component: LocalRecordingLabel,
id: 'local-recording' id: 'local-recording'
}, },
{
Component: RaisedHandsCountLabel,
id: 'raised-hands-count'
},
{ {
Component: TranscribingLabel, Component: TranscribingLabel,
id: 'transcribing' id: 'transcribing'
@ -115,7 +120,9 @@ class ConferenceInfo extends Component<Props> {
} }
return ( return (
<ConferenceInfoContainer visible = { this.props._visible } > <ConferenceInfoContainer
id = 'autoHide'
visible = { this.props._visible }>
{ {
COMPONENTS COMPONENTS
.filter(comp => autoHide.includes(comp.id)) .filter(comp => autoHide.includes(comp.id))
@ -142,7 +149,9 @@ class ConferenceInfo extends Component<Props> {
} }
return ( return (
<ConferenceInfoContainer visible = { true } > <ConferenceInfoContainer
id = 'alwaysVisible'
visible = { true } >
{ {
COMPONENTS COMPONENTS
.filter(comp => alwaysVisible.includes(comp.id)) .filter(comp => alwaysVisible.includes(comp.id))

View File

@ -2,6 +2,8 @@
import React from 'react'; import React from 'react';
import { isAlwaysOnTitleBarEmpty } from '../functions.web';
type Props = { type Props = {
/** /**
@ -9,14 +11,21 @@ type Props = {
*/ */
children: React$Node, children: React$Node,
/**
* Id of the component.
*/
id?: string,
/** /**
* Whether this conference info container should be visible or not. * Whether this conference info container should be visible or not.
*/ */
visible: boolean visible: boolean
} }
export default ({ visible, children }: Props) => ( export default ({ visible, children, id }: Props) => (
<div className = { `subject${visible ? ' visible' : ''}` }> <div
className = { `subject${isAlwaysOnTitleBarEmpty() ? '' : ' with-always-on'}${visible ? ' visible' : ''}` }
id = { id }>
<div className = { 'subject-info-container' }> <div className = { 'subject-info-container' }>
{children} {children}
</div> </div>

View File

@ -0,0 +1,45 @@
import { makeStyles } from '@material-ui/styles';
import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import { IconRaisedHand } from '../../../base/icons';
import { Label } from '../../../base/label';
import { Tooltip } from '../../../base/tooltip';
import BaseTheme from '../../../base/ui/components/BaseTheme';
import { open as openParticipantsPane } from '../../../participants-pane/actions';
const useStyles = makeStyles(theme => {
return {
label: {
backgroundColor: theme.palette.warning02,
color: theme.palette.uiBackground,
marginRight: theme.spacing(1)
}
};
});
const RaisedHandsCountLabel = () => {
const styles = useStyles();
const dispatch = useDispatch();
const raisedHandsCount = useSelector(state =>
(state['features/base/participants'].raisedHandsQueue || []).length);
const { t } = useTranslation();
const onClick = useCallback(() => {
dispatch(openParticipantsPane());
}, []);
return raisedHandsCount > 0 && (<Tooltip
content = { t('raisedHandsLabel') }
position = { 'bottom' }>
<Label
className = { styles.label }
icon = { IconRaisedHand }
iconColor = { BaseTheme.palette.uiBackground }
id = 'raisedHandsCountLabel'
onClick = { onClick }
text = { raisedHandsCount } />
</Tooltip>);
};
export default RaisedHandsCountLabel;