Skip to content

Commit

Permalink
remove need for useMessages
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-s-nava committed Oct 10, 2024
1 parent 07c2e65 commit 3bf3d73
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
16 changes: 6 additions & 10 deletions frontend/src/app/[locale]/process/ProcessMilestones.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -47,10 +43,10 @@ const ProcessMilestones = () => {
gridGap={6}
>
<IconList className="usa-icon-list--size-lg grid-row">
{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) => (
<p className="font-sans-md line-height-sans-4 desktop-lg:line-height-sans-6">
Expand Down Expand Up @@ -79,7 +75,7 @@ const ProcessMilestones = () => {
</div>
{
// Don't show the chevron in the last row item.
index < high_level_roadmap_items.length - 1 ? (
index < highLevelRoadmapItems.length - 1 ? (
<USWDSIcon
className="usa-icon usa-icon--size-9 display-none tablet-lg:display-block text-base-lighter position-absolute right-0 top-0"
name="navigate_next"
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/i18n/messages/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,23 +271,23 @@ export const messages = {
},
milestones: {
tag: "The high-level roadmap",
high_level_roadmap_items: [
{
high_level_roadmap_items: {
find: {
title: "Find",
content:
"<p>Improve how applicants discover funding opportunities that they’re qualified for and that meet their needs.</p>",
},
{
advanced_reporting: {
title: "Advanced reporting",
content:
"<p>Improve stakeholders’ capacity to understand, analyze, and assess grants from application to acceptance.</p><p>Make non-confidential Grants.gov data open for public analysis.</p>",
},
{
apply: {
title: "Apply",
content:
"<p>Streamline the application process to make it easier for all applicants to apply for funding opportunities.</p>",
},
],
},
roadmap_1: "Find",
title_1: "Milestone 1",
name_1:
Expand Down

0 comments on commit 3bf3d73

Please sign in to comment.