@@ -49,7 +49,9 @@ export type ListingSeoCopy = {
4949type ListingDisplayNameCopy = Pick <
5050 ListingSeoCopy ,
5151 "privateHostName" | "fallbackListingName"
52- > ;
52+ > & {
53+ privateHostAvatarAlt ?: string ;
54+ } ;
5355
5456type ListingSeoOptions = {
5557 locale ?: string ;
@@ -258,7 +260,8 @@ export function getListingDisplayName(
258260
259261export function getListingAvatar (
260262 listing : ListingLike | null | undefined ,
261- user : ListingUser
263+ user : ListingUser ,
264+ seoCopy : ListingDisplayNameCopy = defaultListingSeoCopy
262265) : AvatarDescriptor {
263266 if ( ! listing ) return null ;
264267
@@ -276,21 +279,23 @@ export function getListingAvatar(
276279 } ;
277280 }
278281
279- const listingDisplayName = getListingDisplayName ( listing , user ) ;
282+ const listingDisplayName = getListingDisplayName ( listing , user , seoCopy ) ;
280283
281284 if ( isSensitiveAnonymousListing ( listingType , user ) ) {
282285 return {
283286 bucket : "public" ,
284287 filename : "avatars/default/private.jpg" ,
285- alt : "A blurred avatar for Private Host. Sign in to see their full information." ,
288+ alt :
289+ seoCopy . privateHostAvatarAlt ??
290+ `A blurred avatar for ${ seoCopy . privateHostName } . Sign in to see their full information.` ,
286291 } ;
287292 }
288293
289294 if ( listingType === "residential" ) {
290295 return {
291296 bucket : "avatars" ,
292297 filename : listing . owner_avatar || null ,
293- alt : `${ listing . owner_first_name || "Private Host" } avatar` ,
298+ alt : `${ listing . owner_first_name || seoCopy . privateHostName } avatar` ,
294299 } ;
295300 }
296301
@@ -388,8 +393,12 @@ export function generateListingDescription(
388393 const listingDisplayName = getListingDisplayName ( listing , user , seoCopy ) ;
389394 const listingType = normaliseListingType ( listing . type ) ;
390395 const isSensitiveAnonymous = isSensitiveAnonymousListing ( listingType , user ) ;
396+ const shouldUseResidentialIntro =
397+ listingType === "residential" || isSensitiveAnonymous ;
398+ const shouldOmitListingDescription =
399+ listingType === "residential" || isSensitiveAnonymous ;
391400 const listingFullLocation = getListingLocation ( listing , options . locale ) ;
392- const listingIntro = isSensitiveAnonymous
401+ const listingIntro = shouldUseResidentialIntro
393402 ? seoCopy . residentialIntro ( {
394403 name : listingDisplayName ,
395404 location : listingFullLocation || undefined ,
@@ -403,7 +412,7 @@ export function generateListingDescription(
403412 : listing . name || listingDisplayName ;
404413 const listingDescriptionParts = [
405414 listingIntro ,
406- isSensitiveAnonymous
415+ shouldOmitListingDescription
407416 ? null
408417 : listing . description ?. trim ( )
409418 ? listing . description . trim ( )
0 commit comments