Move draft bubble inline with menu icons

This commit is contained in:
Tom Moor
2019-01-06 16:25:05 -08:00
parent b9765fb59e
commit a68ad856a3
2 changed files with 29 additions and 18 deletions

View File

@ -42,6 +42,8 @@ class MainSidebar extends React.Component<Props> {
const { user, team } = auth;
if (!user || !team) return null;
const draftDocumentsCount = documents.drafts.length;
return (
<Sidebar>
<AccountMenu
@ -72,15 +74,17 @@ class MainSidebar extends React.Component<Props> {
/>
<SidebarLink
to="/drafts"
icon={<EditIcon />}
icon={
draftDocumentsCount > 0 && draftDocumentsCount < 10 ? (
<Bubble count={draftDocumentsCount} />
) : (
<EditIcon />
)
}
label="Drafts"
active={
documents.active ? !documents.active.publishedAt : undefined
}
label={
<React.Fragment>
Drafts <Bubble count={documents.drafts.length} />
</React.Fragment>
}
/>
</Section>
<Section>