diff --git a/src/components/AuthorInfo/AuthorInfo.js b/src/components/AuthorInfo/AuthorInfo.js index 21ae8b66..7a0ab6c8 100644 --- a/src/components/AuthorInfo/AuthorInfo.js +++ b/src/components/AuthorInfo/AuthorInfo.js @@ -3,25 +3,23 @@ import { FormattedMessage } from 'react-intl'; import classNames from 'classnames'; import { Avatar } from '../../components'; import * as propTypes from '../../util/propTypes'; +import { ensureUser } from '../../util/data'; import css from './AuthorInfo.css'; const AuthorInfo = props => { const { className, author } = props; const classes = classNames(css.root, className); - const currentAuthor = { id: null, type: 'user', attributes: {}, ...author }; - - const authorName = currentAuthor.attributes.profile - ? `${currentAuthor.attributes.profile.firstName} ${currentAuthor.attributes.profile.lastName}` - : ''; + const currentAuthor = ensureUser(author); + const { firstName, lastName } = currentAuthor.attributes.profile; return (