Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2136 from matrix-org/dbkr/tnclinks
Browse files Browse the repository at this point in the history
Render terms & conditions in settings
  • Loading branch information
dbkr authored Aug 24, 2018
2 parents 8313dcd + c03abdd commit 30114e3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/components/structures/UserSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,25 @@ module.exports = React.createClass({
</div>;
},

_renderTermsAndConditionsLinks: function() {
if (SdkConfig.get().terms_and_conditions_links) {
const tncLinks = [];
for (const tncEntry of SdkConfig.get().terms_and_conditions_links) {
tncLinks.push(<div key={tncEntry.url}>
<a href={tncEntry.url} rel="noopener" target="_blank">{tncEntry.text}</a>
</div>);
}
return <div>
<h3>{ _t("Legal") }</h3>
<div className="mx_UserSettings_section">
{tncLinks}
</div>
</div>;
} else {
return null;
}
},

_renderClearCache: function() {
return <div>
<h3>{ _t("Clear Cache") }</h3>
Expand Down Expand Up @@ -1407,6 +1426,8 @@ module.exports = React.createClass({

{ this._renderDeactivateAccount() }

{ this._renderTermsAndConditionsLinks() }

</GeminiScrollbarWrapper>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@
"Lazy loading members not supported": "Lazy loading members not supported",
"Lazy loading is not supported by your current homeserver.": "Lazy loading is not supported by your current homeserver.",
"Deactivate my account": "Deactivate my account",
"Legal": "Legal",
"Clear Cache": "Clear Cache",
"Clear Cache and Reload": "Clear Cache and Reload",
"Updates": "Updates",
Expand Down

0 comments on commit 30114e3

Please sign in to comment.