Removed unused component

This commit is contained in:
Jori Lallo
2017-07-01 16:51:12 -07:00
parent 7a2a7d8d59
commit 79f3d057ea
6 changed files with 0 additions and 175 deletions

View File

@@ -1,33 +0,0 @@
// @flow
import React from 'react';
import { toJS } from 'mobx';
import { observer } from 'mobx-react';
import PublishingInfo from '../PublishingInfo';
import styles from './Document.scss';
import DocumentHtml from './components/DocumentHtml';
import type { Document as DocumentType } from 'types';
@observer class Document extends React.Component {
props: {
document: DocumentType,
};
render() {
return (
<div className={styles.container}>
<PublishingInfo
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)}
/>
<DocumentHtml html={this.props.document.html} />
</div>
);
}
}
export default Document;

View File

@@ -1,6 +0,0 @@
@import '~styles/constants.scss';
.container {
width: 100%;
padding: 20px 20px 40px 20px;
}

View File

@@ -1,42 +0,0 @@
// @flow
import React, { PropTypes } from 'react';
import ReactDOM from 'react-dom';
import { observer } from 'mobx-react';
import styles from './DocumentHtml.scss';
@observer class DocumentHtml extends React.Component {
static propTypes = {
html: PropTypes.string.isRequired,
};
componentDidMount = () => {
this.setExternalLinks();
};
componentDidUpdate = () => {
this.setExternalLinks();
};
setExternalLinks = () => {
// $FlowFixMe
const links = ReactDOM.findDOMNode(this).querySelectorAll('a');
links.forEach(link => {
if (link.hostname !== window.location.hostname) {
// $FlowFixMe
link.target = '_blank'; // eslint-disable-line no-param-reassign
}
});
};
render() {
return (
<div
className={styles.document}
dangerouslySetInnerHTML={{ __html: this.props.html }}
/>
);
}
}
export default DocumentHtml;

View File

@@ -1,85 +0,0 @@
@import '~styles/constants.scss';
.document {
h1, h2, h3, h4, h5, h6 {
:global {
.anchor {
visibility: hidden;
color: $gray;
}
}
&:hover {
:global {
.anchor {
visibility: visible;
}
}
}
}
ul {
padding-left: 1.5em;
ul {
margin: 0;
}
}
// pre {
// box-shadow: 1px 1px 1px #f5f5f5;
// }
blockquote {
font-style: italic;
border-left: 2px solid $lightGray;
padding-left: 0.8em;
}
table {
width: 100%;
overflow: auto;
display: block;
border-spacing: 0;
border-collapse: collapse;
thead, tbody {
width: 100%;
}
thead {
tr {
border-bottom: 2px solid $lightGray;
}
}
tbody {
tr {
border-bottom: 1px solid $lightGray;
}
}
tr {
background-color: #fff;
// &:nth-child(2n) {
// background-color: #f8f8f8;
// }
}
th, td {
text-align: left;
border: 1px 0 solid $lightGray;
padding: 5px 20px 5px 0;
&:last-child {
padding-right: 0;
width: 100%;
}
}
th {
font-weight: bold;
}
}
}

View File

@@ -1,3 +0,0 @@
// @flow
import DocumentHtml from './DocumentHtml';
export default DocumentHtml;

View File

@@ -1,6 +0,0 @@
// @flow
import Document from './Document';
import DocumentHtml from './components/DocumentHtml';
export default Document;
export { DocumentHtml };