Add display text for island territories marked disadvantaged for low income

This commit is contained in:
Ryon Coleman 2024-11-20 12:23:08 -05:00 committed by Carlos Felix
commit 2c1fec5317
6 changed files with 69 additions and 35 deletions

View file

@ -1146,6 +1146,12 @@ const AreaDetail = ({properties}: IAreaDetailProps) => {
isAdjacencyLowIncome={
properties[constants.ADJACENCY_LOW_INCOME_EXCEEDS_THRESH]
}
isIslandLowIncome={
properties[constants.IS_FEDERAL_POVERTY_LEVEL_200] &&
constants.TILES_ISLAND_AREA_FIPS_CODES.some((code) => {
return properties[constants.GEOID_PROPERTY].startsWith(code);
})
}
tribalCountAK={
properties[constants.TRIBAL_AREAS_COUNT_AK] >= 1 ?
properties[constants.TRIBAL_AREAS_COUNT_AK] :

View file

@ -9,6 +9,7 @@ interface IPrioritizationCopy {
totalBurdensPrioritized: number
isAdjacencyThreshMet: boolean,
isAdjacencyLowIncome: boolean,
isIslandLowIncome: boolean,
tribalCountAK: number | null,
tribalCountUS: null, // when this signal is supported add number type
percentTractTribal: number | null
@ -26,6 +27,7 @@ interface IPrioritizationCopy {
* @param {number} totalBurdensPrioritized
* @param {boolean} isAdjacencyThreshMet
* @param {boolean} isAdjacencyLowIncome
* @param {boolean} isIslandLowIncome
* @param {number | null} tribalCountAK
* @param {number | null} tribalCountUS
* @param {number | null} percentTractTribal
@ -36,6 +38,7 @@ const PrioritizationCopy =
totalBurdensPrioritized,
isAdjacencyThreshMet,
isAdjacencyLowIncome,
isIslandLowIncome,
tribalCountAK,
tribalCountUS,
percentTractTribal,
@ -48,6 +51,9 @@ const PrioritizationCopy =
if (isAdjacencyThreshMet && isAdjacencyLowIncome) {
prioCopyRendered = EXPLORE_COPY.PRIORITIZATION_COPY.PRIO_SURR_LI;
// if 1-2
} else if (isIslandLowIncome) {
prioCopyRendered = EXPLORE_COPY.PRIORITIZATION_COPY.PRIO_ISLAND_LI;
// if 1-3
} else if (isAdjacencyThreshMet && !isAdjacencyLowIncome) {
// if 1-2-1
if ( tribalCountAK === null && tribalCountUS === null) {