@umituz/react-native-notifications 1.3.2 → 1.3.3
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 +1 -1
- package/src/infrastructure/services/NotificationManager.ts +2 -0
- package/src/presentation/components/FrequencySelector.tsx +1 -1
- package/src/presentation/components/NotificationsSection.tsx +1 -1
- package/src/presentation/components/QuietHoursCard.tsx +9 -3
- package/src/presentation/components/ReminderItem.tsx +9 -3
- package/src/presentation/components/TimePresetSelector.tsx +2 -2
- package/src/presentation/screens/NotificationSettingsScreen.tsx +9 -3
- package/src/presentation/screens/NotificationsScreen.tsx +7 -4
- package/src/presentation/screens/ReminderListScreen.tsx +2 -2
package/package.json
CHANGED
|
@@ -40,7 +40,7 @@ export const FrequencySelector: React.FC<FrequencySelectorProps> = ({
|
|
|
40
40
|
<AtomicIcon
|
|
41
41
|
name={option.iconName}
|
|
42
42
|
size="sm"
|
|
43
|
-
color={isSelected ? '
|
|
43
|
+
color={isSelected ? 'onSurface' : 'secondary'}
|
|
44
44
|
/>
|
|
45
45
|
<AtomicText type="bodySmall" style={isSelected ? styles.selectedText : styles.text}>
|
|
46
46
|
{getLabel(option.labelKey)}
|
|
@@ -89,7 +89,7 @@ export const NotificationsSection: React.FC<NotificationsSectionProps> = ({
|
|
|
89
89
|
thumbColor={tokens.colors.surface}
|
|
90
90
|
/>
|
|
91
91
|
) : (
|
|
92
|
-
<AtomicIcon name="chevron-forward" size="md" color="
|
|
92
|
+
<AtomicIcon name="chevron-forward" size="md" color="secondary" />
|
|
93
93
|
)}
|
|
94
94
|
</TouchableOpacity>
|
|
95
95
|
</View>
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import React, { useMemo } from 'react';
|
|
7
7
|
import { View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
8
|
-
import { AtomicText, AtomicIcon,
|
|
8
|
+
import { AtomicText, AtomicIcon, AtomicCard } from '@umituz/react-native-design-system';
|
|
9
|
+
import { Switch } from 'react-native';
|
|
9
10
|
import { useAppDesignTokens } from '@umituz/react-native-design-system-theme';
|
|
10
11
|
import type { QuietHoursConfig, QuietHoursTranslations } from '../../infrastructure/services/types';
|
|
11
12
|
|
|
@@ -41,7 +42,12 @@ export const QuietHoursCard: React.FC<QuietHoursCardProps> = ({
|
|
|
41
42
|
<AtomicText type="bodyLarge">{translations.title}</AtomicText>
|
|
42
43
|
<AtomicText type="bodySmall" style={styles.description}>{translations.description}</AtomicText>
|
|
43
44
|
</View>
|
|
44
|
-
<
|
|
45
|
+
<Switch
|
|
46
|
+
value={config.enabled}
|
|
47
|
+
onValueChange={onToggle}
|
|
48
|
+
trackColor={{ false: tokens.colors.surfaceSecondary, true: tokens.colors.primary }}
|
|
49
|
+
thumbColor={tokens.colors.surface}
|
|
50
|
+
/>
|
|
45
51
|
</View>
|
|
46
52
|
|
|
47
53
|
{config.enabled && (
|
|
@@ -54,7 +60,7 @@ export const QuietHoursCard: React.FC<QuietHoursCardProps> = ({
|
|
|
54
60
|
</TouchableOpacity>
|
|
55
61
|
|
|
56
62
|
<View style={styles.timeSeparator}>
|
|
57
|
-
<AtomicIcon name="arrow-forward" size="sm" color="
|
|
63
|
+
<AtomicIcon name="arrow-forward" size="sm" color="secondary" />
|
|
58
64
|
</View>
|
|
59
65
|
|
|
60
66
|
<TouchableOpacity style={styles.timeButton} onPress={onEndTimePress} activeOpacity={0.7}>
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import React, { useMemo } from 'react';
|
|
7
7
|
import { View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
8
|
-
import { AtomicText, AtomicIcon
|
|
8
|
+
import { AtomicText, AtomicIcon } from '@umituz/react-native-design-system';
|
|
9
|
+
import { Switch } from 'react-native';
|
|
9
10
|
import { useAppDesignTokens } from '@umituz/react-native-design-system-theme';
|
|
10
11
|
import type { Reminder, ReminderFrequency } from '../../infrastructure/services/types';
|
|
11
12
|
|
|
@@ -65,7 +66,7 @@ export const ReminderItem: React.FC<ReminderItemProps> = ({
|
|
|
65
66
|
<AtomicIcon
|
|
66
67
|
name={getFrequencyIcon(reminder.frequency)}
|
|
67
68
|
size="md"
|
|
68
|
-
color={reminder.enabled ? 'primary' : '
|
|
69
|
+
color={reminder.enabled ? 'primary' : 'secondary'}
|
|
69
70
|
/>
|
|
70
71
|
</View>
|
|
71
72
|
<View style={styles.textContainer}>
|
|
@@ -87,7 +88,12 @@ export const ReminderItem: React.FC<ReminderItemProps> = ({
|
|
|
87
88
|
<TouchableOpacity style={styles.deleteButton} onPress={() => onDelete(reminder.id)}>
|
|
88
89
|
<AtomicIcon name="trash" size="sm" color="error" />
|
|
89
90
|
</TouchableOpacity>
|
|
90
|
-
<
|
|
91
|
+
<Switch
|
|
92
|
+
value={reminder.enabled}
|
|
93
|
+
onValueChange={() => onToggle(reminder.id)}
|
|
94
|
+
trackColor={{ false: tokens.colors.surfaceSecondary, true: tokens.colors.primary }}
|
|
95
|
+
thumbColor={tokens.colors.surface}
|
|
96
|
+
/>
|
|
91
97
|
</View>
|
|
92
98
|
</View>
|
|
93
99
|
);
|
|
@@ -51,7 +51,7 @@ export const TimePresetSelector: React.FC<TimePresetSelectorProps> = ({
|
|
|
51
51
|
<AtomicIcon
|
|
52
52
|
name={preset.iconName}
|
|
53
53
|
size="md"
|
|
54
|
-
color={isSelected ? '
|
|
54
|
+
color={isSelected ? 'onSurface' : 'secondary'}
|
|
55
55
|
/>
|
|
56
56
|
<AtomicText type="bodySmall" style={isSelected ? styles.selectedText : styles.text}>
|
|
57
57
|
{getPresetLabel(preset.labelKey)}
|
|
@@ -68,7 +68,7 @@ export const TimePresetSelector: React.FC<TimePresetSelectorProps> = ({
|
|
|
68
68
|
onPress={onSelectCustom}
|
|
69
69
|
activeOpacity={0.7}
|
|
70
70
|
>
|
|
71
|
-
<AtomicIcon name="time" size="md" color={isCustomSelected ? '
|
|
71
|
+
<AtomicIcon name="time" size="md" color={isCustomSelected ? 'onSurface' : 'secondary'} />
|
|
72
72
|
<AtomicText type="bodySmall" style={isCustomSelected ? styles.selectedText : styles.text}>
|
|
73
73
|
{customLabel}
|
|
74
74
|
</AtomicText>
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import React, { useEffect, useMemo, useCallback } from 'react';
|
|
7
7
|
import { View, StyleSheet, ActivityIndicator, ScrollView, TouchableOpacity } from 'react-native';
|
|
8
|
-
import { AtomicText, AtomicIcon,
|
|
8
|
+
import { AtomicText, AtomicIcon, AtomicCard, ScreenLayout } from '@umituz/react-native-design-system';
|
|
9
|
+
import { Switch } from 'react-native';
|
|
9
10
|
import { useAppDesignTokens } from '@umituz/react-native-design-system-theme';
|
|
10
11
|
import { QuietHoursCard } from '../components/QuietHoursCard';
|
|
11
12
|
import { useRemindersStore, useNotificationPreferences, useQuietHours, useReminders } from '../../infrastructure/storage/RemindersStore';
|
|
@@ -122,7 +123,7 @@ export const NotificationSettingsScreen: React.FC<NotificationSettingsScreenProp
|
|
|
122
123
|
<AtomicText type="bodySmall" style={styles.badgeText}>{reminders.length}</AtomicText>
|
|
123
124
|
</View>
|
|
124
125
|
)}
|
|
125
|
-
<AtomicIcon name="chevron-forward" size="md" color="
|
|
126
|
+
<AtomicIcon name="chevron-forward" size="md" color="secondary" />
|
|
126
127
|
</TouchableOpacity>
|
|
127
128
|
</AtomicCard>
|
|
128
129
|
|
|
@@ -160,7 +161,12 @@ const SettingRow: React.FC<SettingRowProps> = ({ iconName, title, description, v
|
|
|
160
161
|
<AtomicText type="bodyLarge">{title}</AtomicText>
|
|
161
162
|
<AtomicText type="bodySmall" style={styles.description}>{description}</AtomicText>
|
|
162
163
|
</View>
|
|
163
|
-
<
|
|
164
|
+
<Switch
|
|
165
|
+
value={value}
|
|
166
|
+
onValueChange={onToggle}
|
|
167
|
+
trackColor={{ false: tokens.colors.surfaceSecondary, true: tokens.colors.primary }}
|
|
168
|
+
thumbColor={tokens.colors.surface}
|
|
169
|
+
/>
|
|
164
170
|
</View>
|
|
165
171
|
);
|
|
166
172
|
};
|
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import React, { useMemo } from 'react';
|
|
9
9
|
import { View, StyleSheet, ActivityIndicator } from 'react-native';
|
|
10
|
-
import { AtomicIcon,
|
|
10
|
+
import { AtomicIcon, AtomicCard, AtomicText, ScreenLayout, STATIC_TOKENS } from '@umituz/react-native-design-system';
|
|
11
|
+
import { Switch } from 'react-native';
|
|
11
12
|
import { useAppDesignTokens } from '@umituz/react-native-design-system-theme';
|
|
12
13
|
import { useNotificationSettings } from '../../infrastructure/hooks/useNotificationSettings';
|
|
13
|
-
import type { DesignTokens } from '@umituz/react-native-design-system';
|
|
14
|
+
import type { DesignTokens, IconColor } from '@umituz/react-native-design-system';
|
|
14
15
|
|
|
15
16
|
export interface NotificationsScreenProps {
|
|
16
17
|
translations: {
|
|
@@ -19,7 +20,7 @@ export interface NotificationsScreenProps {
|
|
|
19
20
|
loadingText?: string;
|
|
20
21
|
};
|
|
21
22
|
iconName?: string;
|
|
22
|
-
iconColor?:
|
|
23
|
+
iconColor?: IconColor;
|
|
23
24
|
testID?: string;
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -64,9 +65,11 @@ export const NotificationsScreen: React.FC<NotificationsScreenProps> = ({
|
|
|
64
65
|
{translations.description}
|
|
65
66
|
</AtomicText>
|
|
66
67
|
</View>
|
|
67
|
-
<
|
|
68
|
+
<Switch
|
|
68
69
|
value={notificationsEnabled}
|
|
69
70
|
onValueChange={setNotificationsEnabled}
|
|
71
|
+
trackColor={{ false: tokens.colors.surfaceSecondary, true: tokens.colors.primary }}
|
|
72
|
+
thumbColor={tokens.colors.surface}
|
|
70
73
|
testID="notifications-toggle"
|
|
71
74
|
/>
|
|
72
75
|
</View>
|
|
@@ -65,7 +65,7 @@ export const ReminderListScreen: React.FC<ReminderListScreenProps> = ({
|
|
|
65
65
|
const renderEmpty = useCallback(() => (
|
|
66
66
|
<View style={styles.emptyContainer}>
|
|
67
67
|
<View style={styles.emptyIconContainer}>
|
|
68
|
-
<AtomicIcon name="notifications-off" size="xl" color="
|
|
68
|
+
<AtomicIcon name="notifications-off" size="xl" color="secondary" />
|
|
69
69
|
</View>
|
|
70
70
|
<AtomicText type="bodyLarge" style={styles.emptyTitle}>{translations.emptyTitle}</AtomicText>
|
|
71
71
|
<AtomicText type="bodySmall" style={styles.emptyDescription}>{translations.emptyDescription}</AtomicText>
|
|
@@ -97,7 +97,7 @@ export const ReminderListScreen: React.FC<ReminderListScreenProps> = ({
|
|
|
97
97
|
|
|
98
98
|
{canAddMore && (
|
|
99
99
|
<TouchableOpacity style={styles.fab} onPress={onAddPress} activeOpacity={0.8}>
|
|
100
|
-
<AtomicIcon name="add" size="md" color="
|
|
100
|
+
<AtomicIcon name="add" size="md" color="onSurface" />
|
|
101
101
|
<AtomicText type="bodyMedium" style={styles.fabText}>{translations.addButtonLabel}</AtomicText>
|
|
102
102
|
</TouchableOpacity>
|
|
103
103
|
)}
|