From 3bf3d73f0316dd3e3ebb2f44a33a349c1faee958 Mon Sep 17 00:00:00 2001 From: Doug Schrashun Date: Thu, 10 Oct 2024 11:02:38 -0400 Subject: [PATCH] remove need for useMessages --- .../app/[locale]/process/ProcessMilestones.tsx | 16 ++++++---------- frontend/src/i18n/messages/en/index.ts | 10 +++++----- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/frontend/src/app/[locale]/process/ProcessMilestones.tsx b/frontend/src/app/[locale]/process/ProcessMilestones.tsx index 7e9b6c1ab1..07458e6cea 100644 --- a/frontend/src/app/[locale]/process/ProcessMilestones.tsx +++ b/frontend/src/app/[locale]/process/ProcessMilestones.tsx @@ -15,15 +15,11 @@ import { import ContentLayout from "src/components/ContentLayout"; import { USWDSIcon } from "src/components/USWDSIcon"; +const highLevelRoadmapItems = ["find", "advanced_reporting", "apply"] as const; + const ProcessMilestones = () => { const t = useTranslations("Process.milestones"); - const { - Process: { - milestones: { high_level_roadmap_items }, - }, - } = useMessages() as unknown as IntlMessages; - const getIcon = (iconIndex: number) => { switch (iconIndex) { case 0: @@ -47,10 +43,10 @@ const ProcessMilestones = () => { gridGap={6} > - {high_level_roadmap_items.map((_unusedItem, index) => { - const title = t(`high_level_roadmap_items.${index}.title`); + {highLevelRoadmapItems.map((itemKey, index) => { + const title = t(`high_level_roadmap_items.${itemKey}.title`); const content = t.rich( - `high_level_roadmap_items.${index}.content`, + `high_level_roadmap_items.${itemKey}.content`, { p: (chunks) => (

@@ -79,7 +75,7 @@ const ProcessMilestones = () => { { // Don't show the chevron in the last row item. - index < high_level_roadmap_items.length - 1 ? ( + index < highLevelRoadmapItems.length - 1 ? ( Improve how applicants discover funding opportunities that they’re qualified for and that meet their needs.

", }, - { + advanced_reporting: { title: "Advanced reporting", content: "

Improve stakeholders’ capacity to understand, analyze, and assess grants from application to acceptance.

Make non-confidential Grants.gov data open for public analysis.

", }, - { + apply: { title: "Apply", content: "

Streamline the application process to make it easier for all applicants to apply for funding opportunities.

", }, - ], + }, roadmap_1: "Find", title_1: "Milestone 1", name_1: