forked from matrix/element-web
54 lines
3.2 KiB
JavaScript
54 lines
3.2 KiB
JavaScript
/*
|
|
Copyright 2015 OpenMarket Ltd
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var React = require('react');
|
|
|
|
var MatrixClientPeg = require("../../../../src/MatrixClientPeg");
|
|
var HealthDemoTileController = require("../../../../src/controllers/molecules/HealthDemoTile");
|
|
var ComponentBroker = require('../../../../src/ComponentBroker');
|
|
var MessageTimestamp = ComponentBroker.get('atoms/MessageTimestamp');
|
|
var MemberAvatar = ComponentBroker.get('atoms/MemberAvatar');
|
|
var TextForEvent = require("../../../../src/TextForEvent");
|
|
|
|
module.exports = React.createClass({
|
|
displayName: 'HealthDemoTile',
|
|
mixins: [HealthDemoTileController],
|
|
|
|
render: function() {
|
|
var ts = this.props.mxEvent.getContent().ts;
|
|
var date = new Date(ts*1000);
|
|
var timeStr = date.toLocaleDateString() + ' ' + date.toLocaleTimeString();
|
|
//var timestamp = <MessageTimestamp ts={this.props.mxEvent.getContent().ts} />;
|
|
|
|
var imgStyle = { float: 'left' };
|
|
|
|
return (
|
|
<div className="mx_HealthDemoTile">
|
|
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wgSDys3IE3P1AAAA2lJREFUWMPNmMuLFUcUxn+n03ONzkRNxOhERQQfgxhXBhNiFB+ICxdZCSJkJbVS0LUIbgyBgLMQRAr8N1xIR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GzvhTlwr9lXgAAAABJRU5ErkJggg==" style={imgStyle} />
|
|
<div>
|
|
<span className="mx_HealthDemoTile_ts">{timeStr}</span>
|
|
<span className="mx_HealthDemoTile_content">
|
|
{this.props.mxEvent.getContent().bpm} bpm
|
|
</span>
|
|
</div>
|
|
</div>
|
|
);
|
|
},
|
|
});
|
|
|