2017-05-04 05:49:50 +00:00
|
|
|
// @flow
|
2016-04-29 05:25:37 +00:00
|
|
|
import React from 'react';
|
2017-06-26 03:32:05 +00:00
|
|
|
import { observer } from 'mobx-react';
|
|
|
|
import styled from 'styled-components';
|
2016-06-05 01:28:14 +00:00
|
|
|
|
2017-06-26 03:32:05 +00:00
|
|
|
import DocumentList from 'components/DocumentList';
|
2017-06-26 02:21:08 +00:00
|
|
|
import PageTitle from 'components/PageTitle';
|
2016-05-07 18:52:08 +00:00
|
|
|
import CenteredContent from 'components/CenteredContent';
|
2017-06-26 03:32:05 +00:00
|
|
|
import RecentDocumentsStore from './RecentDocumentsStore';
|
2016-04-29 05:25:37 +00:00
|
|
|
|
2017-06-26 03:32:05 +00:00
|
|
|
const Subheading = styled.h3`
|
|
|
|
font-size: 11px;
|
|
|
|
font-weight: 500;
|
|
|
|
text-transform: uppercase;
|
|
|
|
color: #9FA6AB;
|
|
|
|
letter-spacing: 0.04em;
|
|
|
|
border-bottom: 1px solid #ddd;
|
|
|
|
padding-bottom: 10px;
|
|
|
|
`;
|
|
|
|
|
|
|
|
type Props = {};
|
2017-05-04 05:49:50 +00:00
|
|
|
|
2017-05-26 19:56:10 +00:00
|
|
|
@observer class Dashboard extends React.Component {
|
2017-05-04 05:49:50 +00:00
|
|
|
props: Props;
|
2017-06-26 03:32:05 +00:00
|
|
|
store: RecentDocumentsStore;
|
2016-06-07 07:24:10 +00:00
|
|
|
|
2017-06-26 03:32:05 +00:00
|
|
|
constructor(props: Props) {
|
|
|
|
super(props);
|
|
|
|
this.store = new RecentDocumentsStore();
|
|
|
|
}
|
2017-05-26 19:56:10 +00:00
|
|
|
|
2017-06-26 03:32:05 +00:00
|
|
|
componentDidMount() {
|
|
|
|
this.store.fetchDocuments();
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2016-06-27 06:15:32 +00:00
|
|
|
return (
|
2017-06-25 00:14:36 +00:00
|
|
|
<CenteredContent>
|
2017-06-26 02:21:08 +00:00
|
|
|
<PageTitle title="Home" />
|
|
|
|
<h1>Home</h1>
|
2017-06-26 03:32:05 +00:00
|
|
|
<Subheading>Recently viewed</Subheading>
|
|
|
|
<DocumentList documents={this.store.documents} />
|
|
|
|
|
2017-06-25 00:14:36 +00:00
|
|
|
</CenteredContent>
|
2016-06-27 06:15:32 +00:00
|
|
|
);
|
2016-04-29 05:25:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-26 03:32:05 +00:00
|
|
|
export default Dashboard;
|