From 5a051824c052f39d226c68a764c1d410310fd185 Mon Sep 17 00:00:00 2001 From: Jonas Jelten Date: Wed, 27 Mar 2019 13:34:20 +0100 Subject: [PATCH] configure auth footer links through sdkconfig Signed-off-by: Jonas Jelten --- README.md | 2 ++ src/components/views/auth/VectorAuthFooter.js | 24 ++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 16f41fcb..24c3f8c8 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,8 @@ For a good example, see https://riot.im/develop/config.json. during authentication flows 1. `authHeaderLogoUrl`: An logo image that is shown in the header during authentication flows + 1. `authFooterLinks`: a list of links to show in the authentication page footer: + `[{"text": "Link text", "url": "https://link.target"}, {"text": "Other link", ...}]` 1. `integrations_ui_url`: URL to the web interface for the integrations server. The integrations server is not Riot and normally not your homeserver either. The integration server settings may be left blank to disable integrations. diff --git a/src/components/views/auth/VectorAuthFooter.js b/src/components/views/auth/VectorAuthFooter.js index 64674853..acc75278 100644 --- a/src/components/views/auth/VectorAuthFooter.js +++ b/src/components/views/auth/VectorAuthFooter.js @@ -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({ @@ -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.authFooterLinks) { + links = brandingConfig.authFooterLinks; + } + + const authFooterLinks = []; + for (const linkEntry of links) { + authFooterLinks.push( + {linkEntry.text}, + ); + } + return (
- blog - twitter - github + {authFooterLinks} { _t('powered by Matrix') }
);