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/app/scenes/Starred.js

63 lines
1.8 KiB
JavaScript
Raw Normal View History

// @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';
import CenteredContent from 'components/CenteredContent';
import Empty from 'components/Empty';
import PageTitle from 'components/PageTitle';
2018-08-07 06:22:20 +00:00
import Heading from 'components/Heading';
import PaginatedDocumentList from 'components/PaginatedDocumentList';
import InputSearch from 'components/InputSearch';
import Tabs from 'components/Tabs';
import Tab from 'components/Tab';
import NewDocumentMenu from 'menus/NewDocumentMenu';
import Actions, { Action } from 'components/Actions';
2017-06-28 05:15:29 +00:00
import DocumentsStore from 'stores/DocumentsStore';
2018-05-05 23:16:08 +00:00
type Props = {
documents: DocumentsStore,
match: Object,
2018-05-05 23:16:08 +00:00
};
2018-05-05 23:16:08 +00:00
@observer
class Starred extends React.Component<Props> {
render() {
const { fetchStarred, starred, starredAlphabetical } = this.props.documents;
const { sort } = this.props.match.params;
return (
<CenteredContent column auto>
<PageTitle title="Starred" />
2018-08-07 06:22:20 +00:00
<Heading>Starred</Heading>
<PaginatedDocumentList
heading={
<Tabs>
<Tab to="/starred" exact>
Recently Updated
</Tab>
<Tab to="/starred/alphabetical" exact>
Alphabetical
</Tab>
</Tabs>
}
empty={<Empty>Youve not starred any documents yet.</Empty>}
fetch={fetchStarred}
documents={sort === 'alphabetical' ? starredAlphabetical : starred}
showCollection
/>
<Actions align="center" justify="flex-end">
<Action>
<InputSearch />
</Action>
<Action>
<NewDocumentMenu />
</Action>
</Actions>
</CenteredContent>
);
}
}
2017-06-28 05:15:29 +00:00
export default inject('documents')(Starred);