mirror of https://github.com/jitsi/jitsi-meet
parent
2ad6bfbc20
commit
5ea8e198c7
After Width: | Height: | Size: 849 B |
@ -0,0 +1,30 @@ |
||||
// @flow
|
||||
|
||||
|
||||
export type Props = { |
||||
|
||||
/** |
||||
* True if the label needs to be rendered, false otherwise. |
||||
*/ |
||||
_showLabel: boolean, |
||||
|
||||
/** |
||||
* Invoked to obtain translated strings. |
||||
*/ |
||||
t: Function |
||||
}; |
||||
|
||||
/** |
||||
* Maps (parts of) the redux state to the associated props of this {@code Component}. |
||||
* |
||||
* @param {Object} state - The redux state. |
||||
* @private |
||||
* @returns {Props} |
||||
*/ |
||||
export function _mapStateToProps(state: Object) { |
||||
const participants = state['features/base/participants']; |
||||
|
||||
return { |
||||
_showLabel: participants.every(p => p.e2eeEnabled) |
||||
}; |
||||
} |
@ -0,0 +1,47 @@ |
||||
// @flow
|
||||
|
||||
import Tooltip from '@atlaskit/tooltip'; |
||||
import React, { Component } from 'react'; |
||||
|
||||
import { translate } from '../../base/i18n'; |
||||
import { Icon, IconE2EE } from '../../base/icons'; |
||||
import { CircularLabel } from '../../base/label'; |
||||
import { connect } from '../../base/redux'; |
||||
|
||||
import { _mapStateToProps, type Props } from './AbstractE2EELabel'; |
||||
|
||||
|
||||
/** |
||||
* React {@code Component} for displaying a label when everyone has E2EE enabled in a conferene. |
||||
* |
||||
* @extends Component |
||||
*/ |
||||
class E2EELabel extends Component<Props> { |
||||
|
||||
/** |
||||
* Implements React's {@link Component#render()}. |
||||
* |
||||
* @inheritdoc |
||||
* @returns {ReactElement} |
||||
*/ |
||||
render() { |
||||
if (!this.props._showLabel) { |
||||
return null; |
||||
} |
||||
|
||||
// eslint-disable-next-line react/jsx-max-props-per-line
|
||||
const icon = <Icon size = { 22 } src = { IconE2EE } />; |
||||
|
||||
return ( |
||||
<Tooltip |
||||
content = { this.props.t('e2ee.labelToolTip') } |
||||
position = { 'left' }> |
||||
<CircularLabel |
||||
className = 'e2ee' |
||||
label = { icon } /> |
||||
</Tooltip> |
||||
); |
||||
} |
||||
} |
||||
|
||||
export default translate(connect(_mapStateToProps)(E2EELabel)); |
@ -0,0 +1,2 @@ |
||||
// TODO: implement later.
|
||||
export const E2EELabel = undefined; |
@ -1,2 +1,3 @@ |
||||
export { default as E2EEButton } from './E2EEButton'; |
||||
export { default as E2EEDialog } from './E2EEDialog'; |
||||
export { default as E2EELabel } from './E2EELabel'; |
Loading…
Reference in new issue