react-native-timer-picker 1.9.1 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +3 -0
  2. package/dist/commonjs/components/TimerPicker/index.js +6 -2
  3. package/dist/commonjs/components/TimerPicker/index.js.map +1 -1
  4. package/dist/commonjs/components/TimerPicker/types.js.map +1 -1
  5. package/dist/module/components/TimerPicker/index.js +6 -2
  6. package/dist/module/components/TimerPicker/index.js.map +1 -1
  7. package/dist/module/components/TimerPicker/types.js.map +1 -1
  8. package/dist/typescript/components/TimerPicker/types.d.ts +3 -0
  9. package/package.json +1 -2
  10. package/src/components/DurationScroll/index.tsx +0 -459
  11. package/src/components/DurationScroll/types.ts +0 -75
  12. package/src/components/Modal/index.tsx +0 -124
  13. package/src/components/Modal/styles.ts +0 -26
  14. package/src/components/Modal/types.ts +0 -17
  15. package/src/components/TimerPicker/index.tsx +0 -195
  16. package/src/components/TimerPicker/styles.ts +0 -123
  17. package/src/components/TimerPicker/types.ts +0 -74
  18. package/src/components/TimerPickerModal/index.tsx +0 -190
  19. package/src/components/TimerPickerModal/styles.ts +0 -88
  20. package/src/components/TimerPickerModal/types.ts +0 -52
  21. package/src/index.ts +0 -13
  22. package/src/tests/DurationScroll.test.tsx +0 -66
  23. package/src/tests/Modal.test.tsx +0 -36
  24. package/src/tests/TimerPicker.test.tsx +0 -41
  25. package/src/tests/TimerPickerModal.test.tsx +0 -72
  26. package/src/utils/colorToRgba.ts +0 -49
  27. package/src/utils/generateNumbers.ts +0 -64
  28. package/src/utils/getAdjustedLimit.ts +0 -35
  29. package/src/utils/getScrollIndex.ts +0 -15
  30. package/src/utils/padNumber.ts +0 -10
@@ -1,195 +0,0 @@
1
- import React, {
2
- forwardRef,
3
- useEffect,
4
- useImperativeHandle,
5
- useMemo,
6
- useRef,
7
- useState,
8
- } from "react";
9
-
10
- import { View } from "react-native";
11
-
12
- import DurationScroll from "../DurationScroll";
13
- import type { DurationScrollRef } from "../DurationScroll/types";
14
-
15
- import { generateStyles } from "./styles";
16
- import type { TimerPickerProps, TimerPickerRef } from "./types";
17
-
18
- const TimerPicker = forwardRef<TimerPickerRef, TimerPickerProps>(
19
- (props, ref) => {
20
- const {
21
- aggressivelyGetLatestDuration = false,
22
- allowFontScaling = false,
23
- amLabel = "am",
24
- disableInfiniteScroll = false,
25
- hideHours = false,
26
- hideMinutes = false,
27
- hideSeconds = false,
28
- hourLabel,
29
- hourLimit,
30
- hoursPickerIsDisabled = false,
31
- initialValue,
32
- minuteLabel,
33
- minuteLimit,
34
- minutesPickerIsDisabled = false,
35
- onDurationChange,
36
- padWithNItems = 1,
37
- pickerContainerProps,
38
- pmLabel = "pm",
39
- secondLabel,
40
- secondLimit,
41
- secondsPickerIsDisabled = false,
42
- styles: customStyles,
43
- use12HourPicker = false,
44
- ...otherProps
45
- } = props;
46
-
47
- const checkedPadWithNItems =
48
- padWithNItems >= 0 ? Math.round(padWithNItems) : 0;
49
-
50
- const styles = useMemo(
51
- () =>
52
- generateStyles(customStyles, {
53
- padWithNItems: checkedPadWithNItems,
54
- }),
55
-
56
- [checkedPadWithNItems, customStyles]
57
- );
58
-
59
- const safeInitialValue = {
60
- hours: initialValue?.hours ?? 0,
61
- minutes: initialValue?.minutes ?? 0,
62
- seconds: initialValue?.seconds ?? 0,
63
- };
64
-
65
- const [selectedHours, setSelectedHours] = useState(
66
- safeInitialValue.hours
67
- );
68
- const [selectedMinutes, setSelectedMinutes] = useState(
69
- safeInitialValue.minutes
70
- );
71
- const [selectedSeconds, setSelectedSeconds] = useState(
72
- safeInitialValue.seconds
73
- );
74
-
75
- useEffect(() => {
76
- onDurationChange?.({
77
- hours: selectedHours,
78
- minutes: selectedMinutes,
79
- seconds: selectedSeconds,
80
- });
81
- // eslint-disable-next-line react-hooks/exhaustive-deps
82
- }, [selectedHours, selectedMinutes, selectedSeconds]);
83
-
84
- const hoursDurationScrollRef = useRef<DurationScrollRef>(null);
85
- const minutesDurationScrollRef = useRef<DurationScrollRef>(null);
86
- const secondsDurationScrollRef = useRef<DurationScrollRef>(null);
87
-
88
- useImperativeHandle(ref, () => ({
89
- reset: (options) => {
90
- setSelectedHours(safeInitialValue.hours);
91
- setSelectedMinutes(safeInitialValue.minutes);
92
- setSelectedSeconds(safeInitialValue.seconds);
93
- hoursDurationScrollRef.current?.reset(options);
94
- minutesDurationScrollRef.current?.reset(options);
95
- secondsDurationScrollRef.current?.reset(options);
96
- },
97
- setValue: (value, options) => {
98
- setSelectedHours(value.hours);
99
- setSelectedMinutes(value.minutes);
100
- setSelectedSeconds(value.seconds);
101
- hoursDurationScrollRef.current?.setValue(value.hours, options);
102
- minutesDurationScrollRef.current?.setValue(
103
- value.minutes,
104
- options
105
- );
106
- secondsDurationScrollRef.current?.setValue(
107
- value.seconds,
108
- options
109
- );
110
- },
111
- latestDuration: {
112
- hours: hoursDurationScrollRef.current?.latestDuration,
113
- minutes: minutesDurationScrollRef.current?.latestDuration,
114
- seconds: secondsDurationScrollRef.current?.latestDuration,
115
- },
116
- }));
117
-
118
- return (
119
- <View
120
- {...pickerContainerProps}
121
- style={styles.pickerContainer}
122
- testID="timer-picker">
123
- {!hideHours ? (
124
- <DurationScroll
125
- ref={hoursDurationScrollRef}
126
- aggressivelyGetLatestDuration={
127
- aggressivelyGetLatestDuration
128
- }
129
- allowFontScaling={allowFontScaling}
130
- amLabel={amLabel}
131
- disableInfiniteScroll={disableInfiniteScroll}
132
- initialValue={safeInitialValue.hours}
133
- is12HourPicker={use12HourPicker}
134
- isDisabled={hoursPickerIsDisabled}
135
- label={
136
- hourLabel ?? (!use12HourPicker ? "h" : undefined)
137
- }
138
- limit={hourLimit}
139
- numberOfItems={23}
140
- onDurationChange={setSelectedHours}
141
- padWithNItems={checkedPadWithNItems}
142
- pmLabel={pmLabel}
143
- styles={styles}
144
- testID="duration-scroll-hour"
145
- {...otherProps}
146
- />
147
- ) : null}
148
- {!hideMinutes ? (
149
- <DurationScroll
150
- ref={minutesDurationScrollRef}
151
- aggressivelyGetLatestDuration={
152
- aggressivelyGetLatestDuration
153
- }
154
- allowFontScaling={allowFontScaling}
155
- disableInfiniteScroll={disableInfiniteScroll}
156
- initialValue={safeInitialValue.minutes}
157
- isDisabled={minutesPickerIsDisabled}
158
- label={minuteLabel ?? "m"}
159
- limit={minuteLimit}
160
- numberOfItems={59}
161
- onDurationChange={setSelectedMinutes}
162
- padNumbersWithZero
163
- padWithNItems={checkedPadWithNItems}
164
- styles={styles}
165
- testID="duration-scroll-minute"
166
- {...otherProps}
167
- />
168
- ) : null}
169
- {!hideSeconds ? (
170
- <DurationScroll
171
- ref={secondsDurationScrollRef}
172
- aggressivelyGetLatestDuration={
173
- aggressivelyGetLatestDuration
174
- }
175
- allowFontScaling={allowFontScaling}
176
- disableInfiniteScroll={disableInfiniteScroll}
177
- initialValue={safeInitialValue.seconds}
178
- isDisabled={secondsPickerIsDisabled}
179
- label={secondLabel ?? "s"}
180
- limit={secondLimit}
181
- numberOfItems={59}
182
- onDurationChange={setSelectedSeconds}
183
- padNumbersWithZero
184
- padWithNItems={checkedPadWithNItems}
185
- styles={styles}
186
- testID="duration-scroll-second"
187
- {...otherProps}
188
- />
189
- ) : null}
190
- </View>
191
- );
192
- }
193
- );
194
-
195
- export default React.memo(TimerPicker);
@@ -1,123 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import type { TextStyle, ViewStyle } from "react-native";
3
-
4
- export interface CustomTimerPickerStyles {
5
- backgroundColor?: string;
6
- disabledPickerContainer?: ViewStyle;
7
- disabledPickerItem?: TextStyle;
8
- pickerAmPmContainer?: ViewStyle;
9
- pickerAmPmLabel?: TextStyle;
10
- pickerContainer?: ViewStyle & { backgroundColor?: string };
11
- pickerGradientOverlay?: ViewStyle;
12
- pickerItem?: TextStyle;
13
- pickerItemContainer?: ViewStyle & { height?: number };
14
- pickerLabel?: TextStyle;
15
- pickerLabelContainer?: ViewStyle;
16
- text?: TextStyle;
17
- theme?: "light" | "dark";
18
- }
19
-
20
- const DARK_MODE_BACKGROUND_COLOR = "#232323";
21
- const DARK_MODE_TEXT_COLOR = "#E9E9E9";
22
- const LIGHT_MODE_BACKGROUND_COLOR = "#F1F1F1";
23
- const LIGHT_MODE_TEXT_COLOR = "#1B1B1B";
24
-
25
- export const generateStyles = (
26
- customStyles: CustomTimerPickerStyles | undefined,
27
- options: { padWithNItems: number }
28
- ) =>
29
- StyleSheet.create({
30
- pickerContainer: {
31
- flexDirection: "row",
32
- marginRight: "8%",
33
- backgroundColor:
34
- customStyles?.backgroundColor ??
35
- (customStyles?.theme === "dark"
36
- ? DARK_MODE_BACKGROUND_COLOR
37
- : LIGHT_MODE_BACKGROUND_COLOR),
38
- ...customStyles?.pickerContainer,
39
- },
40
- pickerLabelContainer: {
41
- position: "absolute",
42
- right: 4,
43
- top: 0,
44
- bottom: 0,
45
- justifyContent: "center",
46
- minWidth:
47
- (customStyles?.pickerLabel?.fontSize ??
48
- customStyles?.text?.fontSize ??
49
- 25) * 0.65,
50
- ...customStyles?.pickerLabelContainer,
51
- },
52
- pickerLabel: {
53
- fontSize: 18,
54
- fontWeight: "bold",
55
- marginTop:
56
- (customStyles?.pickerItem?.fontSize ??
57
- customStyles?.text?.fontSize ??
58
- 25) / 6,
59
- color:
60
- customStyles?.theme === "dark"
61
- ? DARK_MODE_TEXT_COLOR
62
- : LIGHT_MODE_TEXT_COLOR,
63
- ...customStyles?.text,
64
- ...customStyles?.pickerLabel,
65
- },
66
- pickerItemContainer: {
67
- flexDirection: "row",
68
- height: 50,
69
- justifyContent: "center",
70
- alignItems: "center",
71
- width: (customStyles?.pickerItem?.fontSize ?? 25) * 3.6,
72
- ...customStyles?.pickerItemContainer,
73
- },
74
- pickerItem: {
75
- textAlignVertical: "center",
76
- fontSize: 25,
77
- color:
78
- customStyles?.theme === "dark"
79
- ? DARK_MODE_TEXT_COLOR
80
- : LIGHT_MODE_TEXT_COLOR,
81
- ...customStyles?.text,
82
- ...customStyles?.pickerItem,
83
- },
84
- pickerAmPmContainer: {
85
- position: "absolute",
86
- right: 0,
87
- top: 0,
88
- bottom: 0,
89
- justifyContent: "center",
90
- ...customStyles?.pickerLabelContainer,
91
- ...customStyles?.pickerAmPmContainer,
92
- },
93
- pickerAmPmLabel: {
94
- fontSize: 18,
95
- fontWeight: "bold",
96
- marginTop: (customStyles?.pickerItem?.fontSize ?? 25) / 6,
97
- color:
98
- customStyles?.theme === "dark"
99
- ? DARK_MODE_TEXT_COLOR
100
- : LIGHT_MODE_TEXT_COLOR,
101
- ...customStyles?.text,
102
- ...customStyles?.pickerLabel,
103
- ...customStyles?.pickerAmPmLabel,
104
- },
105
- disabledPickerContainer: {
106
- opacity: 0.4,
107
- ...customStyles?.disabledPickerContainer,
108
- },
109
- disabledPickerItem: {
110
- opacity: 0.2,
111
- ...customStyles?.disabledPickerItem,
112
- },
113
- pickerGradientOverlay: {
114
- position: "absolute",
115
- left: 0,
116
- right: 0,
117
- height:
118
- options.padWithNItems === 0
119
- ? "30%"
120
- : (customStyles?.pickerItemContainer?.height ?? 50) * 0.8,
121
- ...customStyles?.pickerGradientOverlay,
122
- },
123
- });
@@ -1,74 +0,0 @@
1
- import type { MutableRefObject } from "react";
2
-
3
- import type { View } from "react-native";
4
-
5
- import type {
6
- LinearGradientProps,
7
- SoundAssetType,
8
- LimitType,
9
- CustomFlatList,
10
- } from "../DurationScroll/types";
11
-
12
- import type { CustomTimerPickerStyles } from "./styles";
13
-
14
- export interface TimerPickerRef {
15
- latestDuration: {
16
- hours: MutableRefObject<number> | undefined;
17
- minutes: MutableRefObject<number> | undefined;
18
- seconds: MutableRefObject<number> | undefined;
19
- };
20
- reset: (options?: { animated?: boolean }) => void;
21
- setValue: (
22
- value: {
23
- hours: number;
24
- minutes: number;
25
- seconds: number;
26
- },
27
- options?: { animated?: boolean }
28
- ) => void;
29
- }
30
-
31
- export interface TimerPickerProps {
32
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- Audio?: any;
34
- FlatList?: CustomFlatList;
35
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
- Haptics?: any;
37
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
- LinearGradient?: any;
39
- aggressivelyGetLatestDuration?: boolean;
40
- allowFontScaling?: boolean;
41
- amLabel?: string;
42
- bottomPickerGradientOverlayProps?: Partial<LinearGradientProps>;
43
- clickSoundAsset?: SoundAssetType;
44
- disableInfiniteScroll?: boolean;
45
- hideHours?: boolean;
46
- hideMinutes?: boolean;
47
- hideSeconds?: boolean;
48
- hourLabel?: string | React.ReactElement;
49
- hourLimit?: LimitType;
50
- hoursPickerIsDisabled?: boolean;
51
- initialValue?: {
52
- hours?: number;
53
- minutes?: number;
54
- seconds?: number;
55
- };
56
- minuteLabel?: string | React.ReactElement;
57
- minuteLimit?: LimitType;
58
- minutesPickerIsDisabled?: boolean;
59
- onDurationChange?: (duration: {
60
- hours: number;
61
- minutes: number;
62
- seconds: number;
63
- }) => void;
64
- padWithNItems?: number;
65
- pickerContainerProps?: React.ComponentProps<typeof View>;
66
- pickerGradientOverlayProps?: Partial<LinearGradientProps>;
67
- pmLabel?: string;
68
- secondLabel?: string | React.ReactElement;
69
- secondLimit?: LimitType;
70
- secondsPickerIsDisabled?: boolean;
71
- styles?: CustomTimerPickerStyles;
72
- topPickerGradientOverlayProps?: Partial<LinearGradientProps>;
73
- use12HourPicker?: boolean;
74
- }
@@ -1,190 +0,0 @@
1
- import React, {
2
- forwardRef,
3
- useCallback,
4
- useEffect,
5
- useImperativeHandle,
6
- useRef,
7
- useState,
8
- } from "react";
9
-
10
- import { View, Text, TouchableOpacity } from "react-native";
11
-
12
- import Modal from "../Modal";
13
- import TimerPicker from "../TimerPicker";
14
- import type { TimerPickerRef } from "../TimerPicker/types";
15
-
16
- import { generateStyles } from "./styles";
17
- import type { TimerPickerModalRef, TimerPickerModalProps } from "./types";
18
-
19
- const TimerPickerModal = forwardRef<TimerPickerModalRef, TimerPickerModalProps>(
20
- (props, ref) => {
21
- const {
22
- buttonContainerProps,
23
- buttonTouchableOpacityProps,
24
- cancelButtonText = "Cancel",
25
- closeOnOverlayPress,
26
- confirmButtonText = "Confirm",
27
- containerProps,
28
- contentContainerProps,
29
- hideCancelButton = false,
30
- initialValue,
31
- modalProps,
32
- modalTitle,
33
- modalTitleProps,
34
- onCancel,
35
- onConfirm,
36
- onDurationChange,
37
- setIsVisible,
38
- styles: customStyles,
39
- visible,
40
- ...otherProps
41
- } = props;
42
-
43
- const styles = generateStyles(customStyles);
44
-
45
- const timerPickerRef = useRef<TimerPickerRef>(null);
46
-
47
- const safeInitialValue = {
48
- hours: initialValue?.hours ?? 0,
49
- minutes: initialValue?.minutes ?? 0,
50
- seconds: initialValue?.seconds ?? 0,
51
- };
52
-
53
- const [selectedDuration, setSelectedDuration] =
54
- useState(safeInitialValue);
55
- const [confirmedDuration, setConfirmedDuration] =
56
- useState(safeInitialValue);
57
-
58
- const reset = (options?: { animated?: boolean }) => {
59
- setSelectedDuration(safeInitialValue);
60
- setConfirmedDuration(safeInitialValue);
61
- timerPickerRef.current?.reset(options);
62
- };
63
-
64
- // reset state if the initial value changes
65
- useEffect(() => {
66
- reset();
67
- // eslint-disable-next-line react-hooks/exhaustive-deps
68
- }, [
69
- safeInitialValue.hours,
70
- safeInitialValue.minutes,
71
- safeInitialValue.seconds,
72
- ]);
73
-
74
- const hideModalHandler = () => {
75
- setSelectedDuration({
76
- hours: confirmedDuration.hours,
77
- minutes: confirmedDuration.minutes,
78
- seconds: confirmedDuration.seconds,
79
- });
80
- setIsVisible(false);
81
- };
82
-
83
- const confirmHandler = () => {
84
- const latestDuration = timerPickerRef.current?.latestDuration;
85
-
86
- const newDuration = {
87
- hours: latestDuration?.hours?.current ?? selectedDuration.hours,
88
- minutes:
89
- latestDuration?.minutes?.current ??
90
- selectedDuration.minutes,
91
- seconds:
92
- latestDuration?.seconds?.current ??
93
- selectedDuration.seconds,
94
- };
95
- setConfirmedDuration(newDuration);
96
- onConfirm(newDuration);
97
- };
98
-
99
- const cancelHandler = () => {
100
- setIsVisible(false);
101
- setSelectedDuration(confirmedDuration);
102
- onCancel?.();
103
- };
104
-
105
- // wrapped in useCallback to avoid unnecessary re-renders of TimerPicker
106
- const durationChangeHandler = useCallback(
107
- (duration: { hours: number; minutes: number; seconds: number }) => {
108
- setSelectedDuration(duration);
109
- onDurationChange?.(duration);
110
- },
111
- [onDurationChange]
112
- );
113
-
114
- useImperativeHandle(ref, () => ({
115
- reset,
116
- setValue: (value, options) => {
117
- setSelectedDuration(value);
118
- setConfirmedDuration(value);
119
- timerPickerRef.current?.setValue(value, options);
120
- },
121
- latestDuration: {
122
- hours: timerPickerRef.current?.latestDuration?.hours,
123
- minutes: timerPickerRef.current?.latestDuration?.minutes,
124
- seconds: timerPickerRef.current?.latestDuration?.seconds,
125
- },
126
- }));
127
-
128
- return (
129
- <Modal
130
- isVisible={visible}
131
- onOverlayPress={
132
- closeOnOverlayPress ? hideModalHandler : undefined
133
- }
134
- {...modalProps}
135
- testID="timer-picker-modal">
136
- <View {...containerProps} style={styles.container}>
137
- <View
138
- {...contentContainerProps}
139
- style={styles.contentContainer}>
140
- {modalTitle ? (
141
- <Text
142
- {...modalTitleProps}
143
- style={styles.modalTitle}>
144
- {modalTitle}
145
- </Text>
146
- ) : null}
147
- <TimerPicker
148
- ref={timerPickerRef}
149
- initialValue={confirmedDuration}
150
- {...otherProps}
151
- aggressivelyGetLatestDuration
152
- onDurationChange={durationChangeHandler}
153
- styles={customStyles}
154
- />
155
- <View
156
- {...buttonContainerProps}
157
- style={styles.buttonContainer}>
158
- {!hideCancelButton ? (
159
- <TouchableOpacity
160
- {...buttonTouchableOpacityProps}
161
- onPress={cancelHandler}>
162
- <Text
163
- style={[
164
- styles.button,
165
- styles.cancelButton,
166
- ]}>
167
- {cancelButtonText}
168
- </Text>
169
- </TouchableOpacity>
170
- ) : null}
171
- <TouchableOpacity
172
- {...buttonTouchableOpacityProps}
173
- onPress={confirmHandler}>
174
- <Text
175
- style={[
176
- styles.button,
177
- styles.confirmButton,
178
- ]}>
179
- {confirmButtonText}
180
- </Text>
181
- </TouchableOpacity>
182
- </View>
183
- </View>
184
- </View>
185
- </Modal>
186
- );
187
- }
188
- );
189
-
190
- export default React.memo(TimerPickerModal);
@@ -1,88 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import type { TextStyle, ViewStyle } from "react-native";
3
-
4
- import type { CustomTimerPickerStyles } from "../TimerPicker/styles";
5
-
6
- export interface CustomTimerPickerModalStyles extends CustomTimerPickerStyles {
7
- button?: TextStyle;
8
- buttonContainer?: ViewStyle;
9
- cancelButton?: TextStyle;
10
- confirmButton?: TextStyle;
11
- container?: ViewStyle;
12
- contentContainer?: ViewStyle;
13
- modalTitle?: TextStyle;
14
- }
15
-
16
- const DARK_MODE_BACKGROUND_COLOR = "#232323";
17
- const DARK_MODE_TEXT_COLOR = "#E9E9E9";
18
- const LIGHT_MODE_BACKGROUND_COLOR = "#F1F1F1";
19
- const LIGHT_MODE_TEXT_COLOR = "#1B1B1B";
20
-
21
- export const generateStyles = (
22
- customStyles: CustomTimerPickerModalStyles | undefined
23
- ) =>
24
- StyleSheet.create({
25
- container: {
26
- justifyContent: "center",
27
- alignItems: "center",
28
- overflow: "hidden",
29
- ...customStyles?.container,
30
- },
31
- contentContainer: {
32
- backgroundColor:
33
- customStyles?.backgroundColor ??
34
- (customStyles?.theme === "dark"
35
- ? DARK_MODE_BACKGROUND_COLOR
36
- : LIGHT_MODE_BACKGROUND_COLOR),
37
- justifyContent: "center",
38
- alignItems: "center",
39
- borderRadius: 20,
40
- padding: 20,
41
- ...customStyles?.contentContainer,
42
- },
43
- buttonContainer: {
44
- flexDirection: "row",
45
- marginTop: 25,
46
- ...customStyles?.buttonContainer,
47
- },
48
- button: {
49
- marginHorizontal: 12,
50
- paddingVertical: 10,
51
- paddingHorizontal: 20,
52
- borderWidth: 1,
53
- borderRadius: 10,
54
- fontSize: 16,
55
- overflow: "hidden",
56
- ...customStyles?.text,
57
- ...customStyles?.button,
58
- },
59
- cancelButton: {
60
- borderColor: "gray",
61
- color:
62
- customStyles?.theme === "dark" ? DARK_MODE_TEXT_COLOR : "gray",
63
- backgroundColor:
64
- customStyles?.theme === "dark" ? "gray" : undefined,
65
- ...customStyles?.text,
66
- ...customStyles?.cancelButton,
67
- },
68
- confirmButton: {
69
- borderColor: "green",
70
- color:
71
- customStyles?.theme === "dark" ? DARK_MODE_TEXT_COLOR : "green",
72
- backgroundColor:
73
- customStyles?.theme === "dark" ? "green" : undefined,
74
- ...customStyles?.text,
75
- ...customStyles?.confirmButton,
76
- },
77
- modalTitle: {
78
- fontSize: 24,
79
- fontWeight: "600",
80
- marginBottom: 15,
81
- color:
82
- customStyles?.theme === "dark"
83
- ? DARK_MODE_TEXT_COLOR
84
- : LIGHT_MODE_TEXT_COLOR,
85
- ...customStyles?.text,
86
- ...customStyles?.modalTitle,
87
- },
88
- });