This commit is contained in:
Tom Moor
2017-05-26 22:31:39 -07:00
parent 0e293b38c7
commit 51d3191ac0
13 changed files with 27 additions and 31 deletions

View File

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

View File

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

View File

@ -5,11 +5,11 @@ import { Link } from 'react-router-dom';
import DocumentLink from './components/DocumentLink';
import styles from './AtlasPreview.scss';
import styles from './Collection.scss';
// import classNames from 'classnames/bind';
// const cx = classNames.bind(styles);
@observer class AtlasPreview extends React.Component {
@observer class Collection extends React.Component {
static propTypes = {
data: React.PropTypes.object.isRequired,
};
@ -37,4 +37,4 @@ import styles from './AtlasPreview.scss';
}
}
export default AtlasPreview;
export default Collection;

View File

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

View File

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

View File

@ -9,7 +9,7 @@ import _ from 'lodash';
import store from './AtlasStore';
import Layout, { Title } from 'components/Layout';
import AtlasPreviewLoading from 'components/AtlasPreviewLoading';
import PreviewLoading from 'components/PreviewLoading';
import CenteredContent from 'components/CenteredContent';
import DocumentList from 'components/DocumentList';
import Divider from 'components/Divider';
@ -86,7 +86,7 @@ class Atlas extends React.Component {
transitionLeaveTimeout={0}
>
{store.isFetching
? <AtlasPreviewLoading />
? <PreviewLoading />
: collection &&
<div className={styles.container}>
<div className={styles.atlasDetails}>

View File

@ -7,8 +7,8 @@ import { Flex } from 'reflexbox';
import DashboardStore from './DashboardStore';
import Layout from 'components/Layout';
import AtlasPreview from 'components/AtlasPreview';
import AtlasPreviewLoading from 'components/AtlasPreviewLoading';
import Collection from 'components/Collection';
import PreviewLoading from 'components/PreviewLoading';
import CenteredContent from 'components/CenteredContent';
type Props = {
@ -34,22 +34,18 @@ class Dashboard extends React.Component {
render() {
return (
<Flex auto>
<Layout>
<CenteredContent>
<Flex column auto>
{this.store.isFetching
? <AtlasPreviewLoading />
? <PreviewLoading />
: this.store.collections &&
this.store.collections.map(collection => {
return (
<AtlasPreview key={collection.id} data={collection} />
);
})}
this.store.collections.map(collection => (
<Collection key={collection.id} data={collection} />
))}
</Flex>
</CenteredContent>
</Layout>
</Flex>
);
}
}

View File

@ -12,7 +12,7 @@ import Menu from './components/Menu';
import Editor from 'components/Editor';
import Layout, { HeaderAction, SaveAction } from 'components/Layout';
import PublishingInfo from 'components/PublishingInfo';
import AtlasPreviewLoading from 'components/AtlasPreviewLoading';
import PreviewLoading from 'components/PreviewLoading';
import CenteredContent from 'components/CenteredContent';
const DISCARD_CHANGES = `
@ -138,7 +138,7 @@ type Props = {
<Prompt when={this.store.hasPendingChanges} message={DISCARD_CHANGES} />
{this.store.isFetching &&
<CenteredContent>
<AtlasPreviewLoading />
<PreviewLoading />
</CenteredContent>}
{this.store.document &&
<Container>