fix colour & hyperlink for home page header

This commit is contained in:
Matthew Hodgson 2017-06-08 12:06:45 +01:00
parent 0cbd5de1d3
commit cabbd16dd3
2 changed files with 14 additions and 2 deletions
res
src/components/structures

View File

@ -9,6 +9,7 @@
margin-bottom: 0px; margin-bottom: 0px;
margin-top: 20px; margin-top: 20px;
margin-right: 20px; margin-right: 20px;
color: #454545;
} }
.mx_HomePage_header h2 { .mx_HomePage_header h2 {
@ -16,6 +17,11 @@
margin-top: 5px; margin-top: 5px;
margin-bottom: 20px; margin-bottom: 20px;
margin-right: 20px; margin-right: 20px;
color: #454545;
}
.mx_HomePage_header h1 a {
color: #454545;
} }
.mx_HomePage h3 { .mx_HomePage h3 {
@ -26,7 +32,6 @@
border: 1px solid #76CFA6; border: 1px solid #76CFA6;
background-color: #eaf5f0; background-color: #eaf5f0;
border-radius: 5px; border-radius: 5px;
color: #454545;
align-items: center; align-items: center;
} }

View File

@ -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/, '<a href="https://riot.im">Riot.im</a>');
return s;
},
componentWillMount: function() { componentWillMount: function() {
if (this.props.teamToken && this.props.teamServerUrl) { if (this.props.teamToken && this.props.teamServerUrl) {
this.setState({ this.setState({
@ -66,7 +73,7 @@ module.exports = React.createClass({
this.setState({ page: "Couldn't load home page" }); 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 }); this.setState({ page: body });
} }
); );