Merge branch 'develop' into matthew/redesign

This commit is contained in:
Matthew Hodgson 2015-10-23 11:25:20 +01:00
commit baf777a418
4 changed files with 17 additions and 8 deletions

View File

@ -19,22 +19,22 @@ limitations under the License.
var React = require('react'); var React = require('react');
var EventAsTextTileController = require('matrix-react-sdk/lib/controllers/molecules/EventAsTextTile') var EventAsTextTileController = require('matrix-react-sdk/lib/controllers/molecules/EventAsTextTile')
var sdk = require('matrix-react-sdk')
var TextForEvent = require('matrix-react-sdk/lib/TextForEvent'); var TextForEvent = require('matrix-react-sdk/lib/TextForEvent');
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'EventAsTextTile', displayName: 'EventAsTextTile',
mixins: [EventAsTextTileController], mixins: [EventAsTextTileController],
render: function() { statics: {
var MessageTimestamp = sdk.getComponent('atoms.MessageTimestamp'); needsSenderProfile: function() {
var MemberAvatar = sdk.getComponent('atoms.MemberAvatar'); return false;
}
},
render: function() {
var text = TextForEvent.textForEvent(this.props.mxEvent); var text = TextForEvent.textForEvent(this.props.mxEvent);
if (text == null || text.length == 0) return null; if (text == null || text.length == 0) return null;
var timestamp = this.props.last ? <MessageTimestamp ts={this.props.mxEvent.getTs()} /> : null;
var avatar = this.props.mxEvent.sender ? <MemberAvatar member={this.props.mxEvent.sender} /> : null;
return ( return (
<div className="mx_EventAsTextTile"> <div className="mx_EventAsTextTile">
{TextForEvent.textForEvent(this.props.mxEvent)} {TextForEvent.textForEvent(this.props.mxEvent)}

View File

@ -114,8 +114,10 @@ module.exports = React.createClass({
</div> </div>
); );
} }
if (EventTileType.needsSenderProfile()) {
sender = <SenderProfile mxEvent={this.props.mxEvent} aux={aux} />; sender = <SenderProfile mxEvent={this.props.mxEvent} aux={aux} />;
} }
}
return ( return (
<div className={classes}> <div className={classes}>
{ avatar } { avatar }

View File

@ -28,6 +28,12 @@ module.exports = React.createClass({
displayName: 'MessageTile', displayName: 'MessageTile',
mixins: [MessageTileController], mixins: [MessageTileController],
statics: {
needsSenderProfile: function() {
return true;
}
},
render: function() { render: function() {
var UnknownMessageTile = sdk.getComponent('molecules.UnknownMessageTile'); var UnknownMessageTile = sdk.getComponent('molecules.UnknownMessageTile');

View File

@ -20,7 +20,8 @@ module.exports = {
// removed which gives a tree with matrix-react-sdk and vector // removed which gives a tree with matrix-react-sdk and vector
// trees smashed together, but this fixes everything being under // trees smashed together, but this fixes everything being under
// various levels of '.' and '..' // various levels of '.' and '..'
return info.resourcePath.replace(/^[\/\.]*/, ''); // Also, sometimes the resource path is absolute.
return path.relative(process.cwd(), info.resourcePath).replace(/^[\/\.]*/, '');
} }
}, },
resolve: { resolve: {