scratch-www/src/views/splash/activity-rows/love-project.jsx
Matthew Taylor 91a0e865ad Use new activity endpoint
This also moves homepage row retrieval into redux to further move towards using redux to handle functionality. This implements #1628.
2017-11-15 12:49:23 -05:00

45 lines
1.5 KiB
JavaScript

var classNames = require('classnames');
var FormattedMessage = require('react-intl').FormattedMessage;
var React = require('react');
var SocialMessage = require('../../../components/social-message/social-message.jsx');
var LoveProjectMessage = React.createClass({
type: 'LoveProjectMessage',
propTypes: {
actorUsername: React.PropTypes.string.isRequired,
projectId: React.PropTypes.number.isRequired,
projectTitle: React.PropTypes.string.isRequired,
loveDateTime: React.PropTypes.string.isRequired
},
render: function () {
var projectLink = '/projects/' + this.props.projectId;
var profileLink = '/users/' + this.props.actorUsername;
var classes = classNames(
'mod-love-project',
this.props.className
);
return (
<SocialMessage
as="div"
className={classes}
datetime={this.props.loveDateTime}
>
<FormattedMessage
id='messages.loveText'
values={{
profileLink: <a
href={profileLink}
>
{this.props.actorUsername}
</a>,
projectLink: <a href={projectLink}>{this.props.projectTitle}</a>
}}
/>
</SocialMessage>
);
}
});
module.exports = LoveProjectMessage;