|
@@ -12,6 +12,11 @@ import { doesEveryoneSupportE2EE } from '../functions';
|
12
|
12
|
|
13
|
13
|
type Props = {
|
14
|
14
|
|
|
15
|
+ /**
|
|
16
|
+ * Custom e2ee label.
|
|
17
|
+ */
|
|
18
|
+ _e2eeLabel: string,
|
|
19
|
+
|
15
|
20
|
/**
|
16
|
21
|
* Whether E2EE is currently enabled or not.
|
17
|
22
|
*/
|
|
@@ -87,9 +92,21 @@ class E2EESection extends Component<Props, State> {
|
87
|
92
|
* @returns {ReactElement}
|
88
|
93
|
*/
|
89
|
94
|
render() {
|
90
|
|
- const { _everyoneSupportE2EE, t } = this.props;
|
|
95
|
+ const { _e2eeLabel, _everyoneSupportE2EE, t } = this.props;
|
91
|
96
|
const { enabled } = this.state;
|
92
|
|
- const description = t('dialog.e2eeDescription');
|
|
97
|
+ let description;
|
|
98
|
+ let label;
|
|
99
|
+ let warning;
|
|
100
|
+
|
|
101
|
+ if (_e2eeLabel) {
|
|
102
|
+ description = t('dialog.e2eeDescriptionCustom', { label: _e2eeLabel });
|
|
103
|
+ label = t('dialog.e2eeLabelCustom', { label: _e2eeLabel });
|
|
104
|
+ warning = t('dialog.e2eeWarningCustom', { label: _e2eeLabel });
|
|
105
|
+ } else {
|
|
106
|
+ description = t('dialog.e2eeDescription');
|
|
107
|
+ label = t('dialog.e2eeLabel');
|
|
108
|
+ warning = t('dialog.e2eeWarning');
|
|
109
|
+ }
|
93
|
110
|
|
94
|
111
|
return (
|
95
|
112
|
<div id = 'e2ee-section'>
|
|
@@ -99,11 +116,11 @@ class E2EESection extends Component<Props, State> {
|
99
|
116
|
id = 'e2ee-section-description'>
|
100
|
117
|
{ description }
|
101
|
118
|
{ !_everyoneSupportE2EE && <br /> }
|
102
|
|
- { !_everyoneSupportE2EE && t('dialog.e2eeWarning') }
|
|
119
|
+ { !_everyoneSupportE2EE && warning }
|
103
|
120
|
</p>
|
104
|
121
|
<div className = 'control-row'>
|
105
|
122
|
<label htmlFor = 'e2ee-section-switch'>
|
106
|
|
- { t('dialog.e2eeLabel') }
|
|
123
|
+ { label }
|
107
|
124
|
</label>
|
108
|
125
|
<Switch
|
109
|
126
|
id = 'e2ee-section-switch'
|
|
@@ -143,8 +160,10 @@ class E2EESection extends Component<Props, State> {
|
143
|
160
|
*/
|
144
|
161
|
function mapStateToProps(state) {
|
145
|
162
|
const { enabled } = state['features/e2ee'];
|
|
163
|
+ const { e2eeLabel } = state['features/base/config'];
|
146
|
164
|
|
147
|
165
|
return {
|
|
166
|
+ _e2eeLabel: e2eeLabel,
|
148
|
167
|
_enabled: enabled,
|
149
|
168
|
_everyoneSupportE2EE: doesEveryoneSupportE2EE(state)
|
150
|
169
|
};
|