2016-05-20 16:02:39 +00:00
|
|
|
import React from 'react';
|
2016-08-15 19:41:41 +00:00
|
|
|
import { toJS } from 'mobx';
|
2016-05-22 23:12:17 +00:00
|
|
|
import { Link } from 'react-router';
|
2016-05-20 16:02:39 +00:00
|
|
|
|
2016-05-22 23:12:17 +00:00
|
|
|
import styles from './DocumentPreview.scss';
|
|
|
|
|
2017-05-10 07:02:11 +00:00
|
|
|
import PublishingInfo from 'components/PublishingInfo';
|
|
|
|
|
2016-05-22 23:12:17 +00:00
|
|
|
class Document extends React.Component {
|
2016-05-20 16:02:39 +00:00
|
|
|
static propTypes = {
|
|
|
|
document: React.PropTypes.object.isRequired,
|
2017-04-28 04:48:13 +00:00
|
|
|
};
|
2016-05-20 16:02:39 +00:00
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2017-04-28 04:48:13 +00:00
|
|
|
<div className={styles.container}>
|
2016-05-22 23:12:17 +00:00
|
|
|
<PublishingInfo
|
2017-04-28 04:48:13 +00:00
|
|
|
createdAt={this.props.document.createdAt}
|
|
|
|
createdBy={this.props.document.createdBy}
|
|
|
|
updatedAt={this.props.document.updatedAt}
|
|
|
|
updatedBy={this.props.document.updatedBy}
|
|
|
|
collaborators={toJS(this.props.document.collaborators)}
|
2016-05-22 23:12:17 +00:00
|
|
|
/>
|
|
|
|
|
2017-04-28 04:48:13 +00:00
|
|
|
<Link to={this.props.document.url} className={styles.title}>
|
|
|
|
<h2>{this.props.document.title}</h2>
|
2016-05-22 23:12:17 +00:00
|
|
|
</Link>
|
|
|
|
|
2017-04-28 04:48:13 +00:00
|
|
|
<div
|
|
|
|
dangerouslySetInnerHTML={{ __html: this.props.document.preview }}
|
|
|
|
/>
|
2016-05-22 23:12:17 +00:00
|
|
|
|
|
|
|
<div>
|
2017-04-28 04:48:13 +00:00
|
|
|
<Link to={this.props.document.url} className={styles.continueLink}>
|
2016-05-22 23:12:17 +00:00
|
|
|
Continue reading...
|
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-05-20 16:02:39 +00:00
|
|
|
);
|
|
|
|
}
|
2016-08-15 19:41:41 +00:00
|
|
|
}
|
2016-05-20 16:02:39 +00:00
|
|
|
|
2016-05-22 23:12:17 +00:00
|
|
|
export default Document;
|