Add 'new document' menu to starred and drafts screens

This commit is contained in:
Tom Moor 2018-08-06 22:49:41 -07:00
parent 3334d783f3
commit 1c9c2d8e26
3 changed files with 19 additions and 1 deletions

View File

@ -4,8 +4,8 @@ import { observable } from 'mobx';
import { observer, inject } from 'mobx-react';
import { NewDocumentIcon } from 'outline-icons';
import NewDocumentMenu from 'menus/NewDocumentMenu';
import DocumentsStore from 'stores/DocumentsStore';
import NewDocumentMenu from 'menus/NewDocumentMenu';
import Actions, { Action } from 'components/Actions';
import CenteredContent from 'components/CenteredContent';
import DocumentList from 'components/DocumentList';

View File

@ -1,11 +1,15 @@
// @flow
import * as React from 'react';
import { observer, inject } from 'mobx-react';
import { NewDocumentIcon } from 'outline-icons';
import CenteredContent from 'components/CenteredContent';
import { ListPlaceholder } from 'components/LoadingPlaceholder';
import Empty from 'components/Empty';
import PageTitle from 'components/PageTitle';
import DocumentList from 'components/DocumentList';
import NewDocumentMenu from 'menus/NewDocumentMenu';
import Actions, { Action } from 'components/Actions';
import DocumentsStore from 'stores/DocumentsStore';
type Props = {
@ -30,6 +34,11 @@ class Drafts extends React.Component<Props> {
{showLoading && <ListPlaceholder />}
{showEmpty && <Empty>No drafts yet.</Empty>}
<DocumentList documents={drafts} showCollection />
<Actions align="center" justify="flex-end">
<Action>
<NewDocumentMenu label={<NewDocumentIcon />} />
</Action>
</Actions>
</CenteredContent>
);
}

View File

@ -1,11 +1,15 @@
// @flow
import * as React from 'react';
import { observer, inject } from 'mobx-react';
import { NewDocumentIcon } from 'outline-icons';
import CenteredContent from 'components/CenteredContent';
import { ListPlaceholder } from 'components/LoadingPlaceholder';
import Empty from 'components/Empty';
import PageTitle from 'components/PageTitle';
import DocumentList from 'components/DocumentList';
import NewDocumentMenu from 'menus/NewDocumentMenu';
import Actions, { Action } from 'components/Actions';
import DocumentsStore from 'stores/DocumentsStore';
type Props = {
@ -30,6 +34,11 @@ class Starred extends React.Component<Props> {
{showLoading && <ListPlaceholder />}
{showEmpty && <Empty>No starred documents yet.</Empty>}
<DocumentList documents={starred} />
<Actions align="center" justify="flex-end">
<Action>
<NewDocumentMenu label={<NewDocumentIcon />} />
</Action>
</Actions>
</CenteredContent>
);
}