From 07b814464eaf50b4a0a66abf3acc75e8fae3d03c Mon Sep 17 00:00:00 2001 From: Yangshun Tay Date: Thu, 3 Nov 2022 07:33:01 +0800 Subject: [PATCH] [portal][ui] allow customization of spacing within MonthYearPicker --- .../offers/forms/FormMonthYearPicker.tsx | 1 + .../forms/ContributeQuestionForm.tsx | 1 + .../forms/CreateQuestionEncounterForm.tsx | 1 + .../src/components/shared/MonthYearPicker.tsx | 55 +++++++++++-------- 4 files changed, 35 insertions(+), 23 deletions(-) diff --git a/apps/portal/src/components/offers/forms/FormMonthYearPicker.tsx b/apps/portal/src/components/offers/forms/FormMonthYearPicker.tsx index ca036b0e..52522cbb 100644 --- a/apps/portal/src/components/offers/forms/FormMonthYearPicker.tsx +++ b/apps/portal/src/components/offers/forms/FormMonthYearPicker.tsx @@ -28,6 +28,7 @@ function FormMonthYearPickerWithRef({ return ( { diff --git a/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx b/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx index f44b22c3..10aa33ef 100644 --- a/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx +++ b/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx @@ -140,6 +140,7 @@ export default function ContributeQuestionForm({ name="date" render={({ field }) => ( ; type Props = Readonly<{ + className?: string; errorMessage?: string; monthLabel?: string; monthRequired?: boolean; @@ -84,6 +86,7 @@ const YEAR_OPTIONS = Array.from({ length: NUM_YEARS }, (_, i) => { }); export default function MonthYearPicker({ + className, errorMessage, monthLabel = 'Month', value, @@ -109,29 +112,35 @@ export default function MonthYearPicker({ return (
-
- - onChange({ month: value.month, year: Number(newYear) }) - } - /> +
+
+ + onChange({ month: value.month, year: Number(newYear) }) + } + /> +
{errorMessage && (