Handle banned author display name

This commit is contained in:
Kimmo Puputti 2017-12-18 15:26:25 +02:00
parent cd952538e3
commit 1896448ba9
2 changed files with 6 additions and 3 deletions

View file

@ -12,7 +12,7 @@ import { types } from '../../util/sdkLoader';
import { createSlug } from '../../util/urlHelpers';
import { formatMoney } from '../../util/currency';
import { createResourceLocatorString, findRouteByRouteName } from '../../util/routes';
import { ensureListing, ensureUser, parseAddress } from '../../util/data';
import { ensureListing, ensureUser, parseAddress, userDisplayName } from '../../util/data';
import { getListingsById } from '../../ducks/marketplaceData.duck';
import { manageDisableScrolling, isScrollingDisabled } from '../../ducks/UI.duck';
import {
@ -281,8 +281,10 @@ export class ListingPageComponent extends Component {
const currentAuthor = authorAvailable ? currentListing.author : null;
const ensuredAuthor = ensureUser(currentAuthor);
// TODO: use helper to handle banned
const authorDisplayName = ensuredAuthor.attributes.profile.displayName;
const bannedUserDisplayName = intl.formatMessage({
id: 'ListingPage.bannedUserDisplayName',
});
const authorDisplayName = userDisplayName(ensuredAuthor, bannedUserDisplayName);
// TODO location address is currently serialized inside address field (API will change later)
// Content is something like { locationAddress: 'Street, Province, Country', building: 'A 42' };

View file

@ -226,6 +226,7 @@
"ListingCard.perNight": "per night",
"ListingCard.unsupportedPrice": "({currency})",
"ListingCard.unsupportedPriceTitle": "Unsupported currency ({currency})",
"ListingPage.bannedUserDisplayName": "Banned user",
"ListingPage.bookingHelp": "Start by choosing your dates.",
"ListingPage.bookingHelpClosedListing": "Sorry, this listing has been closed.",
"ListingPage.bookingTitle": "Book {title}",