scratch-www/src/views/messages/message-rows/studio-activity.jsx

38 lines
1.2 KiB
React
Raw Normal View History

var classNames = require('classnames');
var FormattedMessage = require('react-intl').FormattedMessage;
var React = require('react');
var SocialMessage = require('../../../components/social-message/social-message.jsx');
var StudioActivityMessage = React.createClass({
type: 'StudioActivityMessage',
propTypes: {
studioId: React.PropTypes.number.isRequired,
studioTitle: React.PropTypes.string.isRequired,
datetimeCreated: React.PropTypes.string.isRequired
},
render: function () {
var studioLink = '/studios/' + this.props.studioId;
var classes = classNames(
'mod-studio-activity',
this.props.className
);
return (
<SocialMessage
className={classes}
datetime={this.props.datetimeCreated}
>
<FormattedMessage
id='messages.studioActivityText'
values={{
studioLink: <a href={studioLink}>{this.props.studioTitle}</a>
}}
/>
</SocialMessage>
);
}
});
module.exports = StudioActivityMessage;