Skip to content

Commit

Permalink
Merge pull request #772 from CityOfDetroit/chore/remove-special-needs…
Browse files Browse the repository at this point in the history
…-icon

chore: remove "special needs" from image tags
  • Loading branch information
plunkettgoogle authored Nov 16, 2021
2 parents dedf51b + 5cbb2a2 commit 8f59e83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
13 changes: 10 additions & 3 deletions sites/public/lib/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ const getListingCardSubtitle = (address: Address) => {
return address ? `${street}, ${city} ${state}, ${zipCode}` : null
}

// TODO(#773): Determine the best way of surfacing accessibility-related
// information in listing views.
export const getImageTagFromListing = (listing: Listing) => {
const reservedCommunityTypeName = listing.reservedCommunityType?.name
return reservedCommunityTypeName && reservedCommunityTypeName !== "specialNeeds"
? t(`listings.reservedCommunityTypes.${listing.reservedCommunityType.name}`)
: undefined
}

const getListingTableData = (listing: Listing) => {
if (listing.unitsSummary !== undefined && listing.unitsSummary.length > 0) {
return getSummariesTableFromUnitsSummary(listing.unitsSummary)
Expand All @@ -65,9 +74,7 @@ export const getListings = (listings) => {
subtitle: getListingCardSubtitle(listing.buildingAddress),
title: listing.name,
href: `/listing/${listing.id}/${listing.urlSlug}`,
tagLabel: listing.reservedCommunityType
? t(`listings.reservedCommunityTypes.${listing.reservedCommunityType.name}`)
: undefined,
tagLabel: getImageTagFromListing(listing),
}}
tableProps={{
headers: unitSummariesHeaders,
Expand Down
8 changes: 2 additions & 6 deletions sites/public/src/ListingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
Message,
} from "@bloom-housing/ui-components"
import { ErrorPage } from "../pages/_error"
import { getGenericAddress, openInFuture } from "../lib/helpers"
import { getGenericAddress, getImageTagFromListing, openInFuture } from "../lib/helpers"

interface ListingProps {
listing: Listing
Expand Down Expand Up @@ -241,11 +241,7 @@ export const ListingView = (props: ListingProps) => {
<ImageCard
title={listing.name}
imageUrl={imageUrlFromListing(listing, parseInt(process.env.listingPhotoSize))}
tagLabel={
listing.reservedCommunityType
? t(`listings.reservedCommunityTypes.${props.listing.reservedCommunityType.name}`)
: undefined
}
tagLabel={getImageTagFromListing(listing)}
/>
<div className="p-3">
<p className="font-alt-sans uppercase tracking-widest text-sm font-semibold">
Expand Down

0 comments on commit 8f59e83

Please sign in to comment.