diff --git a/skins/base/css/molecules/HealthDemoTile.css b/skins/base/css/molecules/HealthDemoTile.css new file mode 100644 index 0000000000..8e11459e6a --- /dev/null +++ b/skins/base/css/molecules/HealthDemoTile.css @@ -0,0 +1,38 @@ +/* +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. +*/ + +.mx_HealthDemoTile { + border: 1px solid black; + width: 200px; + height: 70px; + margin: 5px; + background-color: #ddd; + padding: 5px; + margin-top: 20px; +} + +.mx_HealthDemoTile .mx_HealthDemoTile_ts { + display: block; + text-align: right; + font-size: 85%; +} + +.mx_HealthDemoTile_content { + text-align: right; + font-size: 200%; + font-weight: bold; +} + diff --git a/skins/base/views/molecules/HealthDemoTile.js b/skins/base/views/molecules/HealthDemoTile.js new file mode 100644 index 0000000000..509aa61179 --- /dev/null +++ b/skins/base/views/molecules/HealthDemoTile.js @@ -0,0 +1,53 @@ +/* +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 = ; + + var imgStyle = { float: 'left' }; + + return ( +
+ +
+ {timeStr} + + {this.props.mxEvent.getContent().bpm} bpm + +
+
+ ); + }, +}); + diff --git a/src/ComponentBroker.js b/src/ComponentBroker.js index 61499defc7..205b622da5 100644 --- a/src/ComponentBroker.js +++ b/src/ComponentBroker.js @@ -109,6 +109,7 @@ require('../skins/base/views/molecules/voip/VideoView'); require('../skins/base/views/molecules/voip/CallView'); require('../skins/base/views/molecules/voip/IncomingCallBox'); require('../skins/base/views/molecules/EventAsTextTile'); +require('../skins/base/views/molecules/HealthDemoTile'); require('../skins/base/views/molecules/MemberInfo'); require('../skins/base/views/organisms/ErrorDialog'); require('../skins/base/views/organisms/QuestionDialog'); diff --git a/src/controllers/molecules/HealthDemoTile.js b/src/controllers/molecules/HealthDemoTile.js new file mode 100644 index 0000000000..8aa688b21e --- /dev/null +++ b/src/controllers/molecules/HealthDemoTile.js @@ -0,0 +1,21 @@ +/* +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'; + +module.exports = { +}; + diff --git a/src/controllers/organisms/RoomView.js b/src/controllers/organisms/RoomView.js index d3feff69f6..b134117f24 100644 --- a/src/controllers/organisms/RoomView.js +++ b/src/controllers/organisms/RoomView.js @@ -41,6 +41,7 @@ var tileTypes = { 'm.call.answer' : ComponentBroker.get('molecules/EventAsTextTile'), 'm.call.hangup' : ComponentBroker.get('molecules/EventAsTextTile'), 'm.room.topic' : ComponentBroker.get('molecules/EventAsTextTile'), + 'org.matrix.demo.health' : ComponentBroker.get('molecules/HealthDemoTile'), }; var DateSeparator = ComponentBroker.get('molecules/DateSeparator');