From cabbd16dd3c8399a0f111b674aa6a6bc32dc4888 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 8 Jun 2017 12:06:45 +0100 Subject: [PATCH] fix colour & hyperlink for home page header --- res/home.html | 7 ++++++- src/components/structures/HomePage.js | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/res/home.html b/res/home.html index efe2da4b89..3072fcacb7 100644 --- a/res/home.html +++ b/res/home.html @@ -9,6 +9,7 @@ margin-bottom: 0px; margin-top: 20px; margin-right: 20px; + color: #454545; } .mx_HomePage_header h2 { @@ -16,6 +17,11 @@ margin-top: 5px; margin-bottom: 20px; margin-right: 20px; + color: #454545; +} + +.mx_HomePage_header h1 a { + color: #454545; } .mx_HomePage h3 { @@ -26,7 +32,6 @@ border: 1px solid #76CFA6; background-color: #eaf5f0; border-radius: 5px; - color: #454545; align-items: center; } diff --git a/src/components/structures/HomePage.js b/src/components/structures/HomePage.js index c646f1cebc..6e2bd51f26 100644 --- a/src/components/structures/HomePage.js +++ b/src/components/structures/HomePage.js @@ -45,6 +45,13 @@ module.exports = React.createClass({ }; }, + translate: function(s) { + s = sanitizeHtml(_t(s)); + // ugly fix for https://github.com/vector-im/riot-web/issues/4243 + s = s.replace(/Riot\.im/, 'Riot.im'); + return s; + }, + componentWillMount: function() { if (this.props.teamToken && this.props.teamServerUrl) { this.setState({ @@ -66,7 +73,7 @@ module.exports = React.createClass({ this.setState({ page: "Couldn't load home page" }); } - body = body.replace(/_t\(['"]([\s\S]*?)['"]\)/mg, (match, g1)=>{ return sanitizeHtml(_t(g1)) }); + body = body.replace(/_t\(['"]([\s\S]*?)['"]\)/mg, (match, g1)=>this.translate(g1)); this.setState({ page: body }); } );