AuthorInfo was not updated previously

This commit is contained in:
Vesa Luusua 2017-06-08 12:40:40 +03:00
parent 1dbbc4e66c
commit 0590a80549
2 changed files with 6 additions and 8 deletions

View file

@ -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 (
<div className={classes}>
<div className={css.avatarWrapper}>
<Avatar name={authorName} />
<Avatar firstName={firstName} lastName={lastName} />
</div>
<div className={css.authorDetails}>
<span className={css.authorName}>
<FormattedMessage id="AuthorInfo.host" values={{ authorName }} />
<FormattedMessage id="AuthorInfo.host" values={{ firstName, lastName }} />
</span>
</div>
</div>

View file

@ -7,7 +7,7 @@
"AuthenticationPage.signupFailedEmailAlreadyTaken": "An account already exists with this email address. Try logging in instead.",
"AuthenticationPage.signupLinkText": "Sign up",
"AuthenticationPage.signupPageTitle": "Sign up",
"AuthorInfo.host": "Hosted by {authorName}",
"AuthorInfo.host": "Hosted by {firstName} {lastName}",
"BookingDatesForm.bookingEndTitle": "End date",
"BookingDatesForm.bookingStartTitle": "Start date",
"BookingDatesForm.placeholder": "mm/dd/yyyy",