mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-01-09 14:02:10 -05:00
91a0e865ad
This also moves homepage row retrieval into redux to further move towards using redux to handle functionality. This implements #1628.
45 lines
1.5 KiB
JavaScript
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;
|