From 6a265b52cdd6921f5e47a082b1051752cefcd1c1 Mon Sep 17 00:00:00 2001 From: Elemar Rodrigues Severo Junior Date: Sun, 5 Jan 2025 22:04:01 -0300 Subject: [PATCH] Enhance OneYearAllocation component to include capitalized kind in title - 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. --- frontend/src/app/components/OneYearAllocation.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/components/OneYearAllocation.tsx b/frontend/src/app/components/OneYearAllocation.tsx index ab06c515..2ac8e5d9 100644 --- a/frontend/src/app/components/OneYearAllocation.tsx +++ b/frontend/src/app/components/OneYearAllocation.tsx @@ -181,6 +181,14 @@ const OneYearAllocation: React.FC = ({ }, ] : []), + ...(kind + ? [ + { + field: "Kind", + selectedValues: [kind.charAt(0).toUpperCase() + kind.slice(1)], + }, + ] + : []), ]; const { loading, error, data } = useQuery(ALLOCATION_QUERY, { @@ -959,7 +967,8 @@ const OneYearAllocation: React.FC = ({ var title = "One Year Allocation" if (kind) { - title = `${title} - ${kind}` + const capitalizedKind = kind.charAt(0).toUpperCase() + kind.slice(1); + title = `${title} - ${capitalizedKind}` } return (