@umituz/react-native-settings 4.21.12 → 4.21.14
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/domains/gamification/components/GamificationScreenWrapper.tsx +29 -10
- package/src/domains/gamification/index.ts +1 -0
- package/src/domains/gamification/types/index.ts +20 -0
- package/src/{notifications → domains/notifications}/index.ts +21 -21
- package/src/{notifications → domains/notifications}/presentation/hooks/useNotificationSettingsUI.ts +1 -1
- package/src/{notifications → domains/notifications}/presentation/screens/NotificationSettingsScreen.tsx +3 -3
- package/src/{notifications/domains → domains/notifications}/quietHours/infrastructure/hooks/useQuietHoursActions.ts +1 -1
- package/src/{notifications/domains → domains/notifications}/quietHours/presentation/components/QuietHoursCard.tsx +2 -2
- package/src/{notifications/domains → domains/notifications}/reminders/infrastructure/config/reminderPresets.ts +1 -1
- package/src/{notifications/domains → domains/notifications}/reminders/infrastructure/hooks/useReminderActions.ts +4 -4
- package/src/{notifications/domains → domains/notifications}/reminders/infrastructure/storage/RemindersStore.ts +1 -1
- package/src/{notifications/domains → domains/notifications}/reminders/presentation/components/FrequencySelector.tsx +1 -1
- package/src/{notifications/domains → domains/notifications}/reminders/presentation/components/ReminderForm.tsx +1 -1
- package/src/{notifications/domains → domains/notifications}/reminders/presentation/components/ReminderItem.tsx +1 -1
- package/src/{notifications/domains → domains/notifications}/reminders/presentation/components/TimePresetSelector.tsx +1 -1
- package/src/{notifications/domains → domains/notifications}/reminders/presentation/screens/ReminderListScreen.tsx +1 -1
- package/src/index.ts +2 -1
- package/src/presentation/utils/configCreators.ts +32 -0
- /package/src/{notifications → domains/notifications}/infrastructure/config/notificationsConfig.ts +0 -0
- /package/src/{notifications → domains/notifications}/infrastructure/hooks/useNotificationSettings.ts +0 -0
- /package/src/{notifications → domains/notifications}/infrastructure/services/NotificationBadgeManager.ts +0 -0
- /package/src/{notifications → domains/notifications}/infrastructure/services/NotificationManager.ts +0 -0
- /package/src/{notifications → domains/notifications}/infrastructure/services/NotificationPermissions.ts +0 -0
- /package/src/{notifications → domains/notifications}/infrastructure/services/NotificationScheduler.ts +0 -0
- /package/src/{notifications → domains/notifications}/infrastructure/services/NotificationService.ts +0 -0
- /package/src/{notifications → domains/notifications}/infrastructure/services/types.ts +0 -0
- /package/src/{notifications → domains/notifications}/infrastructure/storage/NotificationsStore.ts +0 -0
- /package/src/{notifications → domains/notifications}/infrastructure/utils/dev.ts +0 -0
- /package/src/{notifications → domains/notifications}/infrastructure/utils/idGenerator.ts +0 -0
- /package/src/{notifications → domains/notifications}/infrastructure/utils/triggerBuilder.ts +0 -0
- /package/src/{notifications → domains/notifications}/presentation/components/NotificationsSection.tsx +0 -0
- /package/src/{notifications → domains/notifications}/presentation/components/RemindersNavRow.styles.ts +0 -0
- /package/src/{notifications → domains/notifications}/presentation/components/RemindersNavRow.tsx +0 -0
- /package/src/{notifications → domains/notifications}/presentation/components/SettingRow.tsx +0 -0
- /package/src/{notifications → domains/notifications}/presentation/hooks/useTimePicker.ts +0 -0
- /package/src/{notifications → domains/notifications}/presentation/screens/NotificationSettingsScreen.styles.ts +0 -0
- /package/src/{notifications → domains/notifications}/presentation/screens/NotificationsScreen.tsx +0 -0
- /package/src/{notifications/domains → domains/notifications}/reminders/presentation/components/FormButton.tsx +0 -0
- /package/src/{notifications/domains → domains/notifications}/reminders/presentation/components/WeekdaySelector.tsx +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "4.21.
|
|
3
|
+
"version": "4.21.14",
|
|
4
4
|
"description": "Complete settings hub for React Native apps - consolidated package with settings, about, legal, appearance, feedback, FAQs, rating, and gamification",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { useGamification } from '../hooks/useGamification';
|
|
3
3
|
import { GamificationScreen } from './GamificationScreen';
|
|
4
4
|
import type { GamificationConfig } from '../types';
|
|
5
|
+
import type { AchievementItemProps } from '../components';
|
|
5
6
|
|
|
6
7
|
interface GamificationScreenWrapperProps {
|
|
7
8
|
config: GamificationConfig;
|
|
@@ -16,6 +17,19 @@ export const GamificationScreenWrapper: React.FC<GamificationScreenWrapperProps>
|
|
|
16
17
|
achievements,
|
|
17
18
|
} = useGamification(config);
|
|
18
19
|
|
|
20
|
+
// Transform store achievements to UI props
|
|
21
|
+
const achievementItems: any[] = achievements.map(a => ({
|
|
22
|
+
...a,
|
|
23
|
+
title: a.title,
|
|
24
|
+
description: a.description,
|
|
25
|
+
icon: a.icon,
|
|
26
|
+
isUnlocked: a.isUnlocked,
|
|
27
|
+
progress: a.progress,
|
|
28
|
+
threshold: a.threshold,
|
|
29
|
+
id: a.id,
|
|
30
|
+
type: a.type
|
|
31
|
+
}));
|
|
32
|
+
|
|
19
33
|
return (
|
|
20
34
|
<GamificationScreen
|
|
21
35
|
title={config.translations.title}
|
|
@@ -24,22 +38,27 @@ export const GamificationScreenWrapper: React.FC<GamificationScreenWrapperProps>
|
|
|
24
38
|
streakTitle={config.translations.streakTitle}
|
|
25
39
|
levelProps={{
|
|
26
40
|
level: level.currentLevel,
|
|
27
|
-
|
|
41
|
+
points: level.currentPoints,
|
|
28
42
|
pointsToNext: level.pointsToNext,
|
|
29
43
|
progress: level.progress,
|
|
30
44
|
levelTitle: config.translations.levelTitle,
|
|
45
|
+
showPoints: true,
|
|
31
46
|
}}
|
|
32
47
|
streakProps={{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
points,
|
|
39
|
-
tasksCompleted: totalTasksCompleted,
|
|
40
|
-
streak: streak.current,
|
|
48
|
+
current: streak.current,
|
|
49
|
+
longest: streak.longest,
|
|
50
|
+
currentLabel: config.translations.currentStreak,
|
|
51
|
+
bestLabel: config.translations.bestStreak,
|
|
52
|
+
daysLabel: config.translations.days,
|
|
41
53
|
}}
|
|
42
|
-
|
|
54
|
+
stats={[
|
|
55
|
+
{
|
|
56
|
+
label: config.translations.statsTitle,
|
|
57
|
+
value: points, // Pass number directly
|
|
58
|
+
icon: "star",
|
|
59
|
+
},
|
|
60
|
+
]}
|
|
61
|
+
achievements={achievementItems}
|
|
43
62
|
emptyAchievementsText={config.translations.emptyAchievements}
|
|
44
63
|
/>
|
|
45
64
|
);
|
|
@@ -8,6 +8,9 @@ export interface AchievementDefinition {
|
|
|
8
8
|
id: string;
|
|
9
9
|
threshold: number;
|
|
10
10
|
type: "count" | "streak" | "milestone";
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
icon: string;
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
// Achievement State (internal)
|
|
@@ -39,6 +42,19 @@ export interface StreakState {
|
|
|
39
42
|
lastActivityDate: string | null;
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
// Gamification Translations
|
|
46
|
+
export interface GamificationTranslations {
|
|
47
|
+
title: string;
|
|
48
|
+
statsTitle: string;
|
|
49
|
+
achievementsTitle: string;
|
|
50
|
+
streakTitle: string;
|
|
51
|
+
bestStreak: string;
|
|
52
|
+
currentStreak: string;
|
|
53
|
+
days: string;
|
|
54
|
+
levelTitle: string;
|
|
55
|
+
emptyAchievements: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
42
58
|
// Gamification Config (provided by app via props)
|
|
43
59
|
export interface GamificationConfig {
|
|
44
60
|
storageKey: string;
|
|
@@ -46,8 +62,12 @@ export interface GamificationConfig {
|
|
|
46
62
|
levels: LevelDefinition[];
|
|
47
63
|
pointsPerAction?: number;
|
|
48
64
|
streakBonusMultiplier?: number;
|
|
65
|
+
enabled?: boolean;
|
|
66
|
+
translations: GamificationTranslations;
|
|
49
67
|
}
|
|
50
68
|
|
|
69
|
+
export type GamificationSettingsConfig = GamificationConfig;
|
|
70
|
+
|
|
51
71
|
// Store State
|
|
52
72
|
export interface GamificationState {
|
|
53
73
|
points: number;
|
|
@@ -41,8 +41,8 @@ export {
|
|
|
41
41
|
getTimePresetById,
|
|
42
42
|
formatTime,
|
|
43
43
|
parseTime,
|
|
44
|
-
} from './
|
|
45
|
-
export type { FrequencyOption, WeekdayOption } from './
|
|
44
|
+
} from './reminders/infrastructure/config/reminderPresets';
|
|
45
|
+
export type { FrequencyOption, WeekdayOption } from './reminders/infrastructure/config/reminderPresets';
|
|
46
46
|
|
|
47
47
|
// ============================================================================
|
|
48
48
|
// SERVICES
|
|
@@ -66,15 +66,15 @@ export {
|
|
|
66
66
|
useQuietHours,
|
|
67
67
|
useRemindersLoading,
|
|
68
68
|
useRemindersInitialized,
|
|
69
|
-
} from './
|
|
69
|
+
} from './reminders/infrastructure/storage/RemindersStore';
|
|
70
70
|
|
|
71
71
|
// ============================================================================
|
|
72
72
|
// HOOKS
|
|
73
73
|
// ============================================================================
|
|
74
74
|
|
|
75
75
|
export { useNotificationSettings } from './infrastructure/hooks/useNotificationSettings';
|
|
76
|
-
export { useReminderActions } from './
|
|
77
|
-
export { useQuietHoursActions } from './
|
|
76
|
+
export { useReminderActions } from './reminders/infrastructure/hooks/useReminderActions';
|
|
77
|
+
export { useQuietHoursActions } from './quietHours/infrastructure/hooks/useQuietHoursActions';
|
|
78
78
|
export { useNotificationSettingsUI } from './presentation/hooks/useNotificationSettingsUI';
|
|
79
79
|
|
|
80
80
|
// ============================================================================
|
|
@@ -87,8 +87,8 @@ export type { NotificationsScreenProps } from './presentation/screens/Notificati
|
|
|
87
87
|
export { NotificationSettingsScreen } from './presentation/screens/NotificationSettingsScreen';
|
|
88
88
|
export type { NotificationSettingsScreenProps } from './presentation/screens/NotificationSettingsScreen';
|
|
89
89
|
|
|
90
|
-
export { ReminderListScreen } from './
|
|
91
|
-
export type { ReminderListScreenProps } from './
|
|
90
|
+
export { ReminderListScreen } from './reminders/presentation/screens/ReminderListScreen';
|
|
91
|
+
export type { ReminderListScreenProps } from './reminders/presentation/screens/ReminderListScreen';
|
|
92
92
|
|
|
93
93
|
// ============================================================================
|
|
94
94
|
// COMPONENTS
|
|
@@ -97,26 +97,26 @@ export type { ReminderListScreenProps } from './domains/reminders/presentation/s
|
|
|
97
97
|
export { NotificationsSection } from './presentation/components/NotificationsSection';
|
|
98
98
|
export type { NotificationsSectionProps, NotificationsSectionConfig } from './presentation/components/NotificationsSection';
|
|
99
99
|
|
|
100
|
-
export { TimePresetSelector } from './
|
|
101
|
-
export type { TimePresetSelectorProps } from './
|
|
100
|
+
export { TimePresetSelector } from './reminders/presentation/components/TimePresetSelector';
|
|
101
|
+
export type { TimePresetSelectorProps } from './reminders/presentation/components/TimePresetSelector';
|
|
102
102
|
|
|
103
|
-
export { FrequencySelector } from './
|
|
104
|
-
export type { FrequencySelectorProps } from './
|
|
103
|
+
export { FrequencySelector } from './reminders/presentation/components/FrequencySelector';
|
|
104
|
+
export type { FrequencySelectorProps } from './reminders/presentation/components/FrequencySelector';
|
|
105
105
|
|
|
106
|
-
export { WeekdaySelector } from './
|
|
107
|
-
export type { WeekdaySelectorProps } from './
|
|
106
|
+
export { WeekdaySelector } from './reminders/presentation/components/WeekdaySelector';
|
|
107
|
+
export type { WeekdaySelectorProps } from './reminders/presentation/components/WeekdaySelector';
|
|
108
108
|
|
|
109
|
-
export { ReminderItem } from './
|
|
110
|
-
export type { ReminderItemProps, ReminderItemTranslations } from './
|
|
109
|
+
export { ReminderItem } from './reminders/presentation/components/ReminderItem';
|
|
110
|
+
export type { ReminderItemProps, ReminderItemTranslations } from './reminders/presentation/components/ReminderItem';
|
|
111
111
|
|
|
112
|
-
export { ReminderForm } from './
|
|
113
|
-
export type { ReminderFormProps, ReminderFormTranslations } from './
|
|
112
|
+
export { ReminderForm } from './reminders/presentation/components/ReminderForm';
|
|
113
|
+
export type { ReminderFormProps, ReminderFormTranslations } from './reminders/presentation/components/ReminderForm';
|
|
114
114
|
|
|
115
|
-
export { FormButton } from './
|
|
116
|
-
export type { FormButtonProps } from './
|
|
115
|
+
export { FormButton } from './reminders/presentation/components/FormButton';
|
|
116
|
+
export type { FormButtonProps } from './reminders/presentation/components/FormButton';
|
|
117
117
|
|
|
118
|
-
export { QuietHoursCard } from './
|
|
119
|
-
export type { QuietHoursCardProps } from './
|
|
118
|
+
export { QuietHoursCard } from './quietHours/presentation/components/QuietHoursCard';
|
|
119
|
+
export type { QuietHoursCardProps } from './quietHours/presentation/components/QuietHoursCard';
|
|
120
120
|
|
|
121
121
|
export { RemindersNavRow } from './presentation/components/RemindersNavRow';
|
|
122
122
|
export type { RemindersNavRowProps } from './presentation/components/RemindersNavRow';
|
package/src/{notifications → domains/notifications}/presentation/hooks/useNotificationSettingsUI.ts
RENAMED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { useEffect, useCallback } from 'react';
|
|
7
|
-
import { useNotificationPreferences, useQuietHours, usePreferencesStore, useRemindersLoading } from '../../
|
|
7
|
+
import { useNotificationPreferences, useQuietHours, usePreferencesStore, useRemindersLoading } from '../../reminders/infrastructure/storage/RemindersStore';
|
|
8
8
|
import { notificationService } from '../../infrastructure/services/NotificationService';
|
|
9
9
|
|
|
10
10
|
export const useNotificationSettingsUI = () => {
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { View } from 'react-native';
|
|
8
8
|
import { AtomicCard, ScreenLayout, AtomicSpinner } from '@umituz/react-native-design-system';
|
|
9
|
-
import { QuietHoursCard } from '../../
|
|
9
|
+
import { QuietHoursCard } from '../../quietHours/presentation/components/QuietHoursCard';
|
|
10
10
|
import { SettingRow } from '../components/SettingRow';
|
|
11
11
|
import { RemindersNavRow } from '../components/RemindersNavRow';
|
|
12
12
|
import { useNotificationSettingsUI } from '../hooks/useNotificationSettingsUI';
|
|
13
13
|
import { useTimePicker } from '../hooks/useTimePicker';
|
|
14
|
-
import { useReminders } from '../../
|
|
15
|
-
import { useQuietHoursActions } from '../../
|
|
14
|
+
import { useReminders } from '../../reminders/infrastructure/storage/RemindersStore';
|
|
15
|
+
import { useQuietHoursActions } from '../../quietHours/infrastructure/hooks/useQuietHoursActions';
|
|
16
16
|
import type { NotificationSettingsTranslations, QuietHoursTranslations } from '../../infrastructure/services/types';
|
|
17
17
|
import { createStyles } from './NotificationSettingsScreen.styles';
|
|
18
18
|
import { useAppDesignTokens } from '@umituz/react-native-design-system';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { useCallback } from 'react';
|
|
7
7
|
import { usePreferencesStore, useQuietHours } from '../../../reminders/infrastructure/storage/RemindersStore';
|
|
8
|
-
import type { QuietHoursConfig } from '
|
|
8
|
+
import type { QuietHoursConfig } from '../../../infrastructure/services/types';
|
|
9
9
|
|
|
10
10
|
export const useQuietHoursActions = () => {
|
|
11
11
|
const quietHours = useQuietHours();
|
|
@@ -8,8 +8,8 @@ import { View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
|
8
8
|
import { AtomicText, AtomicIcon, AtomicCard } from '@umituz/react-native-design-system';
|
|
9
9
|
import { Switch } from 'react-native';
|
|
10
10
|
import { useAppDesignTokens } from '@umituz/react-native-design-system';
|
|
11
|
-
import { SettingRow } from '
|
|
12
|
-
import type { QuietHoursConfig, QuietHoursTranslations } from '
|
|
11
|
+
import { SettingRow } from '../../../presentation/components/SettingRow';
|
|
12
|
+
import type { QuietHoursConfig, QuietHoursTranslations } from '../../../infrastructure/services/types';
|
|
13
13
|
|
|
14
14
|
export interface QuietHoursCardProps {
|
|
15
15
|
config: QuietHoursConfig;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Default time presets and frequency options for reminders
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { TimePreset, ReminderFrequency } from '
|
|
6
|
+
import type { TimePreset, ReminderFrequency } from '../../../infrastructure/services/types';
|
|
7
7
|
|
|
8
8
|
// ============================================================================
|
|
9
9
|
// DEFAULT TIME PRESETS
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
import { useCallback } from 'react';
|
|
7
7
|
import { useRemindersStore } from '../storage/RemindersStore';
|
|
8
|
-
import { NotificationScheduler } from '
|
|
9
|
-
import { generateReminderId } from '
|
|
10
|
-
import { buildTrigger } from '
|
|
11
|
-
import type { Reminder, CreateReminderInput, UpdateReminderInput } from '
|
|
8
|
+
import { NotificationScheduler } from '../../../infrastructure/services/NotificationScheduler';
|
|
9
|
+
import { generateReminderId } from '../../../infrastructure/utils/idGenerator';
|
|
10
|
+
import { buildTrigger } from '../../../infrastructure/utils/triggerBuilder';
|
|
11
|
+
import type { Reminder, CreateReminderInput, UpdateReminderInput } from '../../../infrastructure/services/types';
|
|
12
12
|
|
|
13
13
|
const scheduler = new NotificationScheduler();
|
|
14
14
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { createStore } from '@umituz/react-native-storage';
|
|
7
|
-
import type { Reminder, QuietHoursConfig, NotificationPreferences } from '
|
|
7
|
+
import type { Reminder, QuietHoursConfig, NotificationPreferences } from '../../../infrastructure/services/types';
|
|
8
8
|
|
|
9
9
|
// ============================================================================
|
|
10
10
|
// REMINDERS STORE
|
|
@@ -7,7 +7,7 @@ import React, { useMemo } from 'react';
|
|
|
7
7
|
import { View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
8
8
|
import { AtomicText, AtomicIcon } from '@umituz/react-native-design-system';
|
|
9
9
|
import { useAppDesignTokens } from '@umituz/react-native-design-system';
|
|
10
|
-
import type { ReminderFrequency } from '
|
|
10
|
+
import type { ReminderFrequency } from '../../../infrastructure/services/types';
|
|
11
11
|
import type { FrequencyOption } from '../../infrastructure/config/reminderPresets';
|
|
12
12
|
|
|
13
13
|
export interface FrequencySelectorProps {
|
|
@@ -12,7 +12,7 @@ import { FrequencySelector } from './FrequencySelector';
|
|
|
12
12
|
import { WeekdaySelector } from './WeekdaySelector';
|
|
13
13
|
import { FormButton } from './FormButton';
|
|
14
14
|
import { DEFAULT_TIME_PRESETS, FREQUENCY_OPTIONS } from '../../infrastructure/config/reminderPresets';
|
|
15
|
-
import type { Reminder, ReminderFrequency, CreateReminderInput, TimePreset } from '
|
|
15
|
+
import type { Reminder, ReminderFrequency, CreateReminderInput, TimePreset } from '../../../infrastructure/services/types';
|
|
16
16
|
|
|
17
17
|
export interface ReminderFormTranslations {
|
|
18
18
|
titleLabel: string;
|
|
@@ -8,7 +8,7 @@ import { View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
|
8
8
|
import { AtomicText, AtomicIcon } from '@umituz/react-native-design-system';
|
|
9
9
|
import { Switch } from 'react-native';
|
|
10
10
|
import { useAppDesignTokens } from '@umituz/react-native-design-system';
|
|
11
|
-
import type { Reminder, ReminderFrequency } from '
|
|
11
|
+
import type { Reminder, ReminderFrequency } from '../../../infrastructure/services/types';
|
|
12
12
|
|
|
13
13
|
export interface ReminderItemTranslations {
|
|
14
14
|
frequencyOnce: string;
|
|
@@ -7,7 +7,7 @@ import React, { useMemo } from 'react';
|
|
|
7
7
|
import { View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
8
8
|
import { AtomicText, AtomicIcon } from '@umituz/react-native-design-system';
|
|
9
9
|
import { useAppDesignTokens } from '@umituz/react-native-design-system';
|
|
10
|
-
import type { TimePreset } from '
|
|
10
|
+
import type { TimePreset } from '../../../infrastructure/services/types';
|
|
11
11
|
|
|
12
12
|
export interface TimePresetSelectorProps {
|
|
13
13
|
presets: TimePreset[];
|
|
@@ -10,7 +10,7 @@ import { useAppDesignTokens } from '@umituz/react-native-design-system';
|
|
|
10
10
|
import { ReminderItem } from '../components/ReminderItem';
|
|
11
11
|
import { useRemindersStore, useReminders, useRemindersLoading } from '../../infrastructure/storage/RemindersStore';
|
|
12
12
|
import { useReminderActions } from '../../infrastructure/hooks/useReminderActions';
|
|
13
|
-
import type { Reminder, ReminderTranslations } from '
|
|
13
|
+
import type { Reminder, ReminderTranslations } from '../../../infrastructure/services/types';
|
|
14
14
|
|
|
15
15
|
export interface ReminderListScreenProps {
|
|
16
16
|
translations: ReminderTranslations;
|
package/src/index.ts
CHANGED
|
@@ -129,7 +129,7 @@ export * from "./domains/gamification";
|
|
|
129
129
|
// =============================================================================
|
|
130
130
|
|
|
131
131
|
// Notifications Domain
|
|
132
|
-
export * from "./notifications";
|
|
132
|
+
export * from "./domains/notifications";
|
|
133
133
|
|
|
134
134
|
export {
|
|
135
135
|
createAppearanceConfig,
|
|
@@ -141,6 +141,7 @@ export {
|
|
|
141
141
|
createRatingConfig,
|
|
142
142
|
createFAQConfig,
|
|
143
143
|
createSubscriptionConfig,
|
|
144
|
+
createGamificationConfig,
|
|
144
145
|
type TranslationFunction,
|
|
145
146
|
type FeedbackFormData,
|
|
146
147
|
} from './presentation/utils';
|
|
@@ -16,6 +16,11 @@ import type {
|
|
|
16
16
|
FAQConfig,
|
|
17
17
|
SubscriptionConfig,
|
|
18
18
|
} from "../screens/types";
|
|
19
|
+
import type {
|
|
20
|
+
GamificationConfig,
|
|
21
|
+
AchievementDefinition,
|
|
22
|
+
LevelDefinition,
|
|
23
|
+
} from "../../domains/gamification/types";
|
|
19
24
|
|
|
20
25
|
/**
|
|
21
26
|
* Translation function type
|
|
@@ -149,3 +154,30 @@ export const createSubscriptionConfig = (
|
|
|
149
154
|
onPress: typeof routeOrOnPress === "function" ? routeOrOnPress : undefined,
|
|
150
155
|
isPremium,
|
|
151
156
|
});
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Create gamification configuration
|
|
160
|
+
*/
|
|
161
|
+
export const createGamificationConfig = (
|
|
162
|
+
t: TranslationFunction,
|
|
163
|
+
storageKey: string,
|
|
164
|
+
achievements: AchievementDefinition[],
|
|
165
|
+
levels: LevelDefinition[],
|
|
166
|
+
enabled = true,
|
|
167
|
+
): GamificationConfig => ({
|
|
168
|
+
enabled,
|
|
169
|
+
storageKey,
|
|
170
|
+
achievements,
|
|
171
|
+
levels,
|
|
172
|
+
translations: {
|
|
173
|
+
title: t("settings.gamification.title"),
|
|
174
|
+
statsTitle: t("settings.gamification.stats.title"),
|
|
175
|
+
achievementsTitle: t("settings.gamification.achievements.title"),
|
|
176
|
+
streakTitle: t("settings.gamification.streak.title"),
|
|
177
|
+
bestStreak: t("settings.gamification.streak.best"),
|
|
178
|
+
currentStreak: t("settings.gamification.streak.current"),
|
|
179
|
+
days: t("settings.gamification.streak.days"),
|
|
180
|
+
levelTitle: t("settings.gamification.level.title"),
|
|
181
|
+
emptyAchievements: t("settings.gamification.achievements.empty"),
|
|
182
|
+
},
|
|
183
|
+
});
|
/package/src/{notifications → domains/notifications}/infrastructure/config/notificationsConfig.ts
RENAMED
|
File without changes
|
/package/src/{notifications → domains/notifications}/infrastructure/hooks/useNotificationSettings.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/src/{notifications → domains/notifications}/infrastructure/services/NotificationManager.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{notifications → domains/notifications}/infrastructure/services/NotificationService.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/src/{notifications → domains/notifications}/infrastructure/storage/NotificationsStore.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{notifications → domains/notifications}/presentation/components/RemindersNavRow.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{notifications → domains/notifications}/presentation/screens/NotificationsScreen.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|