@umituz/react-native-settings 4.20.61 → 4.21.1
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 +8 -60
- package/src/domains/gamification/README.md +343 -0
- package/src/domains/gamification/components/AchievementCard.tsx +142 -0
- package/src/domains/gamification/components/AchievementItem.tsx +182 -0
- package/src/domains/gamification/components/AchievementToast.tsx +122 -0
- package/src/domains/gamification/components/GamificationScreen/AchievementsList.tsx +84 -0
- package/src/domains/gamification/components/GamificationScreen/Header.tsx +29 -0
- package/src/domains/gamification/components/GamificationScreen/StatsGrid.tsx +51 -0
- package/src/domains/gamification/components/GamificationScreen/index.tsx +111 -0
- package/src/domains/gamification/components/GamificationScreen/styles.ts +43 -0
- package/src/domains/gamification/components/GamificationScreen/types.ts +77 -0
- package/src/domains/gamification/components/GamificationScreenWrapper.tsx +91 -0
- package/src/domains/gamification/components/GamificationSettingsItem.tsx +33 -0
- package/src/domains/gamification/components/LevelProgress.tsx +129 -0
- package/src/domains/gamification/components/PointsBadge.tsx +60 -0
- package/src/domains/gamification/components/StatsCard.tsx +89 -0
- package/src/domains/gamification/components/StreakDisplay.tsx +119 -0
- package/src/domains/gamification/components/index.ts +13 -0
- package/src/domains/gamification/examples/gamification.config.example.ts +70 -0
- package/src/domains/gamification/examples/localization.example.json +71 -0
- package/src/domains/gamification/hooks/useGamification.ts +91 -0
- package/src/domains/gamification/index.ts +65 -0
- package/src/domains/gamification/store/gamificationStore.ts +162 -0
- package/src/domains/gamification/types/index.ts +103 -0
- package/src/domains/gamification/types/settings.ts +28 -0
- package/src/domains/gamification/utils/calculations.ts +85 -0
- package/src/index.ts +18 -8
- package/src/presentation/navigation/SettingsStackNavigator.tsx +12 -0
- package/src/presentation/navigation/types.ts +2 -0
- package/src/presentation/navigation/utils/navigationScreenOptions.ts +7 -0
- package/src/presentation/screens/types/UserFeatureConfig.ts +2 -0
- package/src/presentation/utils/configCreators.ts +147 -0
- package/src/presentation/utils/index.ts +5 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -51
- package/.github/ISSUE_TEMPLATE/documentation.md +0 -52
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -63
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -84
- package/AI_AGENT_GUIDELINES.md +0 -367
- package/ARCHITECTURE.md +0 -246
- package/CHANGELOG.md +0 -67
- package/CODE_OF_CONDUCT.md +0 -75
- package/CONTRIBUTING.md +0 -107
- package/DOCUMENTATION_MIGRATION.md +0 -319
- package/DOCUMENTATION_TEMPLATE.md +0 -155
- package/SECURITY.md +0 -98
- package/SETTINGS_SCREEN_GUIDE.md +0 -185
- package/TESTING.md +0 -358
- package/src/__tests__/integration.test.tsx +0 -371
- package/src/__tests__/performance.test.tsx +0 -369
- package/src/__tests__/setup.test.tsx +0 -20
- package/src/__tests__/setup.ts +0 -154
- package/src/domains/about/__tests__/integration.test.tsx +0 -328
- package/src/domains/about/__tests__/types.d.ts +0 -5
- package/src/domains/about/domain/entities/__tests__/AppInfo.test.ts +0 -93
- package/src/domains/about/infrastructure/repositories/__tests__/AboutRepository.test.ts +0 -153
- package/src/domains/about/presentation/components/__tests__/AboutContent.simple.test.tsx +0 -178
- package/src/domains/about/presentation/components/__tests__/AboutContent.test.tsx +0 -293
- package/src/domains/about/presentation/components/__tests__/AboutHeader.test.tsx +0 -201
- package/src/domains/about/presentation/components/__tests__/AboutSettingItem.test.tsx +0 -71
- package/src/domains/about/presentation/hooks/__tests__/useAboutInfo.simple.test.tsx +0 -229
- package/src/domains/about/presentation/hooks/__tests__/useAboutInfo.test.tsx +0 -240
- package/src/domains/about/presentation/screens/__tests__/AboutScreen.simple.test.tsx +0 -199
- package/src/domains/about/presentation/screens/__tests__/AboutScreen.test.tsx +0 -366
- package/src/domains/about/utils/__tests__/index.test.ts +0 -408
- package/src/domains/appearance/__tests__/components/AppearanceScreen.test.tsx +0 -195
- package/src/domains/appearance/__tests__/hooks/index.test.tsx +0 -232
- package/src/domains/appearance/__tests__/integration/index.test.tsx +0 -207
- package/src/domains/appearance/__tests__/services/appearanceService.test.ts +0 -299
- package/src/domains/appearance/__tests__/setup.ts +0 -88
- package/src/domains/appearance/__tests__/stores/appearanceStore.test.tsx +0 -175
- package/src/domains/cloud-sync/presentation/components/__tests__/CloudSyncSetting.test.tsx +0 -78
- package/src/domains/legal/__tests__/ContentValidationService.test.ts +0 -195
- package/src/domains/legal/__tests__/StyleCacheService.test.ts +0 -110
- package/src/domains/legal/__tests__/UrlHandlerService.test.ts +0 -71
- package/src/domains/legal/__tests__/setup.ts +0 -82
- package/src/presentation/components/__tests__/SettingsErrorBoundary.test.tsx +0 -186
- package/src/presentation/screens/__tests__/SettingsScreen.test.tsx +0 -322
- package/src/presentation/screens/hooks/__tests__/useFeatureDetection.test.tsx +0 -261
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings Config Creators
|
|
3
|
+
* Utility functions to create standard settings configurations
|
|
4
|
+
* Used across 100+ apps - keep generic and flexible
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
AppearanceConfig,
|
|
9
|
+
LanguageConfig,
|
|
10
|
+
NotificationsConfig,
|
|
11
|
+
AboutConfig,
|
|
12
|
+
LegalConfig,
|
|
13
|
+
FeedbackConfig,
|
|
14
|
+
UserProfileConfig,
|
|
15
|
+
RatingConfig,
|
|
16
|
+
FAQConfig,
|
|
17
|
+
SubscriptionConfig,
|
|
18
|
+
} from "../screens/types";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Translation function type
|
|
22
|
+
*/
|
|
23
|
+
export type TranslationFunction = (key: string) => string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Create appearance configuration
|
|
27
|
+
*/
|
|
28
|
+
export const createAppearanceConfig = (t: TranslationFunction): AppearanceConfig => ({
|
|
29
|
+
enabled: true,
|
|
30
|
+
title: t("settings.appearance.title"),
|
|
31
|
+
description: t("settings.appearance.description"),
|
|
32
|
+
icon: "color-palette-outline",
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create language configuration
|
|
37
|
+
*/
|
|
38
|
+
export const createLanguageConfig = (t: TranslationFunction): LanguageConfig => ({
|
|
39
|
+
enabled: true,
|
|
40
|
+
title: t("settings.language.title"),
|
|
41
|
+
description: t("settings.language.description"),
|
|
42
|
+
icon: "globe-outline",
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Create notifications configuration
|
|
47
|
+
*/
|
|
48
|
+
export const createNotificationsConfig = (t: TranslationFunction): NotificationsConfig => ({
|
|
49
|
+
enabled: true,
|
|
50
|
+
showToggle: false,
|
|
51
|
+
route: "Notifications",
|
|
52
|
+
title: t("settings.notifications.title"),
|
|
53
|
+
description: t("settings.notifications.description"),
|
|
54
|
+
icon: "notifications-outline",
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Create about configuration
|
|
59
|
+
*/
|
|
60
|
+
export const createAboutConfig = (t: TranslationFunction): AboutConfig => ({
|
|
61
|
+
enabled: true,
|
|
62
|
+
title: t("settings.about.title"),
|
|
63
|
+
description: t("settings.about.description"),
|
|
64
|
+
icon: "information-circle-outline",
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Create legal configuration
|
|
69
|
+
*/
|
|
70
|
+
export const createLegalConfig = (t: TranslationFunction): LegalConfig => ({
|
|
71
|
+
enabled: true,
|
|
72
|
+
title: t("settings.legal.title"),
|
|
73
|
+
description: t("settings.legal.description"),
|
|
74
|
+
icon: "document-text-outline",
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Feedback form data interface
|
|
79
|
+
*/
|
|
80
|
+
export interface FeedbackFormData {
|
|
81
|
+
type: string;
|
|
82
|
+
rating: number;
|
|
83
|
+
description: string;
|
|
84
|
+
title: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Create feedback configuration
|
|
89
|
+
*/
|
|
90
|
+
export const createFeedbackConfig = (
|
|
91
|
+
t: TranslationFunction,
|
|
92
|
+
onSubmit: (data: FeedbackFormData) => Promise<void>,
|
|
93
|
+
): FeedbackConfig => ({
|
|
94
|
+
enabled: true,
|
|
95
|
+
title: t("settings.feedback.title"),
|
|
96
|
+
description: t("settings.feedback.description"),
|
|
97
|
+
icon: "chatbubble-outline",
|
|
98
|
+
sectionTitle: t("settings.sections.support"),
|
|
99
|
+
onSubmit,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Create rating configuration
|
|
104
|
+
*/
|
|
105
|
+
export const createRatingConfig = (
|
|
106
|
+
t: TranslationFunction,
|
|
107
|
+
onRate: () => void,
|
|
108
|
+
storeUrl?: string,
|
|
109
|
+
): RatingConfig => ({
|
|
110
|
+
enabled: true,
|
|
111
|
+
onRate,
|
|
112
|
+
storeUrl,
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Create FAQ configuration
|
|
117
|
+
*/
|
|
118
|
+
export const createFAQConfig = (
|
|
119
|
+
t: TranslationFunction,
|
|
120
|
+
onPress: () => void,
|
|
121
|
+
): FAQConfig => ({
|
|
122
|
+
enabled: true,
|
|
123
|
+
title: t("settings.faqs.title"),
|
|
124
|
+
description: t("settings.faqs.description"),
|
|
125
|
+
icon: "help-circle-outline",
|
|
126
|
+
sectionTitle: t("settings.sections.support").toUpperCase(),
|
|
127
|
+
onPress,
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Create subscription configuration
|
|
132
|
+
*/
|
|
133
|
+
export const createSubscriptionConfig = (
|
|
134
|
+
t: TranslationFunction,
|
|
135
|
+
isPremium: boolean,
|
|
136
|
+
onPress: () => void,
|
|
137
|
+
): SubscriptionConfig => ({
|
|
138
|
+
enabled: true,
|
|
139
|
+
title: t("settings.subscription.title"),
|
|
140
|
+
description: isPremium
|
|
141
|
+
? t("subscription.premiumDetails.statusActive")
|
|
142
|
+
: t("settings.subscription.description"),
|
|
143
|
+
icon: "diamond",
|
|
144
|
+
sectionTitle: t("settings.sections.subscription").toUpperCase(),
|
|
145
|
+
onPress,
|
|
146
|
+
isPremium,
|
|
147
|
+
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug report
|
|
3
|
-
about: Create a report to help us improve
|
|
4
|
-
title: '[BUG] '
|
|
5
|
-
labels: bug
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Bug Description
|
|
10
|
-
|
|
11
|
-
A clear and concise description of what the bug is.
|
|
12
|
-
|
|
13
|
-
## Reproduction Steps
|
|
14
|
-
|
|
15
|
-
1. Go to '...'
|
|
16
|
-
2. Click on '....'
|
|
17
|
-
3. Scroll down to '....'
|
|
18
|
-
4. See error
|
|
19
|
-
|
|
20
|
-
## Expected Behavior
|
|
21
|
-
|
|
22
|
-
A clear and concise description of what you expected to happen.
|
|
23
|
-
|
|
24
|
-
## Actual Behavior
|
|
25
|
-
|
|
26
|
-
A clear and concise description of what actually happened.
|
|
27
|
-
|
|
28
|
-
## Screenshots
|
|
29
|
-
|
|
30
|
-
If applicable, add screenshots to help explain your problem.
|
|
31
|
-
|
|
32
|
-
## Environment
|
|
33
|
-
|
|
34
|
-
| Software | Version |
|
|
35
|
-
|----------|---------|
|
|
36
|
-
| React Native | |
|
|
37
|
-
| iOS | |
|
|
38
|
-
| Android | |
|
|
39
|
-
| @umituz/react-native-settings | |
|
|
40
|
-
| Node | |
|
|
41
|
-
| npm/yarn | |
|
|
42
|
-
|
|
43
|
-
## Additional Context
|
|
44
|
-
|
|
45
|
-
Add any other context about the problem here.
|
|
46
|
-
|
|
47
|
-
## Console Logs
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
Paste your console logs here
|
|
51
|
-
```
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Documentation
|
|
3
|
-
about: Report documentation issues or suggest improvements
|
|
4
|
-
title: '[DOCS] '
|
|
5
|
-
labels: documentation
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Documentation Issue
|
|
10
|
-
|
|
11
|
-
Please describe the documentation issue:
|
|
12
|
-
|
|
13
|
-
- [ ] Inaccurate information
|
|
14
|
-
- [ ] Missing information
|
|
15
|
-
- [ ] Unclear or confusing
|
|
16
|
-
- [ ] Outdated content
|
|
17
|
-
- [ ] Typo or grammatical error
|
|
18
|
-
- [ ] Suggestion for improvement
|
|
19
|
-
|
|
20
|
-
## Affected Documentation
|
|
21
|
-
|
|
22
|
-
Which documentation file(s) are affected?
|
|
23
|
-
- [ ] README.md
|
|
24
|
-
- [ ] ARCHITECTURE.md
|
|
25
|
-
- [ ] TESTING.md
|
|
26
|
-
- [ ] AI_AGENT_GUIDELINES.md
|
|
27
|
-
- [ ] SETTINGS_SCREEN_GUIDE.md
|
|
28
|
-
- [ ] Specific component README
|
|
29
|
-
- [ ] Other (please specify)
|
|
30
|
-
|
|
31
|
-
## Current Documentation
|
|
32
|
-
|
|
33
|
-
Paste or describe the current documentation content that needs improvement:
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
Paste current documentation here
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Suggested Change
|
|
40
|
-
|
|
41
|
-
Please describe what should be changed or added:
|
|
42
|
-
|
|
43
|
-
## Additional Context
|
|
44
|
-
|
|
45
|
-
Add any other context, screenshots, or examples about the documentation issue.
|
|
46
|
-
|
|
47
|
-
## AI Agent Guidelines
|
|
48
|
-
|
|
49
|
-
If this is about AI agent guidelines, please specify:
|
|
50
|
-
- Which file needs updating
|
|
51
|
-
- What guidelines are missing or unclear
|
|
52
|
-
- How the guidelines could be improved
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Feature request
|
|
3
|
-
about: Suggest an idea for this project
|
|
4
|
-
title: '[FEATURE] '
|
|
5
|
-
labels: enhancement
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Feature Description
|
|
10
|
-
|
|
11
|
-
A clear and concise description of the feature you'd like to see added to this package.
|
|
12
|
-
|
|
13
|
-
## Problem Statement
|
|
14
|
-
|
|
15
|
-
What problem does this feature solve? What pain point does it address?
|
|
16
|
-
|
|
17
|
-
## Proposed Solution
|
|
18
|
-
|
|
19
|
-
Describe your vision for how this feature should work. Include:
|
|
20
|
-
|
|
21
|
-
- User interface changes (if any)
|
|
22
|
-
- API changes (if any)
|
|
23
|
-
- Configuration options
|
|
24
|
-
- Default behavior
|
|
25
|
-
|
|
26
|
-
## Alternatives Considered
|
|
27
|
-
|
|
28
|
-
Describe alternative solutions or features you've considered.
|
|
29
|
-
|
|
30
|
-
## Additional Context
|
|
31
|
-
|
|
32
|
-
Add any other context, mockups, or screenshots about the feature request here.
|
|
33
|
-
|
|
34
|
-
## Use Cases
|
|
35
|
-
|
|
36
|
-
Describe specific use cases where this feature would be beneficial:
|
|
37
|
-
|
|
38
|
-
1. First use case
|
|
39
|
-
2. Second use case
|
|
40
|
-
3. More use cases...
|
|
41
|
-
|
|
42
|
-
## Priority
|
|
43
|
-
|
|
44
|
-
How important is this feature to you?
|
|
45
|
-
- [ ] Critical
|
|
46
|
-
- [ ] High
|
|
47
|
-
- [ ] Medium
|
|
48
|
-
- [ ] Low
|
|
49
|
-
- [ ] Nice to have
|
|
50
|
-
|
|
51
|
-
## Implementation
|
|
52
|
-
|
|
53
|
-
If you have ideas on how to implement this feature, please describe:
|
|
54
|
-
|
|
55
|
-
- Which files would need to be modified
|
|
56
|
-
- New components/hooks needed
|
|
57
|
-
- Breaking changes
|
|
58
|
-
- Migration path from current API
|
|
59
|
-
|
|
60
|
-
Would you be willing to contribute this feature?
|
|
61
|
-
- [ ] Yes, I can submit a PR
|
|
62
|
-
- [ ] Yes, with guidance
|
|
63
|
-
- [ ] No, I don't have time
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
## Description
|
|
2
|
-
|
|
3
|
-
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
|
|
4
|
-
|
|
5
|
-
Fixes # (issue)
|
|
6
|
-
|
|
7
|
-
## Type of Change
|
|
8
|
-
|
|
9
|
-
Please delete options that are not relevant.
|
|
10
|
-
|
|
11
|
-
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
12
|
-
- [ ] New feature (non-breaking change which adds functionality)
|
|
13
|
-
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
14
|
-
- [ ] Documentation update
|
|
15
|
-
- [ ] Refactoring (no functional changes)
|
|
16
|
-
- [ ] Other (please describe)
|
|
17
|
-
|
|
18
|
-
## Testing
|
|
19
|
-
|
|
20
|
-
Describe the tests you ran and how to reproduce them:
|
|
21
|
-
|
|
22
|
-
- [ ] Unit tests pass locally
|
|
23
|
-
- [ ] Integration tests pass locally
|
|
24
|
-
- [ ] E2E tests pass locally
|
|
25
|
-
- [ ] Added new tests
|
|
26
|
-
- [ ] No tests needed for this change
|
|
27
|
-
|
|
28
|
-
## Test Coverage
|
|
29
|
-
|
|
30
|
-
Please confirm that your changes maintain or improve test coverage:
|
|
31
|
-
- [ ] Code coverage remains above 80%
|
|
32
|
-
- [ ] Added tests for new functionality
|
|
33
|
-
- [ ] Updated tests for refactored code
|
|
34
|
-
|
|
35
|
-
## Documentation
|
|
36
|
-
|
|
37
|
-
If your changes affect user-facing documentation:
|
|
38
|
-
- [ ] Updated README.md
|
|
39
|
-
- [ ] Updated relevant component README
|
|
40
|
-
- [ ] Added/updated JSDoc comments
|
|
41
|
-
- [ ] Updated AI_AGENT_GUIDELINES.md if needed
|
|
42
|
-
- [ ] No documentation updates needed
|
|
43
|
-
|
|
44
|
-
## Checklist
|
|
45
|
-
|
|
46
|
-
- [ ] My code follows the style guidelines of this project
|
|
47
|
-
- [ ] I have performed a self-review of my own code
|
|
48
|
-
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
49
|
-
- [ ] I have made corresponding changes to the documentation
|
|
50
|
-
- [ ] My changes generate no new warnings
|
|
51
|
-
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
52
|
-
- [ ] New and existing unit tests pass locally with my changes
|
|
53
|
-
- [ ] I have run `npm run typecheck` and there are no type errors
|
|
54
|
-
- [ ] I have run `npm run lint` and there are no linting errors
|
|
55
|
-
|
|
56
|
-
## Screenshots (if applicable)
|
|
57
|
-
|
|
58
|
-
Before:
|
|
59
|
-

|
|
60
|
-
|
|
61
|
-
After:
|
|
62
|
-

|
|
63
|
-
|
|
64
|
-
## Breaking Changes
|
|
65
|
-
|
|
66
|
-
If this PR introduces breaking changes, please describe them:
|
|
67
|
-
|
|
68
|
-
## Additional Information
|
|
69
|
-
|
|
70
|
-
Any additional information, configuration, or data that is important to this PR:
|
|
71
|
-
|
|
72
|
-
## Migration Guide
|
|
73
|
-
|
|
74
|
-
If this is a breaking change, please provide a migration guide:
|
|
75
|
-
|
|
76
|
-
### Old Code
|
|
77
|
-
\`\`\`typescript
|
|
78
|
-
// Old way
|
|
79
|
-
\`\`\`
|
|
80
|
-
|
|
81
|
-
### New Code
|
|
82
|
-
\`\`\`typescript
|
|
83
|
-
// New way
|
|
84
|
-
\`\`\`
|