2017-06-26 00:21:33 +00:00
|
|
|
|
// @flow
|
2018-05-05 23:16:08 +00:00
|
|
|
|
import * as React from 'react';
|
2017-06-28 05:15:29 +00:00
|
|
|
|
import { observer, inject } from 'mobx-react';
|
2018-08-07 05:49:41 +00:00
|
|
|
|
|
2017-06-26 00:21:33 +00:00
|
|
|
|
import CenteredContent from 'components/CenteredContent';
|
2017-10-18 06:21:22 +00:00
|
|
|
|
import Empty from 'components/Empty';
|
2017-06-26 00:21:33 +00:00
|
|
|
|
import PageTitle from 'components/PageTitle';
|
2018-08-07 06:22:20 +00:00
|
|
|
|
import Heading from 'components/Heading';
|
2020-01-14 02:17:56 +00:00
|
|
|
|
import PaginatedDocumentList from 'components/PaginatedDocumentList';
|
2020-01-10 03:14:34 +00:00
|
|
|
|
import InputSearch from 'components/InputSearch';
|
2018-11-20 07:01:49 +00:00
|
|
|
|
import Tabs from 'components/Tabs';
|
|
|
|
|
import Tab from 'components/Tab';
|
2018-08-07 05:49:41 +00:00
|
|
|
|
import NewDocumentMenu from 'menus/NewDocumentMenu';
|
|
|
|
|
import Actions, { Action } from 'components/Actions';
|
2017-06-28 05:15:29 +00:00
|
|
|
|
import DocumentsStore from 'stores/DocumentsStore';
|
2017-06-26 00:21:33 +00:00
|
|
|
|
|
2018-05-05 23:16:08 +00:00
|
|
|
|
type Props = {
|
|
|
|
|
documents: DocumentsStore,
|
2018-11-20 07:01:49 +00:00
|
|
|
|
match: Object,
|
2018-05-05 23:16:08 +00:00
|
|
|
|
};
|
2017-06-26 00:21:33 +00:00
|
|
|
|
|
2018-05-05 23:16:08 +00:00
|
|
|
|
@observer
|
|
|
|
|
class Starred extends React.Component<Props> {
|
2017-06-26 00:21:33 +00:00
|
|
|
|
render() {
|
2020-01-14 02:17:56 +00:00
|
|
|
|
const { fetchStarred, starred, starredAlphabetical } = this.props.documents;
|
2018-11-20 07:01:49 +00:00
|
|
|
|
const { sort } = this.props.match.params;
|
2017-07-18 04:46:32 +00:00
|
|
|
|
|
2017-06-26 00:21:33 +00:00
|
|
|
|
return (
|
2017-06-26 02:21:08 +00:00
|
|
|
|
<CenteredContent column auto>
|
2017-06-26 00:21:33 +00:00
|
|
|
|
<PageTitle title="Starred" />
|
2018-08-07 06:22:20 +00:00
|
|
|
|
<Heading>Starred</Heading>
|
2020-01-14 02:17:56 +00:00
|
|
|
|
<PaginatedDocumentList
|
|
|
|
|
heading={
|
2018-11-20 07:01:49 +00:00
|
|
|
|
<Tabs>
|
|
|
|
|
<Tab to="/starred" exact>
|
|
|
|
|
Recently Updated
|
|
|
|
|
</Tab>
|
|
|
|
|
<Tab to="/starred/alphabetical" exact>
|
|
|
|
|
Alphabetical
|
|
|
|
|
</Tab>
|
|
|
|
|
</Tabs>
|
2020-01-14 02:17:56 +00:00
|
|
|
|
}
|
|
|
|
|
empty={<Empty>You’ve not starred any documents yet.</Empty>}
|
|
|
|
|
fetch={fetchStarred}
|
|
|
|
|
documents={sort === 'alphabetical' ? starredAlphabetical : starred}
|
|
|
|
|
showCollection
|
|
|
|
|
/>
|
|
|
|
|
|
2018-08-07 05:49:41 +00:00
|
|
|
|
<Actions align="center" justify="flex-end">
|
2020-01-10 03:14:34 +00:00
|
|
|
|
<Action>
|
|
|
|
|
<InputSearch />
|
|
|
|
|
</Action>
|
2018-08-07 05:49:41 +00:00
|
|
|
|
<Action>
|
2019-07-13 17:15:38 +00:00
|
|
|
|
<NewDocumentMenu />
|
2018-08-07 05:49:41 +00:00
|
|
|
|
</Action>
|
|
|
|
|
</Actions>
|
2017-06-26 02:21:08 +00:00
|
|
|
|
</CenteredContent>
|
2017-06-26 00:21:33 +00:00
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-28 05:15:29 +00:00
|
|
|
|
export default inject('documents')(Starred);
|