2018-10-03 10:11:44 -07:00
|
|
|
import React from 'react';
|
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
import moment from 'moment';
|
2018-10-04 21:27:02 -07:00
|
|
|
import { UserComment } from 'types';
|
2019-03-05 09:35:40 -08:00
|
|
|
import Markdown from 'components/Markdown';
|
|
|
|
import { MARKDOWN_TYPE } from 'utils/markdown';
|
2018-10-03 10:11:44 -07:00
|
|
|
import './ProfileComment.less';
|
|
|
|
|
|
|
|
interface OwnProps {
|
|
|
|
comment: UserComment;
|
|
|
|
userName: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default class Profile extends React.Component<OwnProps> {
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
userName,
|
2018-11-14 09:59:48 -08:00
|
|
|
comment: { content, proposal, dateCreated },
|
2018-10-03 10:11:44 -07:00
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="ProfileComment">
|
|
|
|
<div className="ProfileComment-head">
|
|
|
|
<span className="ProfileComment-head-name">{userName}</span> commented on{' '}
|
|
|
|
<Link
|
|
|
|
to={`/proposals/${proposal.proposalId}`}
|
|
|
|
className="ProfileComment-head-proposal"
|
|
|
|
>
|
|
|
|
{proposal.title}
|
|
|
|
</Link>{' '}
|
|
|
|
{moment(dateCreated).from(Date.now())}
|
|
|
|
</div>
|
2019-03-05 09:35:40 -08:00
|
|
|
<Markdown source={content} type={MARKDOWN_TYPE.REDUCED} />
|
2018-10-03 10:11:44 -07:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|