diff --git a/src/components/TimerPicker/DurationScroll.tsx b/src/components/TimerPicker/DurationScroll.tsx index 753e886..561f553 100644 --- a/src/components/TimerPicker/DurationScroll.tsx +++ b/src/components/TimerPicker/DurationScroll.tsx @@ -48,6 +48,7 @@ export type LimitType = { }; interface DurationScrollProps { + allowFontScaling?: boolean; numberOfItems: number; label?: string | React.ReactElement; initialValue?: number; @@ -83,6 +84,7 @@ const DurationScroll = forwardRef( disableInfiniteScroll = false, limit, aggressivelyGetLatestDuration, + allowFontScaling = false, is12HourPicker, amLabel, pmLabel, @@ -166,6 +168,7 @@ const DurationScroll = forwardRef( style={styles.pickerItemContainer} testID="picker-item"> adjustedLimited.max || @@ -179,7 +182,9 @@ const DurationScroll = forwardRef( - + {isAm ? amLabel : pmLabel} @@ -190,6 +195,7 @@ const DurationScroll = forwardRef( [ adjustedLimited.max, adjustedLimited.min, + allowFontScaling, amLabel, is12HourPicker, pmLabel, @@ -364,7 +370,11 @@ const DurationScroll = forwardRef( /> {typeof label === "string" ? ( - {label} + + {label} + ) : ( label ?? null )} diff --git a/src/components/TimerPicker/index.tsx b/src/components/TimerPicker/index.tsx index 9d9366c..0fd4745 100644 --- a/src/components/TimerPicker/index.tsx +++ b/src/components/TimerPicker/index.tsx @@ -32,6 +32,7 @@ export interface TimerPickerRef { } export interface TimerPickerProps { + allowFontScaling?: boolean; onDurationChange?: (duration: { hours: number; minutes: number; @@ -67,6 +68,7 @@ export interface TimerPickerProps { const TimerPicker = forwardRef( ( { + allowFontScaling = false, onDurationChange, initialHours = 0, initialMinutes = 0, @@ -167,6 +169,7 @@ const TimerPicker = forwardRef( hourLabel ?? (!use12HourPicker ? "h" : undefined) } initialValue={initialHours} + allowFontScaling={allowFontScaling} aggressivelyGetLatestDuration={ aggressivelyGetLatestDuration } @@ -195,6 +198,7 @@ const TimerPicker = forwardRef( numberOfItems={59} label={minuteLabel ?? "m"} initialValue={initialMinutes} + allowFontScaling={allowFontScaling} aggressivelyGetLatestDuration={ aggressivelyGetLatestDuration } @@ -221,6 +225,7 @@ const TimerPicker = forwardRef( numberOfItems={59} label={secondLabel ?? "s"} initialValue={initialSeconds} + allowFontScaling={allowFontScaling} aggressivelyGetLatestDuration={ aggressivelyGetLatestDuration } diff --git a/src/components/index.tsx b/src/components/index.tsx index 1b380b4..f09f7c7 100644 --- a/src/components/index.tsx +++ b/src/components/index.tsx @@ -83,6 +83,7 @@ const TimerPickerModal = forwardRef( secondLabel, padWithNItems = 1, disableInfiniteScroll = false, + allowFontScaling = false, use12HourPicker, amLabel, pmLabel, @@ -219,6 +220,7 @@ const TimerPickerModal = forwardRef( secondLabel={secondLabel} padWithNItems={padWithNItems} disableInfiniteScroll={disableInfiniteScroll} + allowFontScaling={allowFontScaling} use12HourPicker={use12HourPicker} amLabel={amLabel} pmLabel={pmLabel}