Files
outline/frontend/scenes/Dashboard/Dashboard.js
Tom Moor 51d3191ac0 Renames
2017-05-26 22:31:39 -07:00

54 lines
1.2 KiB
JavaScript

// @flow
import React from 'react';
import { observer, inject } from 'mobx-react';
import { withRouter } from 'react-router-dom';
import { Flex } from 'reflexbox';
import DashboardStore from './DashboardStore';
import Layout from 'components/Layout';
import Collection from 'components/Collection';
import PreviewLoading from 'components/PreviewLoading';
import CenteredContent from 'components/CenteredContent';
type Props = {
user: Object,
router: Object,
};
@withRouter
@inject('user')
@observer
class Dashboard extends React.Component {
props: Props;
store: DashboardStore;
constructor(props: Props) {
super(props);
this.store = new DashboardStore({
team: props.user.team,
router: props.router,
});
}
render() {
return (
<Layout>
<CenteredContent>
<Flex column auto>
{this.store.isFetching
? <PreviewLoading />
: this.store.collections &&
this.store.collections.map(collection => (
<Collection key={collection.id} data={collection} />
))}
</Flex>
</CenteredContent>
</Layout>
);
}
}
export default Dashboard;