This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/frontend/scenes/Dashboard/Dashboard.js

50 lines
1.1 KiB
JavaScript
Raw Normal View History

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';
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
@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-06-26 03:32:05 +00:00
componentDidMount() {
this.store.fetchDocuments();
}
render() {
return (
<CenteredContent>
<PageTitle title="Home" />
<h1>Home</h1>
2017-06-26 03:32:05 +00:00
<Subheading>Recently viewed</Subheading>
<DocumentList documents={this.store.documents} />
</CenteredContent>
);
2016-04-29 05:25:37 +00:00
}
}
2017-06-26 03:32:05 +00:00
export default Dashboard;