Also hide Privacy heading in settings and fix React Key warning

pull/21833/head
Michael Telatynski 2020-09-16 10:37:15 +01:00
parent 771ab82598
commit d990986407
2 changed files with 24 additions and 22 deletions

View File

@ -367,14 +367,14 @@ export default class SecureBackupPanel extends React.PureComponent {
</>; </>;
actions.push( actions.push(
<AccessibleButton kind="primary" onClick={this._restoreBackup}> <AccessibleButton kind="primary" onClick={this._restoreBackup} key="restoreButton">
{restoreButtonCaption} {restoreButtonCaption}
</AccessibleButton>, </AccessibleButton>,
); );
if (!isSecureBackupRequired()) { if (!isSecureBackupRequired()) {
actions.push( actions.push(
<AccessibleButton kind="danger" onClick={this._deleteBackup}> <AccessibleButton kind="danger" onClick={this._deleteBackup} key="deleteButton">
{_t("Delete Backup")} {_t("Delete Backup")}
</AccessibleButton>, </AccessibleButton>,
); );
@ -388,7 +388,7 @@ export default class SecureBackupPanel extends React.PureComponent {
<p>{_t("Back up your keys before signing out to avoid losing them.")}</p> <p>{_t("Back up your keys before signing out to avoid losing them.")}</p>
</>; </>;
actions.push( actions.push(
<AccessibleButton kind="primary" onClick={this._startNewBackup}> <AccessibleButton kind="primary" onClick={this._startNewBackup} key="setupButton">
{_t("Set up")} {_t("Set up")}
</AccessibleButton>, </AccessibleButton>,
); );
@ -396,7 +396,7 @@ export default class SecureBackupPanel extends React.PureComponent {
if (secretStorageKeyInAccount) { if (secretStorageKeyInAccount) {
actions.push( actions.push(
<AccessibleButton kind="danger" onClick={this._resetSecretStorage}> <AccessibleButton kind="danger" onClick={this._resetSecretStorage} key="resetButton">
{_t("Reset")} {_t("Reset")}
</AccessibleButton>, </AccessibleButton>,
); );

View File

@ -329,24 +329,27 @@ export default class SecurityUserSettingsTab extends React.Component {
</div>; </div>;
} }
let analyticsSection; let privacySection;
if (Analytics.canEnable()) { if (Analytics.canEnable()) {
analyticsSection = <div className="mx_SettingsTab_section"> privacySection = <React.Fragment>
<span className="mx_SettingsTab_subheading">{_t("Analytics")}</span> <div className="mx_SettingsTab_heading">{_t("Privacy")}</div>
<div className='mx_SettingsTab_subsectionText'> <div className="mx_SettingsTab_section">
{_t( <span className="mx_SettingsTab_subheading">{_t("Analytics")}</span>
"%(brand)s collects anonymous analytics to allow us to improve the application.", <div className="mx_SettingsTab_subsectionText">
{ brand }, {_t(
)} "%(brand)s collects anonymous analytics to allow us to improve the application.",
&nbsp; { brand },
{_t("Privacy is important to us, so we don't collect any personal or " + )}
"identifiable data for our analytics.")} &nbsp;
<AccessibleButton className="mx_SettingsTab_linkBtn" onClick={Analytics.showDetailsModal}> {_t("Privacy is important to us, so we don't collect any personal or " +
{_t("Learn more about how we use analytics.")} "identifiable data for our analytics.")}
</AccessibleButton> <AccessibleButton className="mx_SettingsTab_linkBtn" onClick={Analytics.showDetailsModal}>
{_t("Learn more about how we use analytics.")}
</AccessibleButton>
</div>
<SettingsFlag name="analyticsOptIn" level={SettingLevel.DEVICE} onChange={this._updateAnalytics} />
</div> </div>
<SettingsFlag name='analyticsOptIn' level={SettingLevel.DEVICE} onChange={this._updateAnalytics} /> </React.Fragment>;
</div>;
} }
return ( return (
@ -377,8 +380,7 @@ export default class SecurityUserSettingsTab extends React.Component {
{crossSigning} {crossSigning}
{this._renderCurrentDeviceInfo()} {this._renderCurrentDeviceInfo()}
</div> </div>
<div className="mx_SettingsTab_heading">{_t("Privacy")}</div> { privacySection }
{ analyticsSection }
<div className="mx_SettingsTab_heading">{_t("Advanced")}</div> <div className="mx_SettingsTab_heading">{_t("Advanced")}</div>
<div className="mx_SettingsTab_section"> <div className="mx_SettingsTab_section">
{this._renderIgnoredUsers()} {this._renderIgnoredUsers()}