Skip to content

Commit

Permalink
Update priotization copy
Browse files Browse the repository at this point in the history
- closes #2086
- closes #2085
- reorders ifs, placed all ifs with dependency no CC > =1 w/i in the first if block
  • Loading branch information
vim-usds committed Nov 17, 2022
1 parent babcc24 commit b0f48c9
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 36 deletions.
27 changes: 14 additions & 13 deletions client/src/components/PrioritizationCopy/PrioritizationCopy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,22 @@ const PrioritizationCopy =
if (isAdjacencyThreshMet && isAdjacencyLowIncome) {
prioCopyRendered = EXPLORE_COPY.PRIORITIZATION_COPY.PRIO_SURR_LI;
// if 1-2
} else if (
isAdjacencyThreshMet &&
!isAdjacencyLowIncome &&
tribalCountAK === null &&
tribalCountUS === null
) {
} else if (isAdjacencyThreshMet && !isAdjacencyLowIncome) {
// if 1-2-1
if (percentTractTribal === null) {
prioCopyRendered = EXPLORE_COPY.PRIORITIZATION_COPY.NOT_PRIO_SURR_LI;
if ( tribalCountAK === null && tribalCountUS === null) {
// if 1-2-1-1
if (percentTractTribal === null) {
prioCopyRendered = EXPLORE_COPY.PRIORITIZATION_COPY.NOT_PRIO_SURR_LI;
// if 1-2-1-2
} else if (percentTractTribal === 0) {
prioCopyRendered = EXPLORE_COPY.PRIORITIZATION_COPY.PAR_PRIO_SURR_NO_LI;
// if 1-2-1-3
} else if (percentTractTribal >= 1) {
prioCopyRendered = EXPLORE_COPY.PRIORITIZATION_COPY.PAR_PRIO_SURR_NO_LI;
}
// if 1-2-2
} else if (percentTractTribal === 0) {
prioCopyRendered = EXPLORE_COPY.PRIORITIZATION_COPY.PAR_PRIO_SURR_NO_LI;
// if 1-2-3
} else if (percentTractTribal >= 1) {
prioCopyRendered = EXPLORE_COPY.PRIORITIZATION_COPY.PAR_PRIO_SURR_NO_LI;
} else if (tribalCountAK !== null && tribalCountAK >= 1) {
prioCopyRendered = EXPLORE_COPY.PRIORITIZATION_COPY.NOT_PRIO_SURR_LI;
}
// if 1-3
} else if (
Expand Down
56 changes: 33 additions & 23 deletions client/src/components/PrioritizationCopy2/PrioritizationCopy2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,35 @@ const PrioritizationCopy2 =
(tribalCountUS !== null && tribalCountUS >= 1)
) {
prioCopy2Rendered = EXPLORE_COPY.getPrioAKUSCopy(tribalCountAK, tribalCountUS, true);
// if 1-7
} else {
prioCopy2Rendered = <></>;
noStyles = true;
// if 1-7
} else if (
!isAdjacencyThreshMet && isAdjacencyLowIncome &&
(tribalCountAK !== null && tribalCountAK >= 1) &&
(percentTractTribal !== null && percentTractTribal >= 1)
) {
prioCopy2Rendered = EXPLORE_COPY.getPrioFRTCopy(`${percentTractTribal}%`, true);
// if 1-8
} else if (
(totalCategoriesPrioritized >= 1) &&
tribalCountAK == null &&
(tribalCountUS !== null && tribalCountUS >= 1) &&
percentTractTribal == null
) {
prioCopy2Rendered = EXPLORE_COPY.getPrioFRTPointsCopy(tribalCountUS, true);
// if 1-9
} else if (
totalCategoriesPrioritized >= 1 &&
(tribalCountAK !== null && tribalCountAK >= 1) &&
(percentTractTribal !== null && percentTractTribal == 0)
) {
prioCopy2Rendered = EXPLORE_COPY.getPrioFRTCopy(`less than 1%`, true);
// if 1-10
} else if (
totalCategoriesPrioritized >= 1 &&
(tribalCountAK !== null && tribalCountAK >= 1) &&
(percentTractTribal !== null && percentTractTribal >= 1)
) {
prioCopy2Rendered = EXPLORE_COPY.getPrioFRTCopy(`${percentTractTribal}%`, true);
}
// if 2
} else if (
Expand All @@ -117,26 +142,11 @@ const PrioritizationCopy2 =
prioCopy2Rendered = EXPLORE_COPY.getPrioFRTPointsCopy(tribalCountUS, true);
// if 4
} else if (
(totalCategoriesPrioritized >= 1) &&
tribalCountAK == null &&
(tribalCountUS !== null && tribalCountUS >= 1) &&
percentTractTribal == null
) {
prioCopy2Rendered = EXPLORE_COPY.getPrioFRTPointsCopy(tribalCountUS, true);
// if 5
} else if (
totalCategoriesPrioritized >= 1 &&
(tribalCountAK !== null && tribalCountAK >= 1) &&
(percentTractTribal !== null && percentTractTribal == 0)
) {
prioCopy2Rendered = EXPLORE_COPY.getPrioFRTCopy(`less than 1%`, true);
// if 6
} else if (
totalCategoriesPrioritized >= 1 &&
(tribalCountAK !== null && tribalCountAK >= 1) &&
(percentTractTribal !== null && percentTractTribal >= 1)
totalCategoriesPrioritized === 0 &&
isAdjacencyThreshMet && !isAdjacencyLowIncome &&
(tribalCountAK !== null && tribalCountAK >= 1)
) {
prioCopy2Rendered = EXPLORE_COPY.getPrioFRTCopy(`${percentTractTribal}%`, true);
prioCopy2Rendered = EXPLORE_COPY.getPrioANVCopy(tribalCountAK, true);
} else {
prioCopy2Rendered = <></>;
noStyles = true;
Expand Down

0 comments on commit b0f48c9

Please sign in to comment.