From fd3f550606a38148acbfe816cd900c068469bc2f Mon Sep 17 00:00:00 2001 From: Carlos Felix <63804190+carlosfelix2@users.noreply.github.com> Date: Fri, 20 Dec 2024 12:01:52 -0500 Subject: [PATCH] Set Donut percentile for territories --- client/src/components/AreaDetail/AreaDetail.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/client/src/components/AreaDetail/AreaDetail.tsx b/client/src/components/AreaDetail/AreaDetail.tsx index e28c0b00..3f27859f 100644 --- a/client/src/components/AreaDetail/AreaDetail.tsx +++ b/client/src/components/AreaDetail/AreaDetail.tsx @@ -1036,6 +1036,12 @@ const AreaDetail = ({properties}: IAreaDetailProps) => { properties[constants.TOTAL_NUMBER_OF_DISADVANTAGE_INDICATORS] === 0; const showIslandCopy = isTerritory && !showDonutCopy; + // For territories we use the poverty percentile from the census decennial data + const poveryPercentile = isTerritory ? + properties[constants.CENSUS_DECENNIAL_POVERTY_LESS_THAN_200_FPL_PERCENTILE] : + properties[constants.POVERTY_BELOW_200_PERCENTILE] > 0 ? + properties[constants.POVERTY_BELOW_200_PERCENTILE] : + null; /** * 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 @@ -1198,15 +1204,11 @@ const AreaDetail = ({properties}: IAreaDetailProps) => { {showIslandCopy && - } + } {showDonutCopy && 0 ? - properties[constants.POVERTY_BELOW_200_PERCENTILE] : - null - } + povertyBelow200Percentile={poveryPercentile} /> }