mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 05:00:43 +10:00
AuthorInfo was not updated previously
This commit is contained in:
parent
1dbbc4e66c
commit
0590a80549
2 changed files with 6 additions and 8 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue