fix(e2ee) show entire content at all times

This commit is contained in:
Saúl Ibarra Corretgé 2021-08-18 15:02:25 +02:00 committed by Saúl Ibarra Corretgé
parent cf34b0a783
commit cd5f2b483f
2 changed files with 5 additions and 60 deletions

View File

@ -5,14 +5,6 @@
.description {
font-size: 13px;
margin: 15px 0;
.read-more {
cursor: pointer;
opacity: .9;
color: #fff;
font-size: 0.8rem;
font-weight: bold;
}
}
.control-row {

View File

@ -78,13 +78,10 @@ class E2EESection extends Component<Props, State> {
super(props);
this.state = {
enabled: false,
expand: false
enabled: false
};
// Bind event handlers so they are only bound once for every instance.
this._onExpand = this._onExpand.bind(this);
this._onExpandKeyPress = this._onExpandKeyPress.bind(this);
this._onToggle = this._onToggle.bind(this);
}
@ -96,7 +93,7 @@ class E2EESection extends Component<Props, State> {
*/
render() {
const { _everyoneSupportE2EE, t } = this.props;
const { enabled, expand } = this.state;
const { enabled } = this.state;
const description = t('dialog.e2eeDescription');
return (
@ -105,25 +102,10 @@ class E2EESection extends Component<Props, State> {
aria-live = 'polite'
className = 'description'
id = 'e2ee-section-description'>
{ expand && description }
{ !expand && description.substring(0, 100) }
{ !expand && <span
aria-controls = 'e2ee-section-description'
aria-expanded = { expand }
className = 'read-more'
onClick = { this._onExpand }
onKeyPress = { this._onExpandKeyPress }
role = 'button'
tabIndex = { 0 }>
... { t('dialog.readMore') }
</span> }
{ description }
{ !_everyoneSupportE2EE && <br /> }
{ !_everyoneSupportE2EE && t('dialog.e2eeWarning') }
</p>
{
!_everyoneSupportE2EE
&& <span className = 'warning'>
{ t('dialog.e2eeWarning') }
</span>
}
<div className = 'control-row'>
<label htmlFor = 'e2ee-section-switch'>
{ t('dialog.e2eeLabel') }
@ -137,35 +119,6 @@ class E2EESection extends Component<Props, State> {
);
}
_onExpand: () => void;
/**
* Callback to be invoked when the description is expanded.
*
* @returns {void}
*/
_onExpand() {
this.setState({
expand: true
});
}
_onExpandKeyPress: (Object) => void;
/**
* KeyPress handler for accessibility.
*
* @param {Object} e - The key event to handle.
*
* @returns {void}
*/
_onExpandKeyPress(e) {
if (e.key === ' ' || e.key === 'Enter') {
e.preventDefault();
this._onExpand();
}
}
_onToggle: () => void;
/**