1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-04 11:51:45 +03:00

Merge pull request #77 from matrix-org/matthew/dynamic-svg

Make SVGs and CSS dynamically recolourable
This commit is contained in:
Matthew Hodgson
2016-01-07 11:42:30 +00:00
9 changed files with 320 additions and 35 deletions

View File

@@ -19,6 +19,8 @@ limitations under the License.
var React = require('react');
var filesize = require('filesize');
var MatrixClientPeg = require('../../../MatrixClientPeg');
var sdk = require('../../../index');
var dis = require("../../../dispatcher");
module.exports = React.createClass({
displayName: 'MFileBody',
@@ -52,12 +54,14 @@ module.exports = React.createClass({
var httpUrl = cli.mxcUrlToHttp(content.url);
var text = this.presentableTextForFile(content);
var TintableSvg = sdk.getComponent("elements.TintableSvg");
if (httpUrl) {
return (
<span className="mx_MFileBody">
<div className="mx_MImageBody_download">
<a href={cli.mxcUrlToHttp(content.url)} target="_blank">
<img src="img/download.png" width="10" height="12"/>
<TintableSvg src="img/download.svg" width="12" height="14"/>
Download {text}
</a>
</div>