Skip to content

Commit

Permalink
Enhance OneYearAllocation component to include capitalized kind in title
Browse files Browse the repository at this point in the history
- Added logic to capitalize the first letter of the kind prop when rendering the title in the OneYearAllocation component.
- Improved the clarity of the title by ensuring consistent formatting, enhancing the user experience by providing a more polished display of the allocation type.
  • Loading branch information
ElemarJR committed Jan 6, 2025
1 parent a1f2c3e commit 6a265b5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontend/src/app/components/OneYearAllocation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ const OneYearAllocation: React.FC<ContributionProps> = ({
},
]
: []),
...(kind
? [
{
field: "Kind",
selectedValues: [kind.charAt(0).toUpperCase() + kind.slice(1)],
},
]
: []),
];

const { loading, error, data } = useQuery(ALLOCATION_QUERY, {
Expand Down Expand Up @@ -959,7 +967,8 @@ const OneYearAllocation: React.FC<ContributionProps> = ({

var title = "One Year Allocation"
if (kind) {
title = `${title} - ${kind}`
const capitalizedKind = kind.charAt(0).toUpperCase() + kind.slice(1);
title = `${title} - ${capitalizedKind}`
}

return (
Expand Down

0 comments on commit 6a265b5

Please sign in to comment.