Update Rel date and hide Territory low income for Donut holes

This commit is contained in:
Carlos Felix 2024-12-20 11:43:57 -05:00 committed by Carlos Felix
commit f79d9afb2f
12 changed files with 31 additions and 35 deletions

View file

@ -1025,6 +1025,17 @@ const AreaDetail = ({properties}: IAreaDetailProps) => {
categories[0].indicators = [lowMedInc, unemploy, poverty];
}
const isTerritory = constants.TILES_ISLAND_AREA_FIPS_CODES.some((code) => {
return properties[constants.GEOID_PROPERTY].startsWith(code);
});
const isGrandfathered = properties[constants.IS_GRANDFATHERED];
// Show Donut information !isGrandfathered
const showDonutCopy = !isGrandfathered &&
properties[constants.ADJACENCY_EXCEEDS_THRESH] &&
properties[constants.TOTAL_NUMBER_OF_DISADVANTAGE_INDICATORS] === 0;
const showIslandCopy = isTerritory && !showDonutCopy;
/**
* Create the AccoridionItems by mapping over the categories array. In this array we define the
* various indicators for a specific category. This is an array which then maps over the
@ -1065,12 +1076,6 @@ const AreaDetail = ({properties}: IAreaDetailProps) => {
{EXPLORE_COPY.SIDE_PANEL_SPACERS.AND}
</div>
{/* Exceeds both socioeconomic burdens */}
{/* <ExceedBurden
text={EXPLORE_COPY.SIDE_PANEL_SPACERS.EXCEED_BOTH_SOCIO}
isBurdened={category.isExceedBothSocioBurdens}
/> */}
{/* socioeconomic indicators */}
{category.socioEcIndicators.map((indicator: any, index: number) => {
return (
@ -1192,27 +1197,18 @@ const AreaDetail = ({properties}: IAreaDetailProps) => {
</div>
</div>
{/* Show IslandCopy if the GeoID matches an island prefix */}
{constants.TILES_ISLAND_AREA_FIPS_CODES.some((code) => {
return properties[constants.GEOID_PROPERTY].startsWith(code);
}) && (
<IslandCopy povertyPercentile={ properties[constants.CENSUS_DECENNIAL_POVERTY_LESS_THAN_200_FPL_PERCENTILE]} />
)}
{/* Only show the DonutCopy if Adjacency index is true, the total number of disadv ind == 0,
and not grandfathered. */}
{properties[constants.ADJACENCY_EXCEEDS_THRESH] &&
properties[constants.TOTAL_NUMBER_OF_DISADVANTAGE_INDICATORS] === 0 &&
!properties[constants.IS_GRANDFATHERED] && (
{showIslandCopy &&
<IslandCopy povertyPercentile={properties[constants.CENSUS_DECENNIAL_POVERTY_LESS_THAN_200_FPL_PERCENTILE]} />}
{showDonutCopy &&
<DonutCopy
isAdjacent={properties[constants.ADJACENCY_EXCEEDS_THRESH]}
povertyBelow200Percentile={
properties[constants.POVERTY_BELOW_200_PERCENTILE] > 0 ?
properties[constants.POVERTY_BELOW_200_PERCENTILE] :
null
properties[constants.POVERTY_BELOW_200_PERCENTILE] > 0 ?
properties[constants.POVERTY_BELOW_200_PERCENTILE] :
null
}
/>
)}
}
{/* Send Feedback button */}
<a