diff --git a/app/src/components/JoinDialog.js b/app/src/components/JoinDialog.js index a34b850..128f197 100644 --- a/app/src/components/JoinDialog.js +++ b/app/src/components/JoinDialog.js @@ -1,19 +1,22 @@ -import React from 'react'; +import React, { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import { withStyles } from '@material-ui/core/styles'; import { withRoomContext } from '../RoomContext'; import * as stateActions from '../actions/stateActions'; import PropTypes from 'prop-types'; import Dialog from '@material-ui/core/Dialog'; -import DialogTitle from '@material-ui/core/DialogTitle'; +import DialogContentText from '@material-ui/core/DialogContentText'; import IconButton from '@material-ui/core/IconButton'; import AccountCircle from '@material-ui/icons/AccountCircle'; import Avatar from '@material-ui/core/Avatar'; import Typography from '@material-ui/core/Typography'; -import DialogActions from '@material-ui/core/DialogActions'; import Button from '@material-ui/core/Button'; import TextField from '@material-ui/core/TextField'; +import Tooltip from '@material-ui/core/Tooltip'; import CookieConsent from 'react-cookie-consent'; +import MuiDialogTitle from '@material-ui/core/DialogTitle'; +import MuiDialogContent from '@material-ui/core/DialogContent'; +import MuiDialogActions from '@material-ui/core/DialogActions'; const styles = (theme) => ({ @@ -29,54 +32,134 @@ const styles = (theme) => backgroundSize : 'cover', backgroundRepeat : 'no-repeat' }, + dialogTitle : + { + }, dialogPaper : { - width : '20vw', + width : '30vw', padding : theme.spacing(2), [theme.breakpoints.down('lg')] : { - width : '30vw' + width : '40vw' }, [theme.breakpoints.down('md')] : { - width : '40vw' + width : '50vw' }, [theme.breakpoints.down('sm')] : { - width : '60vw' + width : '70vw' }, [theme.breakpoints.down('xs')] : { - width : '80vw' + width : '90vw' } }, - title : - { - position : 'relative', - alignItems : 'center', - display : 'flex', - marginLeft : 0 - }, - actionButtons : - { - right : 0, - position : 'absolute' - }, logo : { - display : 'block' + display : 'block', + paddingBottom : '1vh' + }, + loginButton : + { + position : 'absolute', + right : theme.spacing(2), + top : theme.spacing(2), + padding : 0 + }, + largeIcon : + { + fontSize : '2em' + }, + largeAvatar : + { + width : 50, + height : 50 }, green : { - color : 'rgba(0,255,0,1)' + color : 'rgba(0, 153, 0, 1)' } }); +const DialogTitle = withStyles(styles)((props) => +{ + const [ open, setOpen ] = useState(false); + + useEffect(() => + { + const openTimer = setTimeout(() => setOpen(true), 1000); + const closeTimer = setTimeout(() => setOpen(false), 4000); + + return () => + { + clearTimeout(openTimer); + clearTimeout(closeTimer); + }; + }, []); + + const { children, classes, myPicture, onLogin, ...other } = props; + + const handleTooltipClose = () => + { + setOpen(false); + }; + + const handleTooltipOpen = () => + { + setOpen(true); + }; + + return ( + + { window.config.logo && Logo } + {children} + { window.config.loginEnabled && + + + { myPicture ? + + : + + } + + + } + + ); +}); + +const DialogContent = withStyles((theme) => ({ + root : + { + padding : theme.spacing(2) + } +}))(MuiDialogContent); + +const DialogActions = withStyles((theme) => ({ + root : + { + margin : 0, + padding : theme.spacing(1) + } +}))(MuiDialogActions); + const JoinDialog = ({ roomClient, room, displayName, - loginEnabled, loggedIn, myPicture, changeDisplayName, @@ -109,68 +192,53 @@ const JoinDialog = ({ paper : classes.dialogPaper }} > - - { window.config.logo && Logo } -
- - { window.config.title } - -
-
-
- { loginEnabled && - - { - loggedIn ? roomClient.logout() : roomClient.login(); - }} - > - { myPicture ? - - : - - } - - } -
+ + { + loggedIn ? roomClient.logout() : roomClient.login(); + }} + > + { window.config.title } +
- { window.config.logo && - Logo - } - - You are about to join a meeting. - - -
Room ID: { room.name }
-
- - Set your name for participation, - and choose how you want to join: - + + + You are about to join a meeting. + - - { - const { value } = event.target; + + Room ID: { room.name } + - changeDisplayName(value); - }} - onKeyDown={handleKeyDown} - onBlur={() => - { - if (displayName === '') - changeDisplayName('Guest'); - if (room.inLobby) roomClient.changeDisplayName(displayName); - }} - margin='normal' - /> + + Set your name for participation, + and choose how you want to join: + + + + { + const { value } = event.target; + + changeDisplayName(value); + }} + onKeyDown={handleKeyDown} + onBlur={() => + { + if (displayName === '') + changeDisplayName('Guest'); + if (room.inLobby) roomClient.changeDisplayName(displayName); + }} + fullWidth + /> + + { !room.inLobby ? @@ -196,19 +264,26 @@ const JoinDialog = ({ : - -
Ok, you are ready
+ + + Ok, you are ready + { room.signInRequired ? -
+ The room is empty! You can Log In to start the meeting or wait until the host joins. -
+ : -
+ The room is locked - hang on until somebody lets you in ... -
+ } -
+ } diff --git a/app/src/index.css b/app/src/index.css index 3fbbe8f..b1a7397 100644 --- a/app/src/index.css +++ b/app/src/index.css @@ -18,6 +18,11 @@ html font-family: 'Roboto'; font-weight: 300; margin : 0; + box-sizing: border-box; +} + +*, *:before, *:after { + box-sizing: inherit; } body