Add jwt module to react

This commit is contained in:
Ilya Daynatovich
2017-04-21 13:00:50 +03:00
committed by Lyubo Marinov
parent 4f72225372
commit ab5c2e9ded
20 changed files with 356 additions and 222 deletions

View File

@@ -33,6 +33,12 @@ class SecondaryToolbar extends Component {
* @static
*/
static propTypes = {
/**
* The indicator which determines whether the local participant is a
* guest in the conference.
*/
_isGuest: React.PropTypes.bool,
/**
* Handler dispatching local "Raise hand".
*/
@@ -79,9 +85,14 @@ class SecondaryToolbar extends Component {
* @type {Object}
*/
profile: {
onMount: () =>
APP.tokenData.isGuest
|| this.props._onSetProfileButtonUnclickable(true)
onMount: () => {
const {
_isGuest,
_onSetProfileButtonUnclickable
} = this.props;
_isGuest || _onSetProfileButtonUnclickable(true);
}
},
/**
@@ -237,18 +248,26 @@ function _mapDispatchToProps(dispatch: Function): Object {
*
* @param {Object} state - Snapshot of Redux store.
* @returns {{
* _isGuest: boolean,
* _secondaryToolbarButtons: Map,
* _visible: boolean
* }}
* @private
*/
function _mapStateToProps(state: Object): Object {
const {
secondaryToolbarButtons,
visible
} = state['features/toolbox'];
const { isGuest } = state['features/jwt'];
const { secondaryToolbarButtons, visible } = state['features/toolbox'];
return {
/**
* The indicator which determines whether the local participant is a
* guest in the conference.
*
* @private
* @type {boolean}
*/
_isGuest: isGuest,
/**
* Default toolbar buttons for secondary toolbar.
*
@@ -258,7 +277,8 @@ function _mapStateToProps(state: Object): Object {
_secondaryToolbarButtons: secondaryToolbarButtons,
/**
* Shows whether toolbar is visible.
* The indicator which determines whether the {@code SecondaryToolbar}
* is visible.
*
* @private
* @type {boolean}