Merge pull request #117 from jorilallo/jori/document-author

Document author fixes
This commit is contained in:
Jori Lallo
2017-07-09 10:42:42 -07:00
committed by GitHub
3 changed files with 5 additions and 46 deletions

View File

@@ -1,43 +0,0 @@
// @flow
import React, { Component } from 'react';
import styled from 'styled-components';
import type { User } from 'types';
import { Flex } from 'reflexbox';
import _ from 'lodash';
const Container = styled(Flex)`
justify-content: space-between;
color: #bbb;
font-size: 13px;
`;
class AuthorInfo extends Component {
props: {
collaborators: Array<User>,
views: number,
};
render() {
const { collaborators, views } = this.props;
const users = _.takeRight(collaborators, 5).map((user, index, arr) => (
<span key={user.id}>
{user.name} {arr.length > 1 && (index < arr.length - 1 ? ',' : 'and')}
</span>
));
return (
<Container align="center">
Recently edited by
{' '}
{users}
{' '}
and viewed
{` ${views} `}
times.
</Container>
);
}
}
export default AuthorInfo;

View File

@@ -1,3 +0,0 @@
// @flow
import AuthorInfo from './AuthorInfo';
export default AuthorInfo;

View File

@@ -22,6 +22,11 @@ const Avatar = styled.img`
flex-shrink: 0; flex-shrink: 0;
border-radius: 50%; border-radius: 50%;
border: 2px solid #FFFFFF; border: 2px solid #FFFFFF;
margin-right: -13px;
&:first-child {
margin-right: 0;
}
`; `;
class PublishingInfo extends Component { class PublishingInfo extends Component {