This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
outline/frontend/components/Document/Document.js
2016-07-24 15:32:31 -07:00

45 lines
1006 B
JavaScript

import React from 'react';
import { observer } from 'mobx-react';
import moment from 'moment';
import { Link } from 'react-router';
import PublishingInfo from 'components/PublishingInfo';
import styles from './Document.scss';
const DocumentHtml = observer((props) => {
return (
<div
className={ styles.document }
dangerouslySetInnerHTML={{ __html: props.html }}
{ ...props }
/>
);
});
@observer
class Document extends React.Component {
static propTypes = {
document: React.PropTypes.object.isRequired,
}
render() {
return (
<div className={ styles.container }>
<PublishingInfo
name={ this.props.document.user.name }
avatarUrl={ this.props.document.user.avatarUrl }
createdAt={ this.props.document.createdAt }
updatedAt={ this.props.document.updatedAt }
/>
<DocumentHtml html={ this.props.document.html } />
</div>
);
}
};
export default Document;
export {
DocumentHtml
};