@umituz/react-native-settings 4.23.82 → 4.23.84

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.
Files changed (24) hide show
  1. package/package.json +1 -1
  2. package/src/domains/disclaimer/presentation/screens/DisclaimerScreen.tsx +15 -1
  3. package/src/domains/faqs/presentation/screens/FAQScreen.tsx +25 -23
  4. package/src/domains/feedback/presentation/components/FeedbackForm.styles.ts +51 -0
  5. package/src/domains/feedback/presentation/components/FeedbackForm.tsx +3 -49
  6. package/src/domains/feedback/presentation/components/FeedbackModal.tsx +16 -19
  7. package/src/domains/gamification/components/GamificationScreen/GamificationScreen.tsx +54 -57
  8. package/src/domains/legal/presentation/screens/LegalContentScreen.tsx +8 -8
  9. package/src/domains/legal/presentation/screens/LegalScreen.tsx +14 -3
  10. package/src/domains/notifications/index.ts +1 -1
  11. package/src/domains/notifications/presentation/screens/NotificationsScreen.tsx +53 -26
  12. package/src/domains/notifications/reminders/presentation/components/ReminderForm.constants.ts +35 -0
  13. package/src/domains/notifications/reminders/presentation/components/ReminderForm.styles.ts +22 -0
  14. package/src/domains/notifications/reminders/presentation/components/ReminderForm.tsx +13 -57
  15. package/src/domains/notifications/reminders/presentation/screens/ReminderListScreen.tsx +25 -10
  16. package/src/domains/video-tutorials/presentation/components/VideoTutorialCard.tsx +17 -14
  17. package/src/domains/video-tutorials/presentation/screens/VideoTutorialsScreen.tsx +58 -33
  18. package/src/presentation/components/SettingsFooter.tsx +3 -3
  19. package/src/presentation/navigation/SettingsStackNavigator.tsx +32 -174
  20. package/src/presentation/navigation/hooks/index.ts +1 -0
  21. package/src/presentation/navigation/hooks/useSettingsScreens.ts +163 -0
  22. package/src/presentation/screens/SettingsScreen.tsx +0 -1
  23. package/src/presentation/screens/components/SettingsHeader.tsx +2 -5
  24. package/src/utils/appUtils.ts +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-settings",
3
- "version": "4.23.82",
3
+ "version": "4.23.84",
4
4
  "description": "Complete settings hub for React Native apps - consolidated package with settings, localization, about, legal, appearance, feedback, FAQs, rating, and gamification",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -14,7 +14,13 @@
14
14
 
15
15
  import React from 'react';
16
16
  import { View, StyleSheet } from 'react-native';
17
- import { useAppDesignTokens, withAlpha, ScreenLayout } from '@umituz/react-native-design-system';
17
+ import {
18
+ useAppDesignTokens,
19
+ withAlpha,
20
+ ScreenLayout,
21
+ useAppNavigation,
22
+ NavigationHeader
23
+ } from '@umituz/react-native-design-system';
18
24
  import { AtomicText, AtomicIcon } from '@umituz/react-native-design-system';
19
25
  import type { IconName } from '@umituz/react-native-design-system';
20
26
  import { useLocalization } from '../../../localization';
@@ -46,12 +52,20 @@ export const DisclaimerScreen: React.FC<DisclaimerScreenProps> = ({
46
52
  const displayTitle = title || t(titleKey);
47
53
  const displayContent = content || t(contentKey);
48
54
 
55
+ const navigation = useAppNavigation();
56
+
49
57
  return (
50
58
  <ScreenLayout
51
59
  scrollable={true}
52
60
  edges={['bottom']}
53
61
  contentContainerStyle={styles.scrollContent}
54
62
  hideScrollIndicator={false}
63
+ header={
64
+ <NavigationHeader
65
+ title={displayTitle}
66
+ onBackPress={() => navigation.goBack()}
67
+ />
68
+ }
55
69
  >
56
70
  {/* Icon Header */}
57
71
  <View style={styles.iconHeader}>
@@ -6,7 +6,7 @@
6
6
 
7
7
  import React, { useMemo } from 'react';
8
8
  import { View, ScrollView, StyleSheet, ViewStyle, TextStyle, useWindowDimensions } from 'react-native';
9
- import { useAppDesignTokens, AtomicText, ScreenLayout, getContentMaxWidth } from '@umituz/react-native-design-system';
9
+ import { useAppDesignTokens, AtomicText, ScreenLayout, getContentMaxWidth, NavigationHeader, useAppNavigation } from '@umituz/react-native-design-system';
10
10
  import { FAQCategory } from '../../domain/entities/FAQEntity';
11
11
  import { useFAQSearch } from '../hooks/useFAQSearch';
12
12
  import { useFAQExpansion } from '../hooks/useFAQExpansion';
@@ -45,6 +45,7 @@ export const FAQScreen: React.FC<FAQScreenProps> = ({
45
45
  renderHeader,
46
46
  styles: customStyles,
47
47
  }) => {
48
+ const navigation = useAppNavigation();
48
49
  const tokens = useAppDesignTokens();
49
50
  const { width: windowWidth } = useWindowDimensions();
50
51
  const contentMaxWidth = useMemo(() => getContentMaxWidth(windowWidth), [windowWidth]);
@@ -67,6 +68,21 @@ export const FAQScreen: React.FC<FAQScreenProps> = ({
67
68
  [tokens]
68
69
  );
69
70
 
71
+ const handleBack = () => {
72
+ if (onBack) {
73
+ onBack();
74
+ } else {
75
+ navigation.goBack();
76
+ }
77
+ };
78
+
79
+ const header = renderHeader ? renderHeader({ onBack: handleBack }) : (
80
+ <NavigationHeader
81
+ title={headerTitle}
82
+ onBackPress={handleBack}
83
+ />
84
+ );
85
+
70
86
  const renderContent = () => {
71
87
  if (searchQuery && !hasResults) {
72
88
  return (
@@ -81,13 +97,6 @@ export const FAQScreen: React.FC<FAQScreenProps> = ({
81
97
  return (
82
98
  <View style={{ flex: 1 }}>
83
99
  <View style={[styles.header, customStyles?.header]}>
84
- <AtomicText
85
- type="headlineMedium"
86
- color="textPrimary"
87
- style={{ marginBottom: tokens.spacing.md, fontWeight: '700' }}
88
- >
89
- {headerTitle}
90
- </AtomicText>
91
100
  <FAQSearchBar
92
101
  value={searchQuery}
93
102
  onChangeText={setSearchQuery}
@@ -116,23 +125,16 @@ export const FAQScreen: React.FC<FAQScreenProps> = ({
116
125
  );
117
126
  };
118
127
 
119
- if (renderHeader && onBack) {
120
- return (
121
- <View style={{ flex: 1, backgroundColor: tokens.colors.backgroundPrimary }}>
122
- <View style={[styles.container, customStyles?.container]}>
123
- <View style={{ alignSelf: 'center', width: '100%', maxWidth: contentMaxWidth }}>
124
- {renderHeader({ onBack })}
125
- </View>
126
- {renderContent()}
127
- </View>
128
- </View>
129
- );
130
- }
131
-
132
128
  return (
133
- <ScreenLayout edges={['bottom']} scrollable={false}>
129
+ <ScreenLayout
130
+ edges={['bottom']}
131
+ scrollable={false}
132
+ header={header}
133
+ >
134
134
  <View style={[styles.container, customStyles?.container]}>
135
- {renderContent()}
135
+ <View style={{ alignSelf: 'center', width: '100%', maxWidth: contentMaxWidth, flex: 1 }}>
136
+ {renderContent()}
137
+ </View>
136
138
  </View>
137
139
  </ScreenLayout>
138
140
  );
@@ -0,0 +1,51 @@
1
+ import { StyleSheet } from "react-native";
2
+ import type { useAppDesignTokens } from "@umituz/react-native-design-system";
3
+
4
+ export const getFeedbackFormStyles = (tokens: ReturnType<typeof useAppDesignTokens>) =>
5
+ StyleSheet.create({
6
+ container: {
7
+ width: "100%",
8
+ },
9
+ typeContainer: {
10
+ marginBottom: 24,
11
+ },
12
+ typeScroll: {
13
+ gap: 8,
14
+ },
15
+ typeButton: {
16
+ flexDirection: "row",
17
+ alignItems: "center",
18
+ paddingHorizontal: 16,
19
+ paddingVertical: 8,
20
+ borderRadius: 20,
21
+ borderWidth: 1,
22
+ gap: 6,
23
+ },
24
+ ratingContainer: {
25
+ alignItems: "center",
26
+ marginBottom: 24,
27
+ },
28
+ stars: {
29
+ flexDirection: "row",
30
+ gap: 8,
31
+ },
32
+ starButton: {
33
+ padding: 4,
34
+ },
35
+ inputContainer: {
36
+ marginBottom: 24,
37
+ },
38
+ textArea: {
39
+ textAlignVertical: "top",
40
+ minHeight: 120,
41
+ borderWidth: 1,
42
+ borderRadius: 8,
43
+ padding: 12,
44
+ },
45
+ errorText: {
46
+ marginTop: 8,
47
+ },
48
+ submitButton: {
49
+ width: "100%",
50
+ },
51
+ });
@@ -8,6 +8,8 @@ import { View, StyleSheet, TouchableOpacity, ScrollView, TextInput } from "react
8
8
  import { useAppDesignTokens, AtomicText, AtomicButton, AtomicIcon } from "@umituz/react-native-design-system";
9
9
  import type { FeedbackType, FeedbackRating } from "../../domain/entities/FeedbackEntity";
10
10
 
11
+ import { getFeedbackFormStyles as getStyles } from "./FeedbackForm.styles";
12
+
11
13
  export interface FeedbackFormProps {
12
14
  onSubmit: (data: { type: FeedbackType; rating: FeedbackRating; description: string; title: string }) => Promise<void>;
13
15
  texts: {
@@ -151,6 +153,7 @@ export const FeedbackForm: React.FC<FeedbackFormProps> = ({
151
153
  color: tokens.colors.textPrimary,
152
154
  backgroundColor: tokens.colors.surface,
153
155
  borderColor: error ? tokens.colors.error : tokens.colors.border,
156
+ fontSize: tokens.typography.bodyMedium.fontSize,
154
157
  }
155
158
  ]}
156
159
  />
@@ -176,52 +179,3 @@ export const FeedbackForm: React.FC<FeedbackFormProps> = ({
176
179
  );
177
180
  };
178
181
 
179
- const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>) =>
180
- StyleSheet.create({
181
- container: {
182
- width: "100%",
183
- },
184
- typeContainer: {
185
- marginBottom: 24,
186
- },
187
- typeScroll: {
188
- gap: 8,
189
- },
190
- typeButton: {
191
- flexDirection: "row",
192
- alignItems: "center",
193
- paddingHorizontal: 16,
194
- paddingVertical: 8,
195
- borderRadius: 20,
196
- borderWidth: 1,
197
- gap: 6,
198
- },
199
- ratingContainer: {
200
- alignItems: "center",
201
- marginBottom: 24,
202
- },
203
- stars: {
204
- flexDirection: "row",
205
- gap: 8,
206
- },
207
- starButton: {
208
- padding: 4,
209
- },
210
- inputContainer: {
211
- marginBottom: 24,
212
- },
213
- textArea: {
214
- textAlignVertical: "top",
215
- minHeight: 120,
216
- borderWidth: 1,
217
- borderRadius: 8,
218
- padding: 12,
219
- fontSize: tokens.typography.bodyMedium.fontSize,
220
- },
221
- errorText: {
222
- marginTop: 8,
223
- },
224
- submitButton: {
225
- width: "100%",
226
- },
227
- });
@@ -34,34 +34,31 @@ export const FeedbackModal: React.FC<FeedbackModalProps> = ({
34
34
  const tokens = useAppDesignTokens();
35
35
  const styles = getStyles(tokens);
36
36
 
37
+ const header = (
38
+ <NavigationHeader
39
+ title={title || ""}
40
+ subtitle={subtitle}
41
+ rightElement={
42
+ <TouchableOpacity
43
+ onPress={onClose}
44
+ style={[styles.closeButton, { backgroundColor: tokens.colors.surfaceVariant }]}
45
+ >
46
+ <AtomicIcon name="close" size="sm" color="onSurface" />
47
+ </TouchableOpacity>
48
+ }
49
+ />
50
+ );
51
+
37
52
  return (
38
53
  <BaseModal visible={visible} onClose={onClose}>
39
54
  <ScreenLayout
55
+ header={header}
40
56
  scrollable={true}
41
57
  edges={[]}
42
58
  keyboardAvoiding={true}
43
59
  contentContainerStyle={styles.content}
44
60
  hideScrollIndicator={false}
45
61
  >
46
- <View style={[styles.header, { borderBottomColor: tokens.colors.border }]}>
47
- <View style={styles.headerText}>
48
- <AtomicText type="headlineSmall" color="textPrimary">
49
- {title}
50
- </AtomicText>
51
- {subtitle && (
52
- <AtomicText type="bodySmall" color="textSecondary" style={{ marginTop: 4 }}>
53
- {subtitle}
54
- </AtomicText>
55
- )}
56
- </View>
57
- <TouchableOpacity
58
- onPress={onClose}
59
- style={[styles.closeButton, { backgroundColor: tokens.colors.surfaceVariant }]}
60
- >
61
- <AtomicIcon name="close" size="sm" color="onSurface" />
62
- </TouchableOpacity>
63
- </View>
64
-
65
62
  <FeedbackForm
66
63
  onSubmit={onSubmit}
67
64
  initialType={initialType}
@@ -6,10 +6,9 @@
6
6
 
7
7
  import React from "react";
8
8
  import { View, ScrollView } from "react-native";
9
- import { useAppDesignTokens, AtomicText } from "@umituz/react-native-design-system";
9
+ import { useAppDesignTokens, AtomicText, ScreenLayout, NavigationHeader, useAppNavigation } from "@umituz/react-native-design-system";
10
10
  import { LevelProgress } from "../LevelProgress";
11
11
  import { StreakDisplay } from "../StreakDisplay";
12
- import { Header } from "./Header";
13
12
  import { StatsGrid } from "./StatsGrid";
14
13
  import { AchievementsList } from "./AchievementsList";
15
14
  import { styles } from "./styles";
@@ -39,6 +38,7 @@ export const GamificationScreenInner: React.FC<GamificationScreenProps> = ({
39
38
  subtextColor,
40
39
  headerComponent,
41
40
  }) => {
41
+ const navigation = useAppNavigation();
42
42
  const tokens = useAppDesignTokens();
43
43
 
44
44
  // Use tokens for fallbacks
@@ -48,75 +48,72 @@ export const GamificationScreenInner: React.FC<GamificationScreenProps> = ({
48
48
  const finalTextColor = textColor || tokens.colors.textPrimary;
49
49
  const finalSubtextColor = subtextColor || tokens.colors.textSecondary;
50
50
 
51
+ const header = (
52
+ <NavigationHeader
53
+ title={title}
54
+ onBackPress={() => navigation.goBack()}
55
+ />
56
+ );
57
+
51
58
  return (
52
- <View style={[styles.container, { backgroundColor: finalBackgroundColor }, containerStyle]}>
59
+ <ScreenLayout
60
+ header={header}
61
+ contentContainerStyle={styles.scrollContent}
62
+ hideScrollIndicator={false}
63
+ >
53
64
  {headerComponent}
54
65
 
55
- <ScrollView
56
- style={styles.scrollView}
57
- contentContainerStyle={styles.scrollContent}
58
- showsVerticalScrollIndicator={false}
59
- >
60
- {/* Header */}
61
- <Header
62
- title={title}
63
- headerStyle={headerStyle}
64
- titleStyle={titleStyle}
66
+ {/* Level Progress */}
67
+ <View style={styles.section}>
68
+ <LevelProgress
69
+ {...levelProps}
70
+ primaryColor={finalAccentColor}
71
+ backgroundColor={finalCardBackgroundColor}
65
72
  textColor={finalTextColor}
73
+ subtextColor={finalSubtextColor}
66
74
  />
75
+ </View>
67
76
 
68
- {/* Level Progress */}
77
+ {/* Streak (if provided) */}
78
+ {streakProps && (
69
79
  <View style={styles.section}>
70
- <LevelProgress
71
- {...levelProps}
80
+ <AtomicText
81
+ style={[styles.sectionTitle, { color: finalTextColor }, sectionTitleStyle]}
82
+ >
83
+ {streakTitle}
84
+ </AtomicText>
85
+ <StreakDisplay
86
+ {...streakProps}
72
87
  primaryColor={finalAccentColor}
73
88
  backgroundColor={finalCardBackgroundColor}
74
89
  textColor={finalTextColor}
75
90
  subtextColor={finalSubtextColor}
76
91
  />
77
92
  </View>
93
+ )}
78
94
 
79
- {/* Streak (if provided) */}
80
- {streakProps && (
81
- <View style={styles.section}>
82
- <AtomicText
83
- style={[styles.sectionTitle, { color: finalTextColor }, sectionTitleStyle]}
84
- >
85
- {streakTitle}
86
- </AtomicText>
87
- <StreakDisplay
88
- {...streakProps}
89
- primaryColor={finalAccentColor}
90
- backgroundColor={finalCardBackgroundColor}
91
- textColor={finalTextColor}
92
- subtextColor={finalSubtextColor}
93
- />
94
- </View>
95
- )}
96
-
97
- {/* Stats Grid */}
98
- <StatsGrid
99
- statsTitle={statsTitle}
100
- stats={stats}
101
- accentColor={finalAccentColor}
102
- cardBackgroundColor={finalCardBackgroundColor}
103
- textColor={finalTextColor}
104
- subtextColor={finalSubtextColor}
105
- sectionTitleStyle={sectionTitleStyle}
106
- />
95
+ {/* Stats Grid */}
96
+ <StatsGrid
97
+ statsTitle={statsTitle}
98
+ stats={stats}
99
+ accentColor={finalAccentColor}
100
+ cardBackgroundColor={finalCardBackgroundColor}
101
+ textColor={finalTextColor}
102
+ subtextColor={finalSubtextColor}
103
+ sectionTitleStyle={sectionTitleStyle}
104
+ />
107
105
 
108
- {/* Achievements */}
109
- <AchievementsList
110
- achievementsTitle={achievementsTitle}
111
- achievements={achievements}
112
- emptyAchievementsText={emptyAchievementsText}
113
- accentColor={finalAccentColor}
114
- cardBackgroundColor={finalCardBackgroundColor}
115
- textColor={finalTextColor}
116
- subtextColor={finalSubtextColor}
117
- sectionTitleStyle={sectionTitleStyle}
118
- />
119
- </ScrollView>
120
- </View>
106
+ {/* Achievements */}
107
+ <AchievementsList
108
+ achievementsTitle={achievementsTitle}
109
+ achievements={achievements}
110
+ emptyAchievementsText={emptyAchievementsText}
111
+ accentColor={finalAccentColor}
112
+ cardBackgroundColor={finalCardBackgroundColor}
113
+ textColor={finalTextColor}
114
+ subtextColor={finalSubtextColor}
115
+ sectionTitleStyle={sectionTitleStyle}
116
+ />
117
+ </ScreenLayout>
121
118
  );
122
119
  };
@@ -9,6 +9,7 @@ import { AtomicText, AtomicButton } from "@umituz/react-native-design-system";
9
9
  import { UrlHandlerService } from "../../domain/services/UrlHandlerService";
10
10
  import { ContentValidationService } from "../../domain/services/ContentValidationService";
11
11
  import { StyleCacheService } from "../../domain/services/StyleCacheService";
12
+ import { useAppNavigation, NavigationHeader } from "@umituz/react-native-design-system";
12
13
 
13
14
  export interface LegalContentScreenProps {
14
15
  content?: string;
@@ -34,6 +35,7 @@ export const LegalContentScreen: React.FC<LegalContentScreenProps> = React.memo(
34
35
  createStyles,
35
36
  }) => {
36
37
  const tokens = useAppDesignTokens();
38
+ const navigation = useAppNavigation();
37
39
 
38
40
  const styles = React.useMemo(() => {
39
41
  const cacheKey = StyleCacheService.createTokenCacheKey(tokens);
@@ -101,17 +103,15 @@ export const LegalContentScreen: React.FC<LegalContentScreenProps> = React.memo(
101
103
  testID={testID}
102
104
  scrollable={true}
103
105
  hideScrollIndicator={false}
106
+ header={
107
+ <NavigationHeader
108
+ title={title}
109
+ onBackPress={() => navigation.goBack()}
110
+ />
111
+ }
104
112
  contentContainerStyle={styles.scrollContent}
105
113
  >
106
114
  <View style={styles.content}>
107
- <AtomicText
108
- type="headlineLarge"
109
- color="primary"
110
- style={styles.title}
111
- >
112
- {title}
113
- </AtomicText>
114
-
115
115
  {contentSection}
116
116
  </View>
117
117
  </ScreenLayout>
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from "react";
9
- import { ScreenLayout } from "@umituz/react-native-design-system";
9
+ import { ScreenLayout, NavigationHeader, useAppNavigation } from "@umituz/react-native-design-system";
10
10
  import { LegalScreenHeader } from "../components/LegalScreenHeader";
11
11
  import { LegalDocumentsList } from "../components/LegalDocumentsList";
12
12
 
@@ -45,10 +45,21 @@ export const LegalScreen: React.FC<LegalScreenProps> = React.memo((props) => {
45
45
  testID = "legal-screen",
46
46
  } = props;
47
47
 
48
+ const navigation = useAppNavigation();
49
+
48
50
  return (
49
- <ScreenLayout testID={testID} hideScrollIndicator>
51
+ <ScreenLayout
52
+ testID={testID}
53
+ hideScrollIndicator
54
+ header={
55
+ <NavigationHeader
56
+ title={title || ""}
57
+ onBackPress={() => navigation.goBack()}
58
+ />
59
+ }
60
+ >
50
61
  <LegalScreenHeader title={title} description={description} />
51
-
62
+
52
63
  <LegalDocumentsList
53
64
  documentsHeader={documentsHeader}
54
65
  privacyTitle={privacyTitle}
@@ -110,7 +110,7 @@ export { ReminderItem } from './reminders/presentation/components/ReminderItem';
110
110
  export type { ReminderItemProps, ReminderItemTranslations } from './reminders/presentation/components/ReminderItem';
111
111
 
112
112
  export { ReminderForm } from './reminders/presentation/components/ReminderForm';
113
- export type { ReminderFormProps, ReminderFormTranslations } from './reminders/presentation/components/ReminderForm';
113
+ export type { ReminderFormProps, ReminderFormTranslations } from './reminders/presentation/components/ReminderForm.constants';
114
114
 
115
115
  export { FormButton } from './reminders/presentation/components/FormButton';
116
116
  export type { FormButtonProps } from './reminders/presentation/components/FormButton';
@@ -7,11 +7,21 @@
7
7
 
8
8
  import React, { useMemo } from 'react';
9
9
  import { View, StyleSheet } from 'react-native';
10
- import { AtomicIcon, AtomicCard, AtomicText, ScreenLayout, BASE_TOKENS, AtomicSpinner, type IconColor } from '@umituz/react-native-design-system';
10
+ import {
11
+ AtomicIcon,
12
+ AtomicCard,
13
+ AtomicText,
14
+ ScreenLayout,
15
+ BASE_TOKENS,
16
+ AtomicSpinner,
17
+ type IconColor,
18
+ NavigationHeader,
19
+ useAppNavigation,
20
+ useAppDesignTokens,
21
+ type DesignTokens
22
+ } from '@umituz/react-native-design-system';
11
23
  import { Switch } from 'react-native';
12
- import { useAppDesignTokens } from '@umituz/react-native-design-system';
13
24
  import { useNotificationSettings } from '../../infrastructure/hooks/useNotificationSettings';
14
- import type { DesignTokens } from '@umituz/react-native-design-system';
15
25
 
16
26
  export interface NotificationsScreenProps {
17
27
  translations: {
@@ -30,13 +40,21 @@ export const NotificationsScreen: React.FC<NotificationsScreenProps> = ({
30
40
  iconColor = 'primary',
31
41
  testID = 'notifications-screen',
32
42
  }) => {
43
+ const navigation = useAppNavigation();
33
44
  const tokens = useAppDesignTokens();
34
45
  const styles = useMemo(() => getStyles(tokens), [tokens]);
35
46
  const { notificationsEnabled, setNotificationsEnabled, isLoading } = useNotificationSettings();
36
47
 
48
+ const header = (
49
+ <NavigationHeader
50
+ title={translations.title}
51
+ onBackPress={() => navigation.goBack()}
52
+ />
53
+ );
54
+
37
55
  if (isLoading) {
38
56
  return (
39
- <ScreenLayout testID={testID}>
57
+ <ScreenLayout testID={testID} header={header}>
40
58
  <AtomicSpinner
41
59
  size="lg"
42
60
  color="primary"
@@ -48,34 +66,43 @@ export const NotificationsScreen: React.FC<NotificationsScreenProps> = ({
48
66
  }
49
67
 
50
68
  return (
51
- <ScreenLayout testID={testID} hideScrollIndicator>
52
- <AtomicCard style={styles.card}>
53
- <View style={styles.settingItem}>
54
- <View style={styles.iconContainer}>
55
- <AtomicIcon name={iconName} size="lg" color={iconColor as IconColor} />
69
+ <ScreenLayout
70
+ testID={testID}
71
+ hideScrollIndicator
72
+ header={header}
73
+ >
74
+ <View style={styles.content}>
75
+ <AtomicCard style={styles.card}>
76
+ <View style={styles.settingItem}>
77
+ <View style={styles.iconContainer}>
78
+ <AtomicIcon name={iconName} size="lg" color={iconColor as IconColor} />
79
+ </View>
80
+ <View style={styles.textContainer}>
81
+ <AtomicText type="bodyLarge" style={{ color: tokens.colors.textPrimary }}>
82
+ {translations.title}
83
+ </AtomicText>
84
+ <AtomicText type="bodySmall" style={{ color: tokens.colors.textSecondary, marginTop: BASE_TOKENS.spacing.xs }}>
85
+ {translations.description}
86
+ </AtomicText>
87
+ </View>
88
+ <Switch
89
+ value={notificationsEnabled}
90
+ onValueChange={setNotificationsEnabled}
91
+ trackColor={{ false: tokens.colors.surfaceSecondary, true: tokens.colors.primary }}
92
+ thumbColor={tokens.colors.surface}
93
+ testID="notifications-toggle"
94
+ />
56
95
  </View>
57
- <View style={styles.textContainer}>
58
- <AtomicText type="bodyLarge" style={{ color: tokens.colors.textPrimary }}>
59
- {translations.title}
60
- </AtomicText>
61
- <AtomicText type="bodySmall" style={{ color: tokens.colors.textSecondary, marginTop: BASE_TOKENS.spacing.xs }}>
62
- {translations.description}
63
- </AtomicText>
64
- </View>
65
- <Switch
66
- value={notificationsEnabled}
67
- onValueChange={setNotificationsEnabled}
68
- trackColor={{ false: tokens.colors.surfaceSecondary, true: tokens.colors.primary }}
69
- thumbColor={tokens.colors.surface}
70
- testID="notifications-toggle"
71
- />
72
- </View>
73
- </AtomicCard>
96
+ </AtomicCard>
97
+ </View>
74
98
  </ScreenLayout>
75
99
  );
76
100
  };
77
101
 
78
102
  const getStyles = (tokens: DesignTokens) => StyleSheet.create({
103
+ content: {
104
+ padding: BASE_TOKENS.spacing.md,
105
+ },
79
106
  loadingContainer: {
80
107
  flex: 1,
81
108
  justifyContent: 'center',
@@ -0,0 +1,35 @@
1
+ import type { Reminder, ReminderFrequency, CreateReminderInput, TimePreset } from '../../../infrastructure/services/types';
2
+
3
+ export const DEFAULT_HOUR = 9;
4
+ export const DEFAULT_MINUTE = 0;
5
+ export const DEFAULT_WEEKDAY = 2; // Tuesday
6
+ export const MAX_TITLE_LENGTH = 100;
7
+ export const MAX_BODY_LENGTH = 500;
8
+
9
+ export const VALID_HOUR_RANGE = { min: 0, max: 23 } as const;
10
+ export const VALID_MINUTE_RANGE = { min: 0, max: 59 } as const;
11
+ export const VALID_WEEKDAY_RANGE = { min: 0, max: 6 } as const;
12
+
13
+ export interface ReminderFormTranslations {
14
+ titleLabel: string;
15
+ titlePlaceholder: string;
16
+ bodyLabel: string;
17
+ bodyPlaceholder: string;
18
+ timeLabel: string;
19
+ frequencyLabel: string;
20
+ weekdayLabel: string;
21
+ saveButton: string;
22
+ cancelButton: string;
23
+ customTimeLabel: string;
24
+ getPresetLabel: (key: string) => string;
25
+ getFrequencyLabel: (key: string) => string;
26
+ getWeekdayLabel: (key: string) => string;
27
+ }
28
+
29
+ export interface ReminderFormProps {
30
+ initialData?: Reminder;
31
+ translations: ReminderFormTranslations;
32
+ onSave: (data: CreateReminderInput) => void;
33
+ onCancel: () => void;
34
+ timePresets?: TimePreset[];
35
+ }