@umituz/react-native-settings 4.21.19 → 4.21.21
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/components/AboutContent.tsx +3 -4
- package/src/domains/about/presentation/components/AboutHeader.tsx +7 -14
- package/src/domains/about/presentation/components/AboutSection.tsx +2 -2
- package/src/domains/about/presentation/components/AboutSettingItem.tsx +16 -16
- package/src/domains/appearance/presentation/components/AppearanceSection.tsx +2 -2
- package/src/domains/appearance/presentation/screens/AppearanceScreen.tsx +3 -4
- package/src/domains/faqs/presentation/components/FAQEmptyState.tsx +2 -2
- package/src/domains/gamification/components/AchievementCard.tsx +26 -19
- package/src/domains/gamification/components/AchievementItem.tsx +27 -25
- package/src/domains/gamification/components/AchievementToast.tsx +16 -12
- package/src/domains/gamification/components/GamificationScreen/AchievementsList.tsx +6 -5
- package/src/domains/gamification/components/GamificationScreen/Header.tsx +4 -3
- package/src/domains/gamification/components/GamificationScreen/StatsGrid.tsx +4 -3
- package/src/domains/gamification/components/GamificationScreen/index.tsx +38 -28
- package/src/domains/gamification/components/LevelProgress.tsx +25 -18
- package/src/domains/gamification/components/PointsBadge.tsx +13 -9
- package/src/domains/gamification/components/StatsCard.tsx +20 -14
- package/src/domains/gamification/components/StreakDisplay.tsx +28 -22
- package/src/domains/legal/presentation/components/LegalSection.tsx +2 -2
- package/src/domains/notifications/presentation/components/NotificationsSection.tsx +2 -4
- package/src/domains/notifications/presentation/screens/NotificationSettingsScreen.tsx +3 -4
- package/src/domains/rating/presentation/components/StarRating.tsx +2 -2
- package/src/domains/video-tutorials/presentation/components/VideoTutorialCard.tsx +35 -127
- package/src/domains/video-tutorials/presentation/screens/VideoTutorialsScreen.tsx +88 -153
- package/src/presentation/components/SettingsItemCard.tsx +3 -22
- package/src/presentation/navigation/SettingsStackNavigator.tsx +112 -100
- package/src/presentation/screens/SettingsScreen.tsx +2 -2
- package/src/presentation/screens/components/GamificationSettingsItem.tsx +3 -3
- package/src/presentation/screens/components/SettingsHeader.tsx +2 -3
- package/src/presentation/screens/components/SubscriptionSettingsItem.tsx +2 -2
- package/src/presentation/screens/components/WalletSettingsItem.tsx +2 -2
- package/src/presentation/screens/components/sections/FeatureSettingsSection.tsx +2 -2
- package/src/presentation/screens/components/sections/ProfileSectionLoader.tsx +2 -2
- package/src/presentation/screens/components/sections/SupportSettingsSection.tsx +2 -2
- package/src/presentation/screens/types/SettingsConfig.ts +2 -2
- package/src/presentation/screens/types/UserFeatureConfig.ts +2 -2
- package/src/presentation/screens/types/index.ts +2 -0
- package/src/presentation/screens/utils/normalizeConfig.ts +2 -2
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.21",
|
|
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",
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
* Displays the list of about items organized in sections
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { View,
|
|
6
|
+
import { View, StyleSheet } from 'react-native';
|
|
7
7
|
import { AboutSettingItem } from './AboutSettingItem';
|
|
8
8
|
import { AppInfo } from '../../domain/entities/AppInfo';
|
|
9
9
|
import { AboutConfig } from '../../domain/entities/AppInfo';
|
|
10
|
-
|
|
11
|
-
import { useAppDesignTokens } from '@umituz/react-native-design-system';
|
|
10
|
+
import { useAppDesignTokens, AtomicText } from '@umituz/react-native-design-system';
|
|
12
11
|
|
|
13
12
|
export interface AboutContentProps {
|
|
14
13
|
/** App information to display */
|
|
@@ -23,7 +22,7 @@ const AboutSectionHeader: React.FC<{ title: string }> = ({ title }) => {
|
|
|
23
22
|
const colors = tokens.colors;
|
|
24
23
|
|
|
25
24
|
return (
|
|
26
|
-
<
|
|
25
|
+
<AtomicText style={[styles.sectionHeader, { color: colors.textSecondary }]}>{title}</AtomicText>
|
|
27
26
|
);
|
|
28
27
|
};
|
|
29
28
|
|
|
@@ -3,13 +3,8 @@
|
|
|
3
3
|
* Displays app name, version, and description
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
Text,
|
|
9
|
-
StyleSheet,
|
|
10
|
-
ViewStyle,
|
|
11
|
-
TextStyle,
|
|
12
|
-
} from 'react-native';
|
|
6
|
+
import { View, StyleSheet, ViewStyle, TextStyle } from 'react-native';
|
|
7
|
+
import { useAppDesignTokens, AtomicText } from '@umituz/react-native-design-system';
|
|
13
8
|
import { AppInfo } from '../../domain/entities/AppInfo';
|
|
14
9
|
|
|
15
10
|
export interface AboutHeaderProps {
|
|
@@ -26,8 +21,6 @@ export interface AboutHeaderProps {
|
|
|
26
21
|
testID?: string;
|
|
27
22
|
}
|
|
28
23
|
|
|
29
|
-
import { useAppDesignTokens } from '@umituz/react-native-design-system';
|
|
30
|
-
|
|
31
24
|
export const AboutHeader: React.FC<AboutHeaderProps> = ({
|
|
32
25
|
appInfo,
|
|
33
26
|
containerStyle,
|
|
@@ -43,14 +36,14 @@ export const AboutHeader: React.FC<AboutHeaderProps> = ({
|
|
|
43
36
|
|
|
44
37
|
return (
|
|
45
38
|
<View style={[styles.header, { borderBottomColor: colors.border }, containerStyle]} testID={testID}>
|
|
46
|
-
<
|
|
47
|
-
<
|
|
39
|
+
<AtomicText style={[styles.appName, { color: colors.textPrimary }, titleStyle]}>{appInfo.name}</AtomicText>
|
|
40
|
+
<AtomicText style={[styles.version, { color: colors.textSecondary }, versionStyle]}>
|
|
48
41
|
{versionPrefix} {appInfo.version}
|
|
49
|
-
</
|
|
42
|
+
</AtomicText>
|
|
50
43
|
{appInfo.description && (
|
|
51
|
-
<
|
|
44
|
+
<AtomicText style={[styles.description, { color: colors.textSecondary }, descriptionStyle]}>
|
|
52
45
|
{appInfo.description}
|
|
53
|
-
</
|
|
46
|
+
</AtomicText>
|
|
54
47
|
)}
|
|
55
48
|
</View>
|
|
56
49
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { useAppNavigation } from '@umituz/react-native-design-system';
|
|
4
4
|
import { AboutConfig } from '../../domain/entities/AppInfo';
|
|
5
5
|
import { SettingsItemCard } from '../../../../presentation/components/SettingsItemCard';
|
|
6
6
|
|
|
@@ -21,7 +21,7 @@ export const AboutSection: React.FC<AboutSectionProps> = ({
|
|
|
21
21
|
description: propsDescription,
|
|
22
22
|
sectionTitle: propsSectionTitle,
|
|
23
23
|
}) => {
|
|
24
|
-
const navigation =
|
|
24
|
+
const navigation = useAppNavigation();
|
|
25
25
|
|
|
26
26
|
const route = config?.route || config?.defaultRoute || 'About';
|
|
27
27
|
const title = propsTitle || config?.title;
|
|
@@ -8,12 +8,11 @@ import React, { memo, useCallback } from 'react';
|
|
|
8
8
|
import {
|
|
9
9
|
TouchableOpacity,
|
|
10
10
|
View,
|
|
11
|
-
Text,
|
|
12
11
|
StyleSheet,
|
|
13
12
|
ViewStyle,
|
|
14
13
|
TextStyle,
|
|
15
14
|
} from 'react-native';
|
|
16
|
-
import { useAppDesignTokens } from '@umituz/react-native-design-system';
|
|
15
|
+
import { useAppDesignTokens, AtomicText, AtomicIcon } from '@umituz/react-native-design-system';
|
|
17
16
|
|
|
18
17
|
export interface AboutSettingItemProps {
|
|
19
18
|
/** Icon component (any React component) */
|
|
@@ -86,11 +85,6 @@ export const AboutSettingItem: React.FC<AboutSettingItemProps> = memo(({
|
|
|
86
85
|
iconContainerStyle,
|
|
87
86
|
];
|
|
88
87
|
|
|
89
|
-
const chevronStyles = [
|
|
90
|
-
styles.chevron,
|
|
91
|
-
{ color: chevronColor || colors.textSecondary },
|
|
92
|
-
];
|
|
93
|
-
|
|
94
88
|
return (
|
|
95
89
|
<Container
|
|
96
90
|
style={containerStyles}
|
|
@@ -101,23 +95,30 @@ export const AboutSettingItem: React.FC<AboutSettingItemProps> = memo(({
|
|
|
101
95
|
{icon && <View style={iconContainerStyles}>{icon}</View>}
|
|
102
96
|
|
|
103
97
|
<View style={styles.content}>
|
|
104
|
-
<
|
|
98
|
+
<AtomicText style={[styles.title, { color: colors.textPrimary }, titleStyle]}>
|
|
105
99
|
{title}
|
|
106
|
-
</
|
|
100
|
+
</AtomicText>
|
|
107
101
|
{description && (
|
|
108
|
-
<
|
|
102
|
+
<AtomicText style={[styles.description, { color: colors.textSecondary }, descriptionStyle]}>
|
|
109
103
|
{description}
|
|
110
|
-
</
|
|
104
|
+
</AtomicText>
|
|
111
105
|
)}
|
|
112
106
|
</View>
|
|
113
107
|
|
|
114
108
|
{value && (
|
|
115
|
-
<
|
|
109
|
+
<AtomicText style={[styles.value, { color: colors.textSecondary }, valueStyle]}>
|
|
116
110
|
{value}
|
|
117
|
-
</
|
|
111
|
+
</AtomicText>
|
|
118
112
|
)}
|
|
119
113
|
|
|
120
|
-
{showChevron &&
|
|
114
|
+
{showChevron && (
|
|
115
|
+
<AtomicIcon
|
|
116
|
+
name="chevron-right"
|
|
117
|
+
size={20}
|
|
118
|
+
customColor={chevronColor || colors.textSecondary}
|
|
119
|
+
style={styles.chevron}
|
|
120
|
+
/>
|
|
121
|
+
)}
|
|
121
122
|
</Container>
|
|
122
123
|
);
|
|
123
124
|
});
|
|
@@ -156,7 +157,6 @@ const getStyles = (tokens: any) => StyleSheet.create({
|
|
|
156
157
|
maxWidth: '60%',
|
|
157
158
|
},
|
|
158
159
|
chevron: {
|
|
159
|
-
|
|
160
|
-
fontWeight: '300',
|
|
160
|
+
marginLeft: 4,
|
|
161
161
|
},
|
|
162
162
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { useAppNavigation } from '@umituz/react-native-design-system';
|
|
4
4
|
import { AppearanceSectionConfig } from '../../types';
|
|
5
5
|
import { SettingsItemCard } from '../../../../presentation/components/SettingsItemCard';
|
|
6
6
|
|
|
@@ -23,7 +23,7 @@ export const AppearanceSection: React.FC<AppearanceSectionProps> = ({
|
|
|
23
23
|
title: titleProp,
|
|
24
24
|
description: descriptionProp,
|
|
25
25
|
}) => {
|
|
26
|
-
const navigation =
|
|
26
|
+
const navigation = useAppNavigation();
|
|
27
27
|
|
|
28
28
|
const route = config?.route || config?.defaultRoute || 'Appearance';
|
|
29
29
|
const title = titleProp || config?.title;
|
|
@@ -6,12 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, { useMemo, useCallback } from "react";
|
|
9
|
-
// @ts-ignore - Optional peer dependency
|
|
10
|
-
import { useNavigation } from "@react-navigation/native";
|
|
11
9
|
import {
|
|
12
10
|
ScreenLayout,
|
|
13
11
|
useAppDesignTokens,
|
|
14
|
-
NavigationHeader
|
|
12
|
+
NavigationHeader,
|
|
13
|
+
useAppNavigation
|
|
15
14
|
} from "@umituz/react-native-design-system";
|
|
16
15
|
import { useLocalization } from "@umituz/react-native-localization";
|
|
17
16
|
import { useAppearance, useAppearanceActions } from "../../hooks";
|
|
@@ -39,7 +38,7 @@ export const AppearanceScreen: React.FC<AppearanceScreenProps> = ({
|
|
|
39
38
|
showColorsSection = true,
|
|
40
39
|
showPreviewSection = true,
|
|
41
40
|
}) => {
|
|
42
|
-
const navigation =
|
|
41
|
+
const navigation = useAppNavigation();
|
|
43
42
|
const tokens = useAppDesignTokens();
|
|
44
43
|
const { t } = useLocalization();
|
|
45
44
|
const { themeMode } = useAppearance();
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React, { useMemo } from 'react';
|
|
8
|
-
import { View,
|
|
8
|
+
import { View, StyleSheet, ViewStyle, TextStyle } from 'react-native';
|
|
9
9
|
import { useAppDesignTokens, AtomicText } from '@umituz/react-native-design-system';
|
|
10
10
|
|
|
11
11
|
export interface FAQEmptyStateStyles {
|
|
@@ -55,7 +55,7 @@ export const FAQEmptyState: React.FC<FAQEmptyStateProps> = ({
|
|
|
55
55
|
|
|
56
56
|
return (
|
|
57
57
|
<View style={[styles.container, customStyles?.container]}>
|
|
58
|
-
<
|
|
58
|
+
<AtomicText style={[styles.icon, customStyles?.icon]}>{icon}</AtomicText>
|
|
59
59
|
<AtomicText
|
|
60
60
|
type="headlineSmall"
|
|
61
61
|
color="textPrimary"
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
|
-
import { View,
|
|
7
|
+
import { View, StyleSheet, type ViewStyle, type TextStyle } from "react-native";
|
|
8
|
+
import { useAppDesignTokens, AtomicText, withAlpha } from "@umituz/react-native-design-system";
|
|
8
9
|
|
|
9
10
|
export interface AchievementCardProps {
|
|
10
11
|
title: string;
|
|
@@ -12,12 +13,10 @@ export interface AchievementCardProps {
|
|
|
12
13
|
icon: React.ReactNode;
|
|
13
14
|
isUnlocked: boolean;
|
|
14
15
|
progress: number;
|
|
15
|
-
// Customization
|
|
16
16
|
containerStyle?: ViewStyle;
|
|
17
17
|
titleStyle?: TextStyle;
|
|
18
18
|
descriptionStyle?: TextStyle;
|
|
19
19
|
progressBarStyle?: ViewStyle;
|
|
20
|
-
// Colors
|
|
21
20
|
unlockedColor?: string;
|
|
22
21
|
lockedColor?: string;
|
|
23
22
|
backgroundColor?: string;
|
|
@@ -35,42 +34,50 @@ export const AchievementCard: React.FC<AchievementCardProps> = ({
|
|
|
35
34
|
titleStyle,
|
|
36
35
|
descriptionStyle,
|
|
37
36
|
progressBarStyle,
|
|
38
|
-
unlockedColor
|
|
39
|
-
lockedColor
|
|
40
|
-
backgroundColor
|
|
41
|
-
textColor
|
|
42
|
-
subtextColor
|
|
37
|
+
unlockedColor,
|
|
38
|
+
lockedColor,
|
|
39
|
+
backgroundColor,
|
|
40
|
+
textColor,
|
|
41
|
+
subtextColor,
|
|
43
42
|
}) => {
|
|
44
|
-
const
|
|
43
|
+
const tokens = useAppDesignTokens();
|
|
44
|
+
|
|
45
|
+
const finalUnlockedColor = unlockedColor || tokens.colors.success;
|
|
46
|
+
const finalLockedColor = lockedColor || tokens.colors.textDisabled;
|
|
47
|
+
const finalBackgroundColor = backgroundColor || tokens.colors.surface;
|
|
48
|
+
const finalTextColor = textColor || tokens.colors.textPrimary;
|
|
49
|
+
const finalSubtextColor = subtextColor || tokens.colors.textSecondary;
|
|
50
|
+
|
|
51
|
+
const accentColor = isUnlocked ? finalUnlockedColor : finalLockedColor;
|
|
45
52
|
|
|
46
53
|
return (
|
|
47
54
|
<View
|
|
48
55
|
style={[
|
|
49
56
|
styles.container,
|
|
50
|
-
{ backgroundColor, borderColor:
|
|
57
|
+
{ backgroundColor: finalBackgroundColor, borderColor: withAlpha(accentColor, 0.4) },
|
|
51
58
|
containerStyle,
|
|
52
59
|
]}
|
|
53
60
|
>
|
|
54
|
-
<View style={[styles.iconContainer, { backgroundColor:
|
|
61
|
+
<View style={[styles.iconContainer, { backgroundColor: withAlpha(accentColor, 0.2) }]}>
|
|
55
62
|
{icon}
|
|
56
63
|
</View>
|
|
57
64
|
|
|
58
65
|
<View style={styles.content}>
|
|
59
|
-
<
|
|
66
|
+
<AtomicText
|
|
60
67
|
style={[
|
|
61
68
|
styles.title,
|
|
62
|
-
{ color: isUnlocked ?
|
|
69
|
+
{ color: isUnlocked ? finalTextColor : finalSubtextColor },
|
|
63
70
|
titleStyle,
|
|
64
71
|
]}
|
|
65
72
|
>
|
|
66
73
|
{title}
|
|
67
|
-
</
|
|
68
|
-
<
|
|
74
|
+
</AtomicText>
|
|
75
|
+
<AtomicText style={[styles.description, { color: finalSubtextColor }, descriptionStyle]}>
|
|
69
76
|
{description}
|
|
70
|
-
</
|
|
77
|
+
</AtomicText>
|
|
71
78
|
|
|
72
79
|
{!isUnlocked && (
|
|
73
|
-
<View style={[styles.progressBar, { backgroundColor:
|
|
80
|
+
<View style={[styles.progressBar, { backgroundColor: withAlpha(finalLockedColor, 0.4) }, progressBarStyle]}>
|
|
74
81
|
<View
|
|
75
82
|
style={[
|
|
76
83
|
styles.progressFill,
|
|
@@ -82,8 +89,8 @@ export const AchievementCard: React.FC<AchievementCardProps> = ({
|
|
|
82
89
|
</View>
|
|
83
90
|
|
|
84
91
|
{isUnlocked && (
|
|
85
|
-
<View style={[styles.checkmark, { backgroundColor:
|
|
86
|
-
<
|
|
92
|
+
<View style={[styles.checkmark, { backgroundColor: finalUnlockedColor }]}>
|
|
93
|
+
<AtomicText style={styles.checkmarkText}>✓</AtomicText>
|
|
87
94
|
</View>
|
|
88
95
|
)}
|
|
89
96
|
</View>
|
|
@@ -4,13 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
Text,
|
|
10
|
-
StyleSheet,
|
|
11
|
-
type ViewStyle,
|
|
12
|
-
type TextStyle,
|
|
13
|
-
} from "react-native";
|
|
7
|
+
import { View, StyleSheet, type ViewStyle, type TextStyle } from "react-native";
|
|
8
|
+
import { useAppDesignTokens, AtomicText, withAlpha } from "@umituz/react-native-design-system";
|
|
14
9
|
|
|
15
10
|
export interface AchievementItemProps {
|
|
16
11
|
title: string;
|
|
@@ -43,66 +38,73 @@ export const AchievementItem: React.FC<AchievementItemProps> = ({
|
|
|
43
38
|
containerStyle,
|
|
44
39
|
titleStyle,
|
|
45
40
|
descriptionStyle,
|
|
46
|
-
accentColor
|
|
47
|
-
backgroundColor
|
|
48
|
-
textColor
|
|
49
|
-
subtextColor
|
|
50
|
-
lockedOpacity
|
|
41
|
+
accentColor,
|
|
42
|
+
backgroundColor,
|
|
43
|
+
textColor,
|
|
44
|
+
subtextColor,
|
|
45
|
+
lockedOpacity,
|
|
51
46
|
}) => {
|
|
47
|
+
const tokens = useAppDesignTokens();
|
|
48
|
+
const finalAccentColor = accentColor || tokens.colors.primary;
|
|
49
|
+
const finalBackgroundColor = backgroundColor || tokens.colors.surface;
|
|
50
|
+
const finalTextColor = textColor || tokens.colors.textPrimary;
|
|
51
|
+
const finalSubtextColor = subtextColor || tokens.colors.textSecondary;
|
|
52
|
+
const finalLockedOpacity = lockedOpacity !== undefined ? lockedOpacity : 0.5;
|
|
53
|
+
|
|
52
54
|
const progressPercent = Math.min((progress / threshold) * 100, 100);
|
|
53
55
|
|
|
54
56
|
return (
|
|
55
57
|
<View
|
|
56
58
|
style={[
|
|
57
59
|
styles.container,
|
|
58
|
-
{ backgroundColor, opacity: isUnlocked ? 1 :
|
|
60
|
+
{ backgroundColor: finalBackgroundColor, opacity: isUnlocked ? 1 : finalLockedOpacity },
|
|
59
61
|
containerStyle,
|
|
60
62
|
]}
|
|
61
63
|
>
|
|
62
64
|
<View
|
|
63
|
-
style={[styles.iconContainer, { backgroundColor:
|
|
65
|
+
style={[styles.iconContainer, { backgroundColor: withAlpha(finalAccentColor, 0.2) }]}
|
|
64
66
|
>
|
|
65
67
|
{icon}
|
|
66
68
|
</View>
|
|
67
69
|
|
|
68
70
|
<View style={styles.content}>
|
|
69
71
|
<View style={styles.header}>
|
|
70
|
-
<
|
|
72
|
+
<AtomicText style={[styles.title, { color: finalTextColor }, titleStyle]}>
|
|
71
73
|
{title}
|
|
72
|
-
</
|
|
74
|
+
</AtomicText>
|
|
73
75
|
{isUnlocked && (
|
|
74
|
-
<View style={[styles.checkmark, { backgroundColor:
|
|
75
|
-
<
|
|
76
|
+
<View style={[styles.checkmark, { backgroundColor: finalAccentColor }]}>
|
|
77
|
+
<AtomicText style={styles.checkmarkText}>✓</AtomicText>
|
|
76
78
|
</View>
|
|
77
79
|
)}
|
|
78
80
|
</View>
|
|
79
81
|
|
|
80
|
-
<
|
|
81
|
-
style={[styles.description, { color:
|
|
82
|
+
<AtomicText
|
|
83
|
+
style={[styles.description, { color: finalSubtextColor }, descriptionStyle]}
|
|
82
84
|
numberOfLines={2}
|
|
83
85
|
>
|
|
84
86
|
{description}
|
|
85
|
-
</
|
|
87
|
+
</AtomicText>
|
|
86
88
|
|
|
87
89
|
{!isUnlocked && (
|
|
88
90
|
<View style={styles.progressContainer}>
|
|
89
91
|
<View
|
|
90
|
-
style={[styles.progressBar, { backgroundColor:
|
|
92
|
+
style={[styles.progressBar, { backgroundColor: withAlpha(finalAccentColor, 0.3) }]}
|
|
91
93
|
>
|
|
92
94
|
<View
|
|
93
95
|
style={[
|
|
94
96
|
styles.progressFill,
|
|
95
97
|
{
|
|
96
|
-
backgroundColor:
|
|
98
|
+
backgroundColor: finalAccentColor,
|
|
97
99
|
width: `${progressPercent}%`,
|
|
98
100
|
},
|
|
99
101
|
]}
|
|
100
102
|
/>
|
|
101
103
|
</View>
|
|
102
104
|
{progressLabel && (
|
|
103
|
-
<
|
|
105
|
+
<AtomicText style={[styles.progressText, { color: finalSubtextColor }]}>
|
|
104
106
|
{progressLabel}
|
|
105
|
-
</
|
|
107
|
+
</AtomicText>
|
|
106
108
|
)}
|
|
107
109
|
</View>
|
|
108
110
|
)}
|
|
@@ -4,20 +4,19 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React, { useEffect, useRef } from "react";
|
|
7
|
-
import { View,
|
|
7
|
+
import { View, StyleSheet, Animated, type ViewStyle, type TextStyle } from "react-native";
|
|
8
|
+
import { useAppDesignTokens, AtomicText, withAlpha } from "@umituz/react-native-design-system";
|
|
8
9
|
|
|
9
10
|
export interface AchievementToastProps {
|
|
10
11
|
visible: boolean;
|
|
11
12
|
title: string;
|
|
12
|
-
label: string;
|
|
13
|
+
label: string;
|
|
13
14
|
icon: React.ReactNode;
|
|
14
15
|
onDismiss: () => void;
|
|
15
16
|
duration?: number;
|
|
16
|
-
// Customization
|
|
17
17
|
containerStyle?: ViewStyle;
|
|
18
18
|
labelStyle?: TextStyle;
|
|
19
19
|
titleStyle?: TextStyle;
|
|
20
|
-
// Colors
|
|
21
20
|
backgroundColor?: string;
|
|
22
21
|
textColor?: string;
|
|
23
22
|
labelColor?: string;
|
|
@@ -33,12 +32,17 @@ export const AchievementToast: React.FC<AchievementToastProps> = ({
|
|
|
33
32
|
containerStyle,
|
|
34
33
|
labelStyle,
|
|
35
34
|
titleStyle,
|
|
36
|
-
backgroundColor
|
|
37
|
-
textColor
|
|
38
|
-
labelColor
|
|
35
|
+
backgroundColor,
|
|
36
|
+
textColor,
|
|
37
|
+
labelColor,
|
|
39
38
|
}) => {
|
|
39
|
+
const tokens = useAppDesignTokens();
|
|
40
40
|
const translateY = useRef(new Animated.Value(-100)).current;
|
|
41
41
|
|
|
42
|
+
const finalBackgroundColor = backgroundColor || tokens.colors.primary;
|
|
43
|
+
const finalTextColor = textColor || tokens.colors.onPrimary;
|
|
44
|
+
const finalLabelColor = labelColor || withAlpha(finalTextColor, 0.5);
|
|
45
|
+
|
|
42
46
|
useEffect(() => {
|
|
43
47
|
if (visible) {
|
|
44
48
|
Animated.sequence([
|
|
@@ -69,15 +73,15 @@ export const AchievementToast: React.FC<AchievementToastProps> = ({
|
|
|
69
73
|
containerStyle,
|
|
70
74
|
]}
|
|
71
75
|
>
|
|
72
|
-
<View style={[styles.toast, { backgroundColor }]}>
|
|
76
|
+
<View style={[styles.toast, { backgroundColor: finalBackgroundColor }]}>
|
|
73
77
|
<View style={styles.iconContainer}>{icon}</View>
|
|
74
78
|
<View style={styles.content}>
|
|
75
|
-
<
|
|
79
|
+
<AtomicText style={[styles.label, { color: finalLabelColor }, labelStyle]}>
|
|
76
80
|
{label}
|
|
77
|
-
</
|
|
78
|
-
<
|
|
81
|
+
</AtomicText>
|
|
82
|
+
<AtomicText style={[styles.title, { color: finalTextColor }, titleStyle]}>
|
|
79
83
|
{title}
|
|
80
|
-
</
|
|
84
|
+
</AtomicText>
|
|
81
85
|
</View>
|
|
82
86
|
</View>
|
|
83
87
|
</Animated.View>
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import React from "react";
|
|
6
|
-
import { View,
|
|
6
|
+
import { View, type TextStyle } from "react-native";
|
|
7
|
+
import { AtomicText } from "@umituz/react-native-design-system";
|
|
7
8
|
import { AchievementItem } from "../AchievementItem";
|
|
8
9
|
import { styles } from "./styles";
|
|
9
10
|
import type { AchievementItemProps } from "../AchievementItem";
|
|
@@ -43,14 +44,14 @@ export const AchievementsList: React.FC<AchievementsListProps> = ({
|
|
|
43
44
|
|
|
44
45
|
return (
|
|
45
46
|
<View style={styles.section}>
|
|
46
|
-
<
|
|
47
|
+
<AtomicText style={[styles.sectionTitle, { color: textColor }, sectionTitleStyle]}>
|
|
47
48
|
{achievementsTitle}
|
|
48
|
-
</
|
|
49
|
+
</AtomicText>
|
|
49
50
|
|
|
50
51
|
{achievements.length === 0 && emptyAchievementsText ? (
|
|
51
|
-
<
|
|
52
|
+
<AtomicText style={[styles.emptyText, { color: subtextColor }]}>
|
|
52
53
|
{emptyAchievementsText}
|
|
53
|
-
</
|
|
54
|
+
</AtomicText>
|
|
54
55
|
) : (
|
|
55
56
|
<>
|
|
56
57
|
{/* Unlocked achievements first */}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import React from "react";
|
|
6
|
-
import { View,
|
|
6
|
+
import { View, type ViewStyle, type TextStyle } from "react-native";
|
|
7
|
+
import { AtomicText } from "@umituz/react-native-design-system";
|
|
7
8
|
import { styles } from "./styles";
|
|
8
9
|
|
|
9
10
|
export interface HeaderProps {
|
|
@@ -21,9 +22,9 @@ export const Header: React.FC<HeaderProps> = ({
|
|
|
21
22
|
}) => {
|
|
22
23
|
return (
|
|
23
24
|
<View style={[styles.header, headerStyle]}>
|
|
24
|
-
<
|
|
25
|
+
<AtomicText style={[styles.title, { color: textColor }, titleStyle]}>
|
|
25
26
|
{title}
|
|
26
|
-
</
|
|
27
|
+
</AtomicText>
|
|
27
28
|
</View>
|
|
28
29
|
);
|
|
29
30
|
};
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import React from "react";
|
|
6
|
-
import { View,
|
|
6
|
+
import { View, type TextStyle } from "react-native";
|
|
7
|
+
import { AtomicText } from "@umituz/react-native-design-system";
|
|
7
8
|
import { StatsCard } from "../StatsCard";
|
|
8
9
|
import { styles } from "./styles";
|
|
9
10
|
import type { StatsCardProps } from "../StatsCard";
|
|
@@ -31,9 +32,9 @@ export const StatsGrid: React.FC<StatsGridProps> = ({
|
|
|
31
32
|
|
|
32
33
|
return (
|
|
33
34
|
<View style={styles.section}>
|
|
34
|
-
<
|
|
35
|
+
<AtomicText style={[styles.sectionTitle, { color: textColor }, sectionTitleStyle]}>
|
|
35
36
|
{statsTitle}
|
|
36
|
-
</
|
|
37
|
+
</AtomicText>
|
|
37
38
|
<View style={styles.statsGrid}>
|
|
38
39
|
{stats.map((stat, index) => (
|
|
39
40
|
<StatsCard
|