Merge pull request #31 from torjusti/develop
Show avatar when logged in and support logging outmaster
commit
4e1a4a9d4e
|
|
@ -134,6 +134,11 @@ export default class RoomClient
|
||||||
this._loginWindow = window.open(url, 'loginWindow');
|
this._loginWindow = window.open(url, 'loginWindow');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logout()
|
||||||
|
{
|
||||||
|
window.location = '/logout';
|
||||||
|
}
|
||||||
|
|
||||||
closeLoginWindow()
|
closeLoginWindow()
|
||||||
{
|
{
|
||||||
this._loginWindow.close();
|
this._loginWindow.close();
|
||||||
|
|
@ -1081,6 +1086,7 @@ export default class RoomClient
|
||||||
|
|
||||||
this.changeProfilePicture(request.data.picture);
|
this.changeProfilePicture(request.data.picture);
|
||||||
this._dispatch(stateActions.setPicture(request.data.picture));
|
this._dispatch(stateActions.setPicture(request.data.picture));
|
||||||
|
this._dispatch(stateActions.loggedIn());
|
||||||
|
|
||||||
this._dispatch(requestActions.notify(
|
this._dispatch(requestActions.notify(
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class Sidebar extends Component
|
||||||
{
|
{
|
||||||
const {
|
const {
|
||||||
toolbarsVisible, me, screenProducer, onLogin, onShareScreen,
|
toolbarsVisible, me, screenProducer, onLogin, onShareScreen,
|
||||||
onUnShareScreen, onNeedExtension, onLeaveMeeting
|
onUnShareScreen, onNeedExtension, onLeaveMeeting, onLogout
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
let screenState;
|
let screenState;
|
||||||
|
|
@ -127,16 +127,24 @@ class Sidebar extends Component
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{me.loginEnabled ?
|
{me.loginEnabled && (me.loggedIn ? (
|
||||||
|
<div
|
||||||
|
className='button logout'
|
||||||
|
data-tip='Logout'
|
||||||
|
data-type='dark'
|
||||||
|
onClick={onLogout}
|
||||||
|
>
|
||||||
|
<img src={me.picture || 'resources/images/avatar-empty.jpeg'} />
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
<div
|
<div
|
||||||
className='button login off'
|
className='button login off'
|
||||||
data-tip='Login'
|
data-tip='Login'
|
||||||
data-type='dark'
|
data-type='dark'
|
||||||
onClick={() => onLogin()}
|
onClick={onLogin}
|
||||||
/>
|
/>
|
||||||
:null
|
))}
|
||||||
}
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={classnames('button', 'leave-meeting')}
|
className={classnames('button', 'leave-meeting')}
|
||||||
data-tip='Leave meeting'
|
data-tip='Leave meeting'
|
||||||
|
|
@ -156,6 +164,7 @@ Sidebar.propTypes = {
|
||||||
onNeedExtension : PropTypes.func.isRequired,
|
onNeedExtension : PropTypes.func.isRequired,
|
||||||
onLeaveMeeting : PropTypes.func.isRequired,
|
onLeaveMeeting : PropTypes.func.isRequired,
|
||||||
onLogin : PropTypes.func.isRequired,
|
onLogin : PropTypes.func.isRequired,
|
||||||
|
onLogout : PropTypes.func.isRequired,
|
||||||
screenProducer : appPropTypes.Producer
|
screenProducer : appPropTypes.Producer
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -172,7 +181,8 @@ const mapDispatchToProps = {
|
||||||
onShareScreen : requestActions.enableScreenSharing,
|
onShareScreen : requestActions.enableScreenSharing,
|
||||||
onUnShareScreen : requestActions.disableScreenSharing,
|
onUnShareScreen : requestActions.disableScreenSharing,
|
||||||
onNeedExtension : requestActions.installExtension,
|
onNeedExtension : requestActions.installExtension,
|
||||||
onLogin : requestActions.userLogin
|
onLogin : requestActions.userLogin,
|
||||||
|
onLogout : requestActions.userLogout
|
||||||
};
|
};
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@ const initialState =
|
||||||
restartIceInProgress : false,
|
restartIceInProgress : false,
|
||||||
picture : null,
|
picture : null,
|
||||||
selectedWebcam : null,
|
selectedWebcam : null,
|
||||||
selectedAudioDevice : null
|
selectedAudioDevice : null,
|
||||||
|
loggedIn : false
|
||||||
};
|
};
|
||||||
|
|
||||||
const me = (state = initialState, action) =>
|
const me = (state = initialState, action) =>
|
||||||
|
|
@ -50,6 +51,12 @@ const me = (state = initialState, action) =>
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'LOGGED_IN':
|
||||||
|
return { ...state, loggedIn: true };
|
||||||
|
|
||||||
|
case 'USER_LOGOUT':
|
||||||
|
return { ...state, loggedIn: false };
|
||||||
|
|
||||||
case 'CHANGE_WEBCAM':
|
case 'CHANGE_WEBCAM':
|
||||||
{
|
{
|
||||||
return { ...state, selectedWebcam: action.payload.deviceId };
|
return { ...state, selectedWebcam: action.payload.deviceId };
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,13 @@ export const userLogin = () =>
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const userLogout = () =>
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
type : 'USER_LOGOUT'
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
export const raiseHand = () =>
|
export const raiseHand = () =>
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,13 @@ export default ({ dispatch, getState }) => (next) =>
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'USER_LOGOUT':
|
||||||
|
{
|
||||||
|
client.logout();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 'LOWER_HAND':
|
case 'LOWER_HAND':
|
||||||
{
|
{
|
||||||
client.sendRaiseHandState(false);
|
client.sendRaiseHandState(false);
|
||||||
|
|
|
||||||
|
|
@ -443,4 +443,9 @@ export const setPeerPicture = (peerName, picture) =>
|
||||||
({
|
({
|
||||||
type : 'SET_PEER_PICTURE',
|
type : 'SET_PEER_PICTURE',
|
||||||
payload : { peerName, picture }
|
payload : { peerName, picture }
|
||||||
|
});
|
||||||
|
|
||||||
|
export const loggedIn = () =>
|
||||||
|
({
|
||||||
|
type : 'LOGGED_IN'
|
||||||
});
|
});
|
||||||
|
|
@ -29,6 +29,9 @@
|
||||||
transition-property: opacity, background-color;
|
transition-property: opacity, background-color;
|
||||||
transition-duration: 0.15s;
|
transition-duration: 0.15s;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
+desktop() {
|
+desktop() {
|
||||||
height: 36px;
|
height: 36px;
|
||||||
|
|
@ -55,6 +58,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.logout > img {
|
||||||
|
height: 65%;
|
||||||
|
max-width: 65%;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
&.settings {
|
&.settings {
|
||||||
&.off {
|
&.off {
|
||||||
background-image: url('/resources/images/icon_settings_white.svg');
|
background-image: url('/resources/images/icon_settings_white.svg');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue