@umituz/react-native-design-system 2.3.18 → 2.3.20
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.20",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive and safe area utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -33,6 +33,10 @@ export const Countdown: React.FC<CountdownProps> = ({
|
|
|
33
33
|
showToggle = alternateTargets.length > 0,
|
|
34
34
|
layout = 'grid',
|
|
35
35
|
size = 'medium',
|
|
36
|
+
showDays,
|
|
37
|
+
showHours = true,
|
|
38
|
+
showMinutes = true,
|
|
39
|
+
showSeconds = true,
|
|
36
40
|
} = displayConfig;
|
|
37
41
|
|
|
38
42
|
const [currentTargetIndex, setCurrentTargetIndex] = React.useState(0);
|
|
@@ -70,27 +74,35 @@ export const Countdown: React.FC<CountdownProps> = ({
|
|
|
70
74
|
const timeUnits = useMemo(() => {
|
|
71
75
|
const units = [];
|
|
72
76
|
|
|
73
|
-
|
|
77
|
+
const shouldShowDays = showDays !== undefined ? showDays : timeRemaining.days > 0;
|
|
78
|
+
|
|
79
|
+
if (shouldShowDays) {
|
|
74
80
|
units.push({
|
|
75
81
|
value: timeRemaining.days,
|
|
76
82
|
label: labelFormatter('days', timeRemaining.days)
|
|
77
83
|
});
|
|
78
84
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
85
|
+
if (showHours) {
|
|
86
|
+
units.push({
|
|
87
|
+
value: timeRemaining.hours,
|
|
88
|
+
label: labelFormatter('hours', timeRemaining.hours)
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (showMinutes) {
|
|
92
|
+
units.push({
|
|
93
|
+
value: timeRemaining.minutes,
|
|
94
|
+
label: labelFormatter('minutes', timeRemaining.minutes)
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (showSeconds) {
|
|
98
|
+
units.push({
|
|
99
|
+
value: timeRemaining.seconds,
|
|
100
|
+
label: labelFormatter('seconds', timeRemaining.seconds)
|
|
101
|
+
});
|
|
102
|
+
}
|
|
91
103
|
|
|
92
104
|
return units;
|
|
93
|
-
}, [timeRemaining, labelFormatter]);
|
|
105
|
+
}, [timeRemaining, labelFormatter, showDays, showHours, showMinutes, showSeconds]);
|
|
94
106
|
|
|
95
107
|
return (
|
|
96
108
|
<View style={styles.container}>
|
|
@@ -14,6 +14,14 @@ export function calculateTimeRemaining(targetDate: Date | string): TimeRemaining
|
|
|
14
14
|
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
15
15
|
const seconds = totalSeconds % 60;
|
|
16
16
|
|
|
17
|
+
if (__DEV__) {
|
|
18
|
+
console.log('[TimeCalculator] Now:', now);
|
|
19
|
+
console.log('[TimeCalculator] Target:', target);
|
|
20
|
+
console.log('[TimeCalculator] Difference (ms):', difference);
|
|
21
|
+
console.log('[TimeCalculator] Total seconds:', totalSeconds);
|
|
22
|
+
console.log('[TimeCalculator] Calculated - Days:', days, 'Hours:', hours, 'Minutes:', minutes, 'Seconds:', seconds);
|
|
23
|
+
}
|
|
24
|
+
|
|
17
25
|
return {
|
|
18
26
|
days,
|
|
19
27
|
hours,
|