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 DocumentLink from './components/DocumentLink';
import styles from './AtlasPreview.scss'; import styles from './Collection.scss';
// import classNames from 'classnames/bind'; // import classNames from 'classnames/bind';
// const cx = classNames.bind(styles); // const cx = classNames.bind(styles);
@observer class AtlasPreview extends React.Component { @observer class Collection extends React.Component {
static propTypes = { static propTypes = {
data: React.PropTypes.object.isRequired, 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 store from './AtlasStore';
import Layout, { Title } from 'components/Layout'; import Layout, { Title } from 'components/Layout';
import AtlasPreviewLoading from 'components/AtlasPreviewLoading'; import PreviewLoading from 'components/PreviewLoading';
import CenteredContent from 'components/CenteredContent'; import CenteredContent from 'components/CenteredContent';
import DocumentList from 'components/DocumentList'; import DocumentList from 'components/DocumentList';
import Divider from 'components/Divider'; import Divider from 'components/Divider';
@ -86,7 +86,7 @@ class Atlas extends React.Component {
transitionLeaveTimeout={0} transitionLeaveTimeout={0}
> >
{store.isFetching {store.isFetching
? <AtlasPreviewLoading /> ? <PreviewLoading />
: collection && : collection &&
<div className={styles.container}> <div className={styles.container}>
<div className={styles.atlasDetails}> <div className={styles.atlasDetails}>

View File

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

View File

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