Skip to content

Commit 01794ae

Browse files
authored
Merge pull request element-hq#9297 from TheJJ/custom_login_footer_links
Configure auth footer links through Riot config
2 parents a8e4949 + 5a05182 commit 01794ae

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ For a good example, see https://riot.im/develop/config.json.
141141
during authentication flows
142142
1. `authHeaderLogoUrl`: An logo image that is shown in the header during
143143
authentication flows
144+
1. `authFooterLinks`: a list of links to show in the authentication page footer:
145+
`[{"text": "Link text", "url": "https://link.target"}, {"text": "Other link", ...}]`
144146
1. `integrations_ui_url`: URL to the web interface for the integrations server. The integrations
145147
server is not Riot and normally not your homeserver either. The integration server settings
146148
may be left blank to disable integrations.

‎src/components/views/auth/VectorAuthFooter.js‎

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ limitations under the License.
1818
'use strict';
1919

2020
const React = require('react');
21+
import SdkConfig from 'matrix-react-sdk/lib/SdkConfig';
22+
2123
import { _t } from 'matrix-react-sdk/lib/languageHandler';
2224

2325
module.exports = React.createClass({
@@ -27,11 +29,27 @@ module.exports = React.createClass({
2729
},
2830

2931
render: function() {
32+
const brandingConfig = SdkConfig.get().branding;
33+
let links = [
34+
{"text": "blog", "url": "https://medium.com/@RiotChat"},
35+
{"text": "twitter", "url": "https://twitter.com/@RiotChat"},
36+
{"text": "github", "url": "https://github.com/vector-im/riot-web"},
37+
];
38+
39+
if (brandingConfig && brandingConfig.authFooterLinks) {
40+
links = brandingConfig.authFooterLinks;
41+
}
42+
43+
const authFooterLinks = [];
44+
for (const linkEntry of links) {
45+
authFooterLinks.push(
46+
<a href={linkEntry.url} target="_blank" rel="noopener">{linkEntry.text}</a>,
47+
);
48+
}
49+
3050
return (
3151
<div className="mx_AuthFooter">
32-
<a href="https://medium.com/@RiotChat" target="_blank" rel="noopener">blog</a>
33-
<a href="https://twitter.com/@RiotChat" target="_blank" rel="noopener">twitter</a>
34-
<a href="https://github.com/vector-im/riot-web" target="_blank" rel="noopener">github</a>
52+
{authFooterLinks}
3553
<a href="https://matrix.org" target="_blank" rel="noopener">{ _t('powered by Matrix') }</a>
3654
</div>
3755
);

0 commit comments

Comments
 (0)