Show avatar when logged in and support logging out

This commit is contained in:
Torjus
2018-07-24 11:14:52 +02:00
parent c414fd5301
commit aca2ec90f0
7 changed files with 57 additions and 14 deletions
+15 -13
View File
@@ -51,7 +51,7 @@ class Sidebar extends Component
{
const {
toolbarsVisible, me, screenProducer, onLogin, onShareScreen,
onUnShareScreen, onNeedExtension, onLeaveMeeting
onUnShareScreen, onNeedExtension, onLeaveMeeting, onLogout
} = this.props;
let screenState;
@@ -127,22 +127,23 @@ 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
className='button login off'
data-tip='Login'
data-type='dark'
onClick={() => onLogin()}
onClick={onLogin}
/>
:null
}
<div
className={classnames('button', 'leave-meeting')}
data-tip='Leave meeting'
data-type='dark'
onClick={() => onLeaveMeeting()}
/>
))}
</div>
);
}
@@ -172,7 +173,8 @@ const mapDispatchToProps = {
onShareScreen : requestActions.enableScreenSharing,
onUnShareScreen : requestActions.disableScreenSharing,
onNeedExtension : requestActions.installExtension,
onLogin : requestActions.userLogin
onLogin : requestActions.userLogin,
onLogout : requestActions.userLogout
};
export default connect(