Add 'new document' menu to starred and drafts screens
This commit is contained in:
parent
3334d783f3
commit
1c9c2d8e26
|
@ -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';
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
Reference in New Issue