Skip to content

Commit

Permalink
configure auth footer links through sdkconfig
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Jelten <jelten@in.tum.de>
  • Loading branch information
TheJJ committed Mar 27, 2019
1 parent e8ec6cc commit 014af75
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/components/views/auth/VectorAuthFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ limitations under the License.
'use strict';

const React = require('react');
import SdkConfig from 'matrix-react-sdk/lib/SdkConfig';

import { _t } from 'matrix-react-sdk/lib/languageHandler';

module.exports = React.createClass({
Expand All @@ -27,11 +29,27 @@ module.exports = React.createClass({
},

render: function() {
const brandingConfig = SdkConfig.get().branding;
let links = [
{"text": "blog", "url": "https://medium.com/@RiotChat"},
{"text": "twitter", "url": "https://twitter.com/@RiotChat"},
{"text": "github", "url": "https://github.com/vector-im/riot-web"}
];

if (brandingConfig && brandingConfig.welcomeLinks) {
links = brandingConfig.welcomeLinks;
}

const welcomeLinks = [];
for (const linkEntry of links) {
welcomeLinks.push(
<a href={linkEntry.url} target="_blank" rel="noopener">{linkEntry.text}</a>
);
}

return (
<div className="mx_AuthFooter">
<a href="https://medium.com/@RiotChat" target="_blank" rel="noopener">blog</a>
<a href="https://twitter.com/@RiotChat" target="_blank" rel="noopener">twitter</a>
<a href="https://github.com/vector-im/riot-web" target="_blank" rel="noopener">github</a>
{welcomeLinks}
<a href="https://matrix.org" target="_blank" rel="noopener">{ _t('powered by Matrix') }</a>
</div>
);
Expand Down

0 comments on commit 014af75

Please sign in to comment.