@umituz/react-native-settings 5.2.18 → 5.2.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 +1 -1
- package/src/domains/about/presentation/hooks/useAboutInfo.ts +63 -98
- package/src/domains/feedback/presentation/components/SupportSection.tsx +2 -1
- package/src/domains/localization/infrastructure/hooks/useTranslation.ts +0 -3
- package/src/domains/localization/infrastructure/storage/LanguageInitializer.ts +0 -4
- package/src/domains/localization/infrastructure/storage/localizationStoreUtils.ts +6 -7
- package/src/domains/localization/presentation/components/LanguageItem.tsx +0 -2
- package/src/domains/localization/presentation/providers/LocalizationManager.tsx +2 -1
- package/src/domains/notifications/index.ts +7 -6
- package/src/domains/notifications/infrastructure/services/NotificationBadgeManager.ts +1 -1
- package/src/domains/notifications/infrastructure/services/NotificationManager.ts +1 -1
- package/src/domains/notifications/infrastructure/services/NotificationPermissions.ts +1 -1
- package/src/domains/notifications/infrastructure/storage/UnifiedNotificationStore.ts +223 -0
- package/src/domains/notifications/presentation/hooks/useNotificationSettingsUI.ts +2 -2
- package/src/domains/notifications/presentation/screens/NotificationSettingsScreen.tsx +1 -1
- package/src/domains/notifications/quietHours/infrastructure/hooks/useQuietHoursActions.ts +6 -6
- package/src/domains/notifications/reminders/infrastructure/hooks/useReminderActions.ts +5 -5
- package/src/domains/notifications/reminders/presentation/screens/ReminderListScreen.tsx +1 -1
- package/src/domains/rating/presentation/hooks/useAppRating.tsx +2 -1
- package/src/infrastructure/storage/storeConfig.ts +114 -0
- package/src/infrastructure/utils/async/core.ts +3 -2
- package/src/infrastructure/utils/errorHandlers.ts +4 -2
- package/src/infrastructure/utils/index.ts +1 -1
- package/src/presentation/components/SettingsNavigationItem.tsx +109 -0
- package/src/presentation/navigation/utils/index.ts +8 -1
- package/src/presentation/navigation/utils/navigationHelpers.ts +118 -0
- package/src/presentation/screens/components/SettingsContent.tsx +21 -11
- package/src/presentation/screens/components/sections/SupportSettingsSection.tsx +4 -2
- package/src/presentation/screens/types/UserFeatureConfig.ts +5 -4
- package/src/presentation/utils/config-creators/feature-configs.ts +3 -2
- package/src/presentation/utils/settingsConfigFactory.ts +2 -1
- package/src/utils/appUtils.ts +0 -6
- package/src/utils/errorUtils.ts +54 -0
- package/src/utils/hooks/index.ts +6 -0
- package/src/utils/hooks/useAsyncStateUpdate.ts +114 -0
- package/src/utils/hooks/useMountSafety.ts +30 -0
- package/src/utils/index.ts +2 -0
- package/src/domains/about/presentation/hooks/useAboutInfo.utils.ts +0 -167
- package/src/domains/notifications/infrastructure/storage/NotificationsStore.ts +0 -45
- package/src/domains/notifications/infrastructure/utils/dev.ts +0 -22
- package/src/domains/notifications/reminders/infrastructure/storage/RemindersStore.ts +0 -152
- package/src/infrastructure/utils/styleUtils.ts +0 -7
- package/src/presentation/screens/components/GamificationSettingsItem.tsx +0 -55
- package/src/presentation/screens/components/SubscriptionSettingsItem.tsx +0 -38
- package/src/presentation/screens/components/VideoTutorialSettingsItem.tsx +0 -51
- package/src/presentation/screens/components/WalletSettingsItem.tsx +0 -36
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { IconName } from "@umituz/react-native-design-system";
|
|
3
|
-
import { SettingsItemCard } from "../../components/SettingsItemCard";
|
|
4
|
-
import { useGamification } from "../../../domains/gamification";
|
|
5
|
-
import type { GamificationItemConfig } from "../types/UserFeatureConfig";
|
|
6
|
-
import type { GamificationSettingsConfig } from "../../../domains/gamification";
|
|
7
|
-
import { compareGamificationProps } from "../../../infrastructure/utils/memoComparisonUtils";
|
|
8
|
-
import { useSettingsNavigation } from "../../navigation/hooks/useSettingsNavigation";
|
|
9
|
-
|
|
10
|
-
export interface GamificationSettingsItemProps {
|
|
11
|
-
config: GamificationItemConfig;
|
|
12
|
-
gamificationConfig?: GamificationSettingsConfig;
|
|
13
|
-
t?: (key: string) => string;
|
|
14
|
-
noBackground?: boolean;
|
|
15
|
-
hideMargin?: boolean;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const GamificationSettingsItemComponent: React.FC<GamificationSettingsItemProps> = ({
|
|
19
|
-
config,
|
|
20
|
-
gamificationConfig,
|
|
21
|
-
noBackground,
|
|
22
|
-
hideMargin,
|
|
23
|
-
}) => {
|
|
24
|
-
const navigation = useSettingsNavigation();
|
|
25
|
-
const { level } = useGamification(gamificationConfig);
|
|
26
|
-
|
|
27
|
-
const handlePress = React.useCallback(() => {
|
|
28
|
-
const route = config.route || "Gamification";
|
|
29
|
-
navigation.navigate(route as 'Gamification');
|
|
30
|
-
}, [navigation, config.route]);
|
|
31
|
-
|
|
32
|
-
const icon = (config.icon || "trophy-outline") as IconName;
|
|
33
|
-
const title = config.title;
|
|
34
|
-
|
|
35
|
-
const description = config.description ||
|
|
36
|
-
`${level.currentLevel} • ${level.currentPoints}`;
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<SettingsItemCard
|
|
40
|
-
title={title}
|
|
41
|
-
description={description}
|
|
42
|
-
icon={icon}
|
|
43
|
-
onPress={handlePress}
|
|
44
|
-
sectionTitle={config.sectionTitle}
|
|
45
|
-
noBackground={noBackground}
|
|
46
|
-
hideMargin={hideMargin}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const GamificationSettingsItem = React.memo(
|
|
52
|
-
GamificationSettingsItemComponent,
|
|
53
|
-
compareGamificationProps
|
|
54
|
-
);
|
|
55
|
-
GamificationSettingsItem.displayName = "GamificationSettingsItem";
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { SettingsItemCard } from "../../components/SettingsItemCard";
|
|
3
|
-
import type { IconName } from "@umituz/react-native-design-system";
|
|
4
|
-
import type { SubscriptionConfig } from "../types/UserFeatureConfig";
|
|
5
|
-
import { compareConfigAndTranslate } from "../../../infrastructure/utils/memoComparisonUtils";
|
|
6
|
-
import { useSettingsNavigation } from "../../navigation/hooks/useSettingsNavigation";
|
|
7
|
-
|
|
8
|
-
export interface SubscriptionSettingsItemProps {
|
|
9
|
-
config: SubscriptionConfig;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const SubscriptionSettingsItemComponent: React.FC<SubscriptionSettingsItemProps> = ({ config }) => {
|
|
13
|
-
const navigation = useSettingsNavigation();
|
|
14
|
-
|
|
15
|
-
const handlePress = React.useCallback(() => {
|
|
16
|
-
if (config.route) {
|
|
17
|
-
navigation.navigate(config.route as any);
|
|
18
|
-
} else if (config.onPress) {
|
|
19
|
-
config.onPress();
|
|
20
|
-
}
|
|
21
|
-
}, [navigation, config.route, config.onPress]);
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<SettingsItemCard
|
|
25
|
-
title={config.title}
|
|
26
|
-
description={config.description}
|
|
27
|
-
icon={(config.icon || "star") as IconName}
|
|
28
|
-
onPress={handlePress}
|
|
29
|
-
sectionTitle={config.sectionTitle}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const SubscriptionSettingsItem = React.memo(
|
|
35
|
-
SubscriptionSettingsItemComponent,
|
|
36
|
-
compareConfigAndTranslate
|
|
37
|
-
);
|
|
38
|
-
SubscriptionSettingsItem.displayName = "SubscriptionSettingsItem";
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { IconName } from "@umituz/react-native-design-system";
|
|
3
|
-
import { SettingsItemCard } from "../../components/SettingsItemCard";
|
|
4
|
-
import type { VideoTutorialConfig } from "../types/UserFeatureConfig";
|
|
5
|
-
import { compareConfigAndTranslate } from "../../../infrastructure/utils/memoComparisonUtils";
|
|
6
|
-
import { useSettingsNavigation } from "../../navigation/hooks/useSettingsNavigation";
|
|
7
|
-
|
|
8
|
-
export interface VideoTutorialSettingsItemProps {
|
|
9
|
-
config: VideoTutorialConfig;
|
|
10
|
-
noBackground?: boolean;
|
|
11
|
-
hideMargin?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const VideoTutorialSettingsItemComponent: React.FC<VideoTutorialSettingsItemProps> = ({
|
|
15
|
-
config,
|
|
16
|
-
noBackground,
|
|
17
|
-
hideMargin,
|
|
18
|
-
}) => {
|
|
19
|
-
const navigation = useSettingsNavigation();
|
|
20
|
-
|
|
21
|
-
const handlePress = React.useCallback(() => {
|
|
22
|
-
if (config.onPress) {
|
|
23
|
-
config.onPress();
|
|
24
|
-
} else {
|
|
25
|
-
const route = config.route || "VideoTutorial";
|
|
26
|
-
navigation.navigate(route as 'VideoTutorial');
|
|
27
|
-
}
|
|
28
|
-
}, [navigation, config.onPress, config.route]);
|
|
29
|
-
|
|
30
|
-
const icon = (config.icon || "play-circle-outline") as IconName;
|
|
31
|
-
const title = config.title;
|
|
32
|
-
const description = config.description;
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<SettingsItemCard
|
|
36
|
-
title={title}
|
|
37
|
-
description={description}
|
|
38
|
-
icon={icon}
|
|
39
|
-
onPress={handlePress}
|
|
40
|
-
sectionTitle={config.sectionTitle}
|
|
41
|
-
noBackground={noBackground}
|
|
42
|
-
hideMargin={hideMargin}
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const VideoTutorialSettingsItem = React.memo(
|
|
48
|
-
VideoTutorialSettingsItemComponent,
|
|
49
|
-
compareConfigAndTranslate
|
|
50
|
-
);
|
|
51
|
-
VideoTutorialSettingsItem.displayName = "VideoTutorialSettingsItem";
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { SettingsItemCard } from "../../components/SettingsItemCard";
|
|
3
|
-
import type { IconName } from "@umituz/react-native-design-system";
|
|
4
|
-
import type { WalletConfig } from "../types/UserFeatureConfig";
|
|
5
|
-
import { compareConfigAndTranslate } from "../../../infrastructure/utils/memoComparisonUtils";
|
|
6
|
-
import { useSettingsNavigation } from "../../navigation/hooks/useSettingsNavigation";
|
|
7
|
-
|
|
8
|
-
export interface WalletSettingsItemProps {
|
|
9
|
-
config: WalletConfig;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const WalletSettingsItemComponent: React.FC<WalletSettingsItemProps> = ({ config }) => {
|
|
13
|
-
const navigation = useSettingsNavigation();
|
|
14
|
-
|
|
15
|
-
const handlePress = React.useCallback(() => {
|
|
16
|
-
if (config.route) {
|
|
17
|
-
navigation.navigate(config.route as any);
|
|
18
|
-
}
|
|
19
|
-
}, [navigation, config.route]);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<SettingsItemCard
|
|
23
|
-
title={config.title}
|
|
24
|
-
description={config.description}
|
|
25
|
-
icon={(config.icon || "wallet") as IconName}
|
|
26
|
-
onPress={handlePress}
|
|
27
|
-
sectionTitle={config.sectionTitle}
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const WalletSettingsItem = React.memo(
|
|
33
|
-
WalletSettingsItemComponent,
|
|
34
|
-
compareConfigAndTranslate
|
|
35
|
-
);
|
|
36
|
-
WalletSettingsItem.displayName = "WalletSettingsItem";
|