From 9787ff8f341bd07afd110170188da2654cfb1275 Mon Sep 17 00:00:00 2001 From: Ai Ling <50992674+ailing35@users.noreply.github.com> Date: Wed, 12 Oct 2022 21:14:56 +0800 Subject: [PATCH] [ui][monthYearPicker] Add required props and align bottom (#369) --- apps/portal/src/components/shared/MonthYearPicker.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/portal/src/components/shared/MonthYearPicker.tsx b/apps/portal/src/components/shared/MonthYearPicker.tsx index b4657e6d..4b97b319 100644 --- a/apps/portal/src/components/shared/MonthYearPicker.tsx +++ b/apps/portal/src/components/shared/MonthYearPicker.tsx @@ -11,9 +11,11 @@ export type MonthYear = Readonly<{ type Props = Readonly<{ errorMessage?: string; monthLabel?: string; + monthRequired?: boolean; onChange: (value: MonthYear) => void; value: MonthYear; yearLabel?: string; + yearRequired?: boolean; }>; const MONTH_OPTIONS = [ @@ -82,6 +84,8 @@ export default function MonthYearPicker({ value, onChange, yearLabel = 'Year', + monthRequired = false, + yearRequired = false, }: Props) { const hasError = errorMessage != null; const errorId = useId(); @@ -89,10 +93,11 @@ export default function MonthYearPicker({ return (