scratch-www/src/views/splash/activity-rows/love-project.jsx
2018-01-30 11:53:12 -05:00

43 lines
1.3 KiB
JavaScript

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