WIP: Dashboard tabs

This commit is contained in:
Tom Moor
2018-08-09 23:14:51 -07:00
parent d222a311ad
commit 2f681b1ce8
9 changed files with 182 additions and 147 deletions

View File

@@ -24,7 +24,13 @@ type Props = {
};
function PublishingInfo({ collection, document }: Props) {
const { modifiedSinceViewed, updatedAt, updatedBy, publishedAt } = document;
const {
modifiedSinceViewed,
updatedAt,
updatedBy,
publishedAt,
isDraft,
} = document;
return (
<Container align="center">
@@ -35,20 +41,20 @@ function PublishingInfo({ collection, document }: Props) {
) : (
<React.Fragment>
{updatedBy.name}
{publishedAt ? (
<Modified highlight={modifiedSinceViewed}>
&nbsp;modified <Time dateTime={updatedAt} /> ago
</Modified>
) : (
{isDraft ? (
<span>
&nbsp;saved <Time dateTime={updatedAt} /> ago
</span>
) : (
<Modified highlight={modifiedSinceViewed}>
&nbsp;modified <Time dateTime={updatedAt} /> ago
</Modified>
)}
</React.Fragment>
)}
{collection && (
<span>
&nbsp;in <strong>{collection.name}</strong>
&nbsp;in <strong>{isDraft ? 'Drafts' : collection.name}</strong>
</span>
)}
</Container>