diff --git a/src/components/Avatar/Avatar.js b/src/components/Avatar/Avatar.js index 3aac1327..226cee24 100644 --- a/src/components/Avatar/Avatar.js +++ b/src/components/Avatar/Avatar.js @@ -1,18 +1,16 @@ import React, { PropTypes } from 'react'; import classNames from 'classnames'; +import * as propTypes from '../../util/propTypes'; import css from './Avatar.css'; const Avatar = props => { - const { className, firstName, lastName, rootClassName } = props; + const { rootClassName, className, user } = props; const classes = classNames(rootClassName || css.root, className); - - const authorName = lastName ? `${firstName} ${lastName}` : firstName; - const initials = lastName ? firstName.charAt(0) + lastName.charAt(0) : firstName.charAt(0); - + const { displayName, abbreviatedName } = user.profile; const placeHolderAvatar = ( -
{message}
diff --git a/src/components/Topbar/Topbar.js b/src/components/Topbar/Topbar.js index 94d21297..d3537210 100644 --- a/src/components/Topbar/Topbar.js +++ b/src/components/Topbar/Topbar.js @@ -7,7 +7,7 @@ import { Button, Modal, NamedLink, TopbarDesktop, TopbarMobileMenu } from '../.. import { TopbarSearchForm } from '../../containers'; import { withFlattenedRoutes, withViewport } from '../../util/contextHelpers'; import { parse, stringify } from '../../util/urlHelpers'; -import { ensureUser } from '../../util/data'; +import { ensureCurrentUser } from '../../util/data'; import { createResourceLocatorString, pathByRouteName } from '../../util/routes'; import * as propTypes from '../../util/propTypes'; @@ -96,8 +96,7 @@ class TopbarComponent extends Component { location, onManageDisableScrolling, } = this.props; - const me = ensureUser(currentUser); - const profile = me.attributes.profile; + const me = ensureCurrentUser(currentUser); const { mobilemenu, mobilesearch, address, origin, bounds, country } = parse(location.search, { latlng: ['origin'], @@ -114,8 +113,7 @@ class TopbarComponent extends Component {