@umituz/react-native-settings 2.0.0 → 2.4.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.
Files changed (160) hide show
  1. package/README.md +129 -3
  2. package/lib/__tests__/setup.d.ts +5 -0
  3. package/lib/__tests__/setup.d.ts.map +1 -0
  4. package/lib/__tests__/setup.js +143 -0
  5. package/lib/__tests__/setup.js.map +1 -0
  6. package/lib/domain/repositories/ISettingsRepository.d.ts +51 -0
  7. package/lib/domain/repositories/ISettingsRepository.d.ts.map +1 -0
  8. package/lib/domain/repositories/ISettingsRepository.js +8 -0
  9. package/lib/domain/repositories/ISettingsRepository.js.map +1 -0
  10. package/lib/index.d.ts +35 -0
  11. package/lib/index.d.ts.map +1 -0
  12. package/lib/index.js +32 -0
  13. package/lib/index.js.map +1 -0
  14. package/lib/infrastructure/storage/SettingsStore.d.ts +36 -0
  15. package/lib/infrastructure/storage/SettingsStore.d.ts.map +1 -0
  16. package/lib/infrastructure/storage/SettingsStore.js +144 -0
  17. package/lib/infrastructure/storage/SettingsStore.js.map +1 -0
  18. package/lib/presentation/components/CloudSyncSetting.d.ts +16 -0
  19. package/lib/presentation/components/CloudSyncSetting.d.ts.map +1 -0
  20. package/lib/presentation/components/CloudSyncSetting.js +30 -0
  21. package/lib/presentation/components/CloudSyncSetting.js.map +1 -0
  22. package/lib/presentation/components/DisclaimerCard.d.ts +15 -0
  23. package/lib/presentation/components/DisclaimerCard.d.ts.map +1 -0
  24. package/lib/presentation/components/DisclaimerCard.js +73 -0
  25. package/lib/presentation/components/DisclaimerCard.js.map +1 -0
  26. package/lib/presentation/components/DisclaimerModal.d.ts +13 -0
  27. package/lib/presentation/components/DisclaimerModal.d.ts.map +1 -0
  28. package/lib/presentation/components/DisclaimerModal.js +62 -0
  29. package/lib/presentation/components/DisclaimerModal.js.map +1 -0
  30. package/lib/presentation/components/DisclaimerSetting.d.ts +39 -0
  31. package/lib/presentation/components/DisclaimerSetting.d.ts.map +1 -0
  32. package/lib/presentation/components/DisclaimerSetting.js +59 -0
  33. package/lib/presentation/components/DisclaimerSetting.js.map +1 -0
  34. package/lib/presentation/components/SettingItem.d.ts +45 -0
  35. package/lib/presentation/components/SettingItem.d.ts.map +1 -0
  36. package/lib/presentation/components/SettingItem.js +113 -0
  37. package/lib/presentation/components/SettingItem.js.map +1 -0
  38. package/lib/presentation/components/SettingsErrorBoundary.d.ts +23 -0
  39. package/lib/presentation/components/SettingsErrorBoundary.d.ts.map +1 -0
  40. package/lib/presentation/components/SettingsErrorBoundary.js +73 -0
  41. package/lib/presentation/components/SettingsErrorBoundary.js.map +1 -0
  42. package/lib/presentation/components/SettingsFooter.d.ts +11 -0
  43. package/lib/presentation/components/SettingsFooter.d.ts.map +1 -0
  44. package/lib/presentation/components/SettingsFooter.js +31 -0
  45. package/lib/presentation/components/SettingsFooter.js.map +1 -0
  46. package/lib/presentation/components/SettingsSection.d.ts +13 -0
  47. package/lib/presentation/components/SettingsSection.d.ts.map +1 -0
  48. package/lib/presentation/components/SettingsSection.js +37 -0
  49. package/lib/presentation/components/SettingsSection.js.map +1 -0
  50. package/lib/presentation/components/StorageClearSetting.d.ts +16 -0
  51. package/lib/presentation/components/StorageClearSetting.d.ts.map +1 -0
  52. package/lib/presentation/components/StorageClearSetting.js +21 -0
  53. package/lib/presentation/components/StorageClearSetting.js.map +1 -0
  54. package/lib/presentation/components/UserProfileHeader.d.ts +30 -0
  55. package/lib/presentation/components/UserProfileHeader.d.ts.map +1 -0
  56. package/lib/presentation/components/UserProfileHeader.js +119 -0
  57. package/lib/presentation/components/UserProfileHeader.js.map +1 -0
  58. package/lib/presentation/screens/AppearanceScreen.d.ts +8 -0
  59. package/lib/presentation/screens/AppearanceScreen.d.ts.map +1 -0
  60. package/lib/presentation/screens/AppearanceScreen.js +8 -0
  61. package/lib/presentation/screens/AppearanceScreen.js.map +1 -0
  62. package/lib/presentation/screens/SettingsScreen.d.ts +38 -0
  63. package/lib/presentation/screens/SettingsScreen.d.ts.map +1 -0
  64. package/lib/presentation/screens/SettingsScreen.js +37 -0
  65. package/lib/presentation/screens/SettingsScreen.js.map +1 -0
  66. package/lib/presentation/screens/components/AboutLegalSection.d.ts +15 -0
  67. package/lib/presentation/screens/components/AboutLegalSection.d.ts.map +1 -0
  68. package/lib/presentation/screens/components/AboutLegalSection.js +28 -0
  69. package/lib/presentation/screens/components/AboutLegalSection.js.map +1 -0
  70. package/lib/presentation/screens/components/AppearanceSection.d.ts +12 -0
  71. package/lib/presentation/screens/components/AppearanceSection.d.ts.map +1 -0
  72. package/lib/presentation/screens/components/AppearanceSection.js +21 -0
  73. package/lib/presentation/screens/components/AppearanceSection.js.map +1 -0
  74. package/lib/presentation/screens/components/LanguageSection.d.ts +12 -0
  75. package/lib/presentation/screens/components/LanguageSection.d.ts.map +1 -0
  76. package/lib/presentation/screens/components/LanguageSection.js +26 -0
  77. package/lib/presentation/screens/components/LanguageSection.js.map +1 -0
  78. package/lib/presentation/screens/components/NotificationsSection.d.ts +12 -0
  79. package/lib/presentation/screens/components/NotificationsSection.d.ts.map +1 -0
  80. package/lib/presentation/screens/components/NotificationsSection.js +58 -0
  81. package/lib/presentation/screens/components/NotificationsSection.js.map +1 -0
  82. package/lib/presentation/screens/components/SettingsContent.d.ts +36 -0
  83. package/lib/presentation/screens/components/SettingsContent.d.ts.map +1 -0
  84. package/lib/presentation/screens/components/SettingsContent.js +81 -0
  85. package/lib/presentation/screens/components/SettingsContent.js.map +1 -0
  86. package/lib/presentation/screens/components/SettingsHeader.d.ts +12 -0
  87. package/lib/presentation/screens/components/SettingsHeader.d.ts.map +1 -0
  88. package/lib/presentation/screens/components/SettingsHeader.js +59 -0
  89. package/lib/presentation/screens/components/SettingsHeader.js.map +1 -0
  90. package/lib/presentation/screens/components/index.d.ts +9 -0
  91. package/lib/presentation/screens/components/index.d.ts.map +1 -0
  92. package/lib/presentation/screens/components/index.js +9 -0
  93. package/lib/presentation/screens/components/index.js.map +1 -0
  94. package/lib/presentation/screens/hooks/useFeatureDetection.d.ts +21 -0
  95. package/lib/presentation/screens/hooks/useFeatureDetection.d.ts.map +1 -0
  96. package/lib/presentation/screens/hooks/useFeatureDetection.js +82 -0
  97. package/lib/presentation/screens/hooks/useFeatureDetection.js.map +1 -0
  98. package/lib/presentation/screens/types/CustomSection.d.ts +19 -0
  99. package/lib/presentation/screens/types/CustomSection.d.ts.map +1 -0
  100. package/lib/presentation/screens/types/CustomSection.js +6 -0
  101. package/lib/presentation/screens/types/CustomSection.js.map +1 -0
  102. package/lib/presentation/screens/types/ExtendedConfig.d.ts +68 -0
  103. package/lib/presentation/screens/types/ExtendedConfig.d.ts.map +1 -0
  104. package/lib/presentation/screens/types/ExtendedConfig.js +6 -0
  105. package/lib/presentation/screens/types/ExtendedConfig.js.map +1 -0
  106. package/lib/presentation/screens/types/FeatureConfig.d.ts +95 -0
  107. package/lib/presentation/screens/types/FeatureConfig.d.ts.map +1 -0
  108. package/lib/presentation/screens/types/FeatureConfig.js +6 -0
  109. package/lib/presentation/screens/types/FeatureConfig.js.map +1 -0
  110. package/lib/presentation/screens/types/SettingsConfig.d.ts +97 -0
  111. package/lib/presentation/screens/types/SettingsConfig.d.ts.map +1 -0
  112. package/lib/presentation/screens/types/SettingsConfig.js +6 -0
  113. package/lib/presentation/screens/types/SettingsConfig.js.map +1 -0
  114. package/lib/presentation/screens/types/index.d.ts +10 -0
  115. package/lib/presentation/screens/types/index.d.ts.map +1 -0
  116. package/lib/presentation/screens/types/index.js +6 -0
  117. package/lib/presentation/screens/types/index.js.map +1 -0
  118. package/lib/presentation/screens/utils/normalizeConfig.d.ts +44 -0
  119. package/lib/presentation/screens/utils/normalizeConfig.d.ts.map +1 -0
  120. package/lib/presentation/screens/utils/normalizeConfig.js +38 -0
  121. package/lib/presentation/screens/utils/normalizeConfig.js.map +1 -0
  122. package/package.json +46 -11
  123. package/src/__tests__/integration.test.tsx +371 -0
  124. package/src/__tests__/performance.test.tsx +369 -0
  125. package/src/__tests__/setup.test.tsx +20 -0
  126. package/src/__tests__/setup.ts +157 -0
  127. package/src/index.ts +9 -0
  128. package/src/infrastructure/storage/SettingsStore.ts +90 -45
  129. package/src/infrastructure/storage/__tests__/SettingsStore.test.tsx +302 -0
  130. package/src/presentation/components/CloudSyncSetting.tsx +11 -17
  131. package/src/presentation/components/DisclaimerCard.tsx +115 -0
  132. package/src/presentation/components/DisclaimerModal.tsx +104 -0
  133. package/src/presentation/components/DisclaimerSetting.tsx +77 -159
  134. package/src/presentation/components/SettingItem.tsx +11 -2
  135. package/src/presentation/components/SettingsErrorBoundary.tsx +126 -0
  136. package/src/presentation/components/StorageClearSetting.tsx +13 -8
  137. package/src/presentation/components/UserProfileHeader.tsx +48 -11
  138. package/src/presentation/components/__tests__/CloudSyncSetting.test.tsx +78 -0
  139. package/src/presentation/components/__tests__/DisclaimerCard.test.tsx +208 -0
  140. package/src/presentation/components/__tests__/DisclaimerModal.test.tsx +236 -0
  141. package/src/presentation/components/__tests__/DisclaimerSetting.test.tsx +74 -0
  142. package/src/presentation/components/__tests__/SettingItem.test.tsx +189 -0
  143. package/src/presentation/components/__tests__/SettingsErrorBoundary.test.tsx +186 -0
  144. package/src/presentation/screens/SettingsScreen.tsx +29 -159
  145. package/src/presentation/screens/__tests__/SettingsScreen.test.tsx +322 -0
  146. package/src/presentation/screens/components/AboutLegalSection.tsx +14 -5
  147. package/src/presentation/screens/components/AppearanceSection.tsx +1 -1
  148. package/src/presentation/screens/components/LanguageSection.tsx +2 -1
  149. package/src/presentation/screens/components/NotificationsSection.tsx +19 -14
  150. package/src/presentation/screens/components/SettingsContent.tsx +167 -0
  151. package/src/presentation/screens/components/SettingsHeader.tsx +79 -0
  152. package/src/presentation/screens/hooks/__tests__/useFeatureDetection.test.tsx +261 -0
  153. package/src/presentation/screens/hooks/useFeatureDetection.ts +15 -5
  154. package/src/presentation/screens/types/CustomSection.ts +20 -0
  155. package/src/presentation/screens/types/ExtendedConfig.ts +68 -0
  156. package/src/presentation/screens/types/FeatureConfig.ts +102 -0
  157. package/src/presentation/screens/types/SettingsConfig.ts +116 -0
  158. package/src/presentation/screens/types/index.ts +20 -0
  159. package/src/presentation/screens/utils/normalizeConfig.ts +2 -1
  160. package/src/presentation/screens/types.ts +0 -263
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Notifications Section Component
3
+ * Single Responsibility: Render notifications settings section
4
+ */
5
+ import React, { useState, useEffect, useCallback } from "react";
6
+ import { Bell } from "lucide-react-native";
7
+ import { useNavigation } from "@react-navigation/native";
8
+ import { useLocalization } from "@umituz/react-native-localization";
9
+ import { SettingItem } from "../../components/SettingItem";
10
+ import { SettingsSection } from "../../components/SettingsSection";
11
+ // Optional notification service
12
+ let notificationService = null;
13
+ try {
14
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
15
+ const module = require("@umituz/react-native-notifications");
16
+ if (module?.notificationService && typeof module.notificationService === 'object') {
17
+ notificationService = module.notificationService;
18
+ }
19
+ }
20
+ catch {
21
+ // Package not available
22
+ }
23
+ export const NotificationsSection = ({ config, }) => {
24
+ const navigation = useNavigation();
25
+ const { t } = useLocalization();
26
+ const [notificationsEnabled, setNotificationsEnabled] = useState(config?.initialValue ?? true);
27
+ useEffect(() => {
28
+ if (config?.initialValue !== undefined) {
29
+ setNotificationsEnabled(config.initialValue);
30
+ }
31
+ }, [config?.initialValue]);
32
+ const handleToggle = useCallback(async (value) => {
33
+ if (notificationService && !value) {
34
+ const hasPermissions = await notificationService.hasPermissions?.();
35
+ if (!hasPermissions) {
36
+ await notificationService.requestPermissions?.();
37
+ }
38
+ }
39
+ setNotificationsEnabled(value);
40
+ config?.onToggleChange?.(value);
41
+ }, [config?.onToggleChange]);
42
+ const handlePress = useCallback(async () => {
43
+ if (notificationService) {
44
+ const hasPermissions = await notificationService.hasPermissions?.();
45
+ if (!hasPermissions) {
46
+ await notificationService.requestPermissions?.();
47
+ }
48
+ }
49
+ navigation.navigate(config?.route || config?.defaultRoute || "Notifications");
50
+ }, [navigation, config?.route, config?.defaultRoute]);
51
+ const title = config?.title || t("settings.notifications.title");
52
+ const description = config?.description || t("settings.notifications.description");
53
+ const showToggle = config?.showToggle ?? true;
54
+ return (<SettingsSection title={t("settings.sections.general")}>
55
+ {showToggle ? (<SettingItem icon={Bell} title={title} showSwitch={true} switchValue={notificationsEnabled} onSwitchChange={handleToggle} isLast={true}/>) : (<SettingItem icon={Bell} title={title} value={description} onPress={handlePress} isLast={true}/>)}
56
+ </SettingsSection>);
57
+ };
58
+ //# sourceMappingURL=NotificationsSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationsSection.js","sourceRoot":"","sources":["../../../../src/presentation/screens/components/NotificationsSection.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,gCAAgC;AAChC,IAAI,mBAAmB,GAGZ,IAAI,CAAC;AAChB,IAAI,CAAC;IACH,iEAAiE;IACjE,MAAM,MAAM,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;IAC7D,IAAI,MAAM,EAAE,mBAAmB,IAAI,OAAO,MAAM,CAAC,mBAAmB,KAAK,QAAQ,EAAE,CAAC;QAClF,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;IACnD,CAAC;AACH,CAAC;AAAC,MAAM,CAAC;IACP,wBAAwB;AAC1B,CAAC;AAMD,MAAM,CAAC,MAAM,oBAAoB,GAAwC,CAAC,EACxE,MAAM,GACP,EAAE,EAAE;IACH,MAA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C,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IAEtD,MAAM,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC,CAAC,8BAA8B,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,MAAM,EAAE,WAAW,IAAI,CAAC,CAAC,oCAAoC,CAAC,CAAC;IACnF,MAAM,UAAU,GAAG,MAAM,EAAE,UAAU,IAAI,IAAI,CAAC;IAE9C,OAAO,CACL,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CACrD;MAAA,CAAC,UAAU,CAAC,CAAC,CAAC,CACZ,CAAC,WAAW,CACV,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,UAAU,CAAC,CAAC,IAAI,CAAC,CACjB,WAAW,CAAC,CAAC,oBAAoB,CAAC,CAClC,cAAc,CAAC,CAAC,YAAY,CAAC,CAC7B,MAAM,CAAC,CAAC,IAAI,CAAC,EACb,CACH,CAAC,CAAC,CAAC,CACF,CAAC,WAAW,CACV,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,KAAK,CAAC,CAAC,WAAW,CAAC,CACnB,OAAO,CAAC,CAAC,WAAW,CAAC,CACrB,MAAM,CAAC,CAAC,IAAI,CAAC,EACb,CACH,CACH;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Settings Content Component
3
+ * Renders all settings sections and custom content
4
+ */
5
+ import React from "react";
6
+ import type { NormalizedConfig } from "../utils/normalizeConfig";
7
+ import type { CustomSettingsSection } from "../types";
8
+ interface SettingsContentProps {
9
+ normalizedConfig: NormalizedConfig;
10
+ config?: any;
11
+ features: {
12
+ appearance: boolean;
13
+ language: boolean;
14
+ notifications: boolean;
15
+ about: boolean;
16
+ legal: boolean;
17
+ };
18
+ showUserProfile?: boolean;
19
+ userProfile?: {
20
+ displayName?: string;
21
+ userId?: string;
22
+ isGuest?: boolean;
23
+ avatarUrl?: string;
24
+ accountSettingsRoute?: string;
25
+ onPress?: () => void;
26
+ guestDisplayName?: string;
27
+ avatarServiceUrl?: string;
28
+ };
29
+ showFooter?: boolean;
30
+ footerText?: string;
31
+ customSections?: CustomSettingsSection[];
32
+ showCloseButton?: boolean;
33
+ }
34
+ export declare const SettingsContent: React.FC<SettingsContentProps>;
35
+ export {};
36
+ //# sourceMappingURL=SettingsContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsContent.d.ts","sourceRoot":"","sources":["../../../../src/presentation/screens/components/SettingsContent.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAYvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD,UAAU,oBAAoB;IAC5B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE;QACR,UAAU,EAAE,OAAO,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;QAClB,aAAa,EAAE,OAAO,CAAC;QACvB,KAAK,EAAE,OAAO,CAAC;QACf,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE;QACZ,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACzC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAuG1D,CAAC"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Settings Content Component
3
+ * Renders all settings sections and custom content
4
+ */
5
+ import React, { useMemo } from "react";
6
+ import { View, ScrollView, StyleSheet } from "react-native";
7
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
8
+ import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
9
+ import { useLocalization } from "@umituz/react-native-localization";
10
+ import { SettingsFooter } from "../../components/SettingsFooter";
11
+ import { UserProfileHeader } from "../../components/UserProfileHeader";
12
+ import { SettingsSection } from "../../components/SettingsSection";
13
+ import { AppearanceSection } from "./AppearanceSection";
14
+ import { LanguageSection } from "./LanguageSection";
15
+ import { NotificationsSection } from "./NotificationsSection";
16
+ import { AboutLegalSection } from "./AboutLegalSection";
17
+ export const SettingsContent = ({ normalizedConfig, config, features, showUserProfile = false, userProfile, showFooter = true, footerText, customSections = [], showCloseButton = false, }) => {
18
+ const tokens = useAppDesignTokens();
19
+ const insets = useSafeAreaInsets();
20
+ const { t } = useLocalization();
21
+ const hasAnyFeatures = useMemo(() => features.appearance ||
22
+ features.language ||
23
+ features.notifications ||
24
+ features.about ||
25
+ features.legal ||
26
+ customSections.length > 0, [features, customSections.length]);
27
+ const sortedSections = useMemo(() => {
28
+ return Array.from(customSections)
29
+ .sort((a, b) => (a.order ?? 999) - (b.order ?? 999));
30
+ }, [customSections]);
31
+ return (<ScrollView style={styles.scrollView} contentContainerStyle={[
32
+ styles.scrollContent,
33
+ {
34
+ paddingTop: showCloseButton ? tokens.spacing.md : insets.top + tokens.spacing.md,
35
+ paddingBottom: tokens.spacing.xxxl + tokens.spacing.xl,
36
+ paddingHorizontal: 0,
37
+ },
38
+ ]} showsVerticalScrollIndicator={false}>
39
+ {showUserProfile && (<View style={styles.profileContainer}>
40
+ <UserProfileHeader displayName={userProfile?.displayName} userId={userProfile?.userId} isGuest={userProfile?.isGuest} avatarUrl={userProfile?.avatarUrl} accountSettingsRoute={userProfile?.accountSettingsRoute} onPress={userProfile?.onPress}/>
41
+ </View>)}
42
+
43
+ {features.appearance && (<AppearanceSection config={normalizedConfig.appearance.config}/>)}
44
+
45
+ {features.language && (<LanguageSection config={normalizedConfig.language.config}/>)}
46
+
47
+ {features.notifications && (<NotificationsSection config={normalizedConfig.notifications.config}/>)}
48
+
49
+ {(features.about || features.legal) && (<AboutLegalSection showAbout={features.about} showLegal={features.legal} aboutConfig={normalizedConfig.about.config} legalConfig={normalizedConfig.legal.config}/>)}
50
+
51
+ {customSections && customSections.length > 0 && (<>
52
+ {sortedSections.map((section, index) => (<SettingsSection key={section.id || `custom-${index}`} title={section.title}>
53
+ {section.content}
54
+ </SettingsSection>))}
55
+ </>)}
56
+
57
+ {!hasAnyFeatures && (<View style={styles.emptyContainer}>
58
+ <SettingsSection title={config?.emptyStateText || t("settings.noOptionsAvailable") || "No settings available"}>
59
+ <View />
60
+ </SettingsSection>
61
+ </View>)}
62
+
63
+ {showFooter && <SettingsFooter versionText={footerText}/>}
64
+ </ScrollView>);
65
+ };
66
+ const styles = StyleSheet.create({
67
+ scrollView: {
68
+ flex: 1,
69
+ },
70
+ scrollContent: {
71
+ flexGrow: 1,
72
+ },
73
+ profileContainer: {
74
+ marginBottom: 32,
75
+ paddingHorizontal: 0,
76
+ },
77
+ emptyContainer: {
78
+ paddingVertical: 24,
79
+ },
80
+ });
81
+ //# sourceMappingURL=SettingsContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsContent.js","sourceRoot":"","sources":["../../../../src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AG,CACJ,CAED;;MAAA,CAAC,CAAC,cAAc,IAAI,CAClB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CACjC;UAAA,CAAC,eAAe,CACd,KAAK,CAAC,CAAC,MAAM,EAAE,cAAc,IAAI,CAAC,CAAC,6BAA6B,CAAC,IAAI,uBAAuB,CAAC,CAE7F;YAAA,CAAC,IAAI,CAAC,AAAD,EACP;UAAA,EAAE,eAAe,CACnB;QAAA,EAAE,IAAI,CAAC,CACR,CAED;;MAAA,CAAC,UAAU,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,EAAG,CAC5D;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,UAAU,EAAE;QACV,IAAI,EAAE,CAAC;KACR;IACD,aAAa,EAAE;QACb,QAAQ,EAAE,CAAC;KACZ;IACD,gBAAgB,EAAE;QAChB,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,CAAC;KACrB;IACD,cAAc,EAAE;QACd,eAAe,EAAE,EAAE;KACpB;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Settings Header Component
3
+ * Handles close button functionality
4
+ */
5
+ import React from "react";
6
+ interface SettingsHeaderProps {
7
+ showCloseButton?: boolean;
8
+ onClose?: () => void;
9
+ }
10
+ export declare const SettingsHeader: React.FC<SettingsHeaderProps>;
11
+ export {};
12
+ //# sourceMappingURL=SettingsHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsHeader.d.ts","sourceRoot":"","sources":["../../../../src/presentation/screens/components/SettingsHeader.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,mBAAmB;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4CxD,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Settings Header Component
3
+ * Handles close button functionality
4
+ */
5
+ import React from "react";
6
+ import { View, TouchableOpacity, StyleSheet } from "react-native";
7
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
8
+ import { useNavigation } from "@react-navigation/native";
9
+ import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
10
+ import { AtomicIcon } from "@umituz/react-native-design-system-atoms";
11
+ export const SettingsHeader = ({ showCloseButton = false, onClose, }) => {
12
+ const navigation = useNavigation();
13
+ const tokens = useAppDesignTokens();
14
+ const insets = useSafeAreaInsets();
15
+ const handleClose = () => {
16
+ if (onClose) {
17
+ onClose();
18
+ }
19
+ else {
20
+ navigation.goBack();
21
+ }
22
+ };
23
+ if (!showCloseButton) {
24
+ return null;
25
+ }
26
+ return (<View style={[
27
+ styles.closeButtonContainer,
28
+ {
29
+ paddingTop: insets.top + tokens.spacing.xs,
30
+ paddingRight: tokens.spacing.md,
31
+ },
32
+ ]}>
33
+ <TouchableOpacity onPress={handleClose} style={[
34
+ styles.closeButton,
35
+ {
36
+ backgroundColor: tokens.colors.surface,
37
+ },
38
+ ]} hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}>
39
+ <AtomicIcon name="X" size="lg" color="primary"/>
40
+ </TouchableOpacity>
41
+ </View>);
42
+ };
43
+ const styles = StyleSheet.create({
44
+ closeButtonContainer: {
45
+ position: "absolute",
46
+ top: 0,
47
+ right: 0,
48
+ zIndex: 10,
49
+ alignItems: "flex-end",
50
+ },
51
+ closeButton: {
52
+ width: 44,
53
+ height: 44,
54
+ borderRadius: 22,
55
+ justifyContent: "center",
56
+ alignItems: "center",
57
+ },
58
+ });
59
+ //# sourceMappingURL=SettingsHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsHeader.js","source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,CAAC,MAAM,CAAC,OAAO;aACvC;SACF,CAAC,CACF,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAEtD;QAAA,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAChD;MAAA,EAAE,gBAAgB,CACpB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,oBAAoB,EAAE;QACpB,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,UAAU;KACvB;IACD,WAAW,EAAE;QACX,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Settings Screen Components
3
+ * Barrel export for all section components
4
+ */
5
+ export { AppearanceSection } from "./AppearanceSection";
6
+ export { LanguageSection } from "./LanguageSection";
7
+ export { NotificationsSection } from "./NotificationsSection";
8
+ export { AboutLegalSection } from "./AboutLegalSection";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/presentation/screens/components/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Settings Screen Components
3
+ * Barrel export for all section components
4
+ */
5
+ export { AppearanceSection } from "./AppearanceSection";
6
+ export { LanguageSection } from "./LanguageSection";
7
+ export { NotificationsSection } from "./NotificationsSection";
8
+ export { AboutLegalSection } from "./AboutLegalSection";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/presentation/screens/components/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Feature Detection Hook
3
+ * Single Responsibility: Detect which features should be shown
4
+ */
5
+ import type { NormalizedConfig } from "../utils/normalizeConfig";
6
+ /**
7
+ * Hook to detect which features should be shown
8
+ */
9
+ export declare function useFeatureDetection(normalizedConfig: NormalizedConfig, navigation: any, options?: {
10
+ notificationServiceAvailable?: boolean;
11
+ }): {
12
+ appearance: boolean;
13
+ language: boolean;
14
+ notifications: boolean;
15
+ about: boolean;
16
+ legal: boolean;
17
+ account: boolean;
18
+ support: boolean;
19
+ developer: boolean;
20
+ };
21
+ //# sourceMappingURL=useFeatureDetection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFeatureDetection.d.ts","sourceRoot":"","sources":["../../../../src/presentation/screens/hooks/useFeatureDetection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AA8CjE;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,GAAG,EACf,OAAO,CAAC,EAAE;IACR,4BAA4B,CAAC,EAAE,OAAO,CAAC;CACxC;;;;;;;;;EAwDF"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Feature Detection Hook
3
+ * Single Responsibility: Detect which features should be shown
4
+ */
5
+ import { useMemo } from "react";
6
+ // Optional notification service
7
+ let notificationService = null;
8
+ try {
9
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
10
+ const module = require("@umituz/react-native-notifications");
11
+ if (module?.notificationService && typeof module.notificationService === 'object') {
12
+ notificationService = module.notificationService;
13
+ }
14
+ }
15
+ catch {
16
+ // Package not available
17
+ }
18
+ /**
19
+ * Check if navigation screen exists
20
+ */
21
+ function hasNavigationScreen(navigation, screenName) {
22
+ try {
23
+ const state = navigation.getState();
24
+ if (!state)
25
+ return false;
26
+ const checkRoutes = (routes) => {
27
+ if (!routes || !Array.isArray(routes))
28
+ return false;
29
+ for (const route of routes) {
30
+ if (route.name === screenName)
31
+ return true;
32
+ if (route.state?.routes && checkRoutes(route.state.routes)) {
33
+ return true;
34
+ }
35
+ }
36
+ return false;
37
+ };
38
+ return checkRoutes(state.routes || []);
39
+ }
40
+ catch {
41
+ return false;
42
+ }
43
+ }
44
+ /**
45
+ * Hook to detect which features should be shown
46
+ */
47
+ export function useFeatureDetection(normalizedConfig, navigation, options) {
48
+ return useMemo(() => {
49
+ const { appearance, language, notifications, about, legal, account, support, developer } = normalizedConfig;
50
+ const notificationServiceAvailable = options?.notificationServiceAvailable ?? notificationService !== null;
51
+ return {
52
+ appearance: appearance.enabled &&
53
+ (appearance.config?.enabled === true ||
54
+ (appearance.config?.enabled !== false &&
55
+ hasNavigationScreen(navigation, appearance.config?.route || "Appearance"))),
56
+ language: language.enabled &&
57
+ (language.config?.enabled === true ||
58
+ (language.config?.enabled !== false &&
59
+ hasNavigationScreen(navigation, language.config?.route || "LanguageSelection"))),
60
+ notifications: notifications.enabled &&
61
+ (notifications.config?.enabled === true ||
62
+ (notifications.config?.enabled !== false &&
63
+ notificationServiceAvailable &&
64
+ hasNavigationScreen(navigation, notifications.config?.route || "Notifications"))),
65
+ about: about.enabled &&
66
+ (about.config?.enabled === true ||
67
+ (about.config?.enabled !== false &&
68
+ hasNavigationScreen(navigation, about.config?.route || "About"))),
69
+ legal: legal.enabled &&
70
+ (legal.config?.enabled === true ||
71
+ (legal.config?.enabled !== false &&
72
+ hasNavigationScreen(navigation, legal.config?.route || "Legal"))),
73
+ account: account.enabled &&
74
+ (account.config?.enabled === true ||
75
+ (account.config?.enabled !== false &&
76
+ hasNavigationScreen(navigation, account.config?.route || "AccountSettings"))),
77
+ support: support.enabled,
78
+ developer: developer.enabled && __DEV__,
79
+ };
80
+ }, [normalizedConfig, navigation, options]);
81
+ }
82
+ //# sourceMappingURL=useFeatureDetection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFeatureDetection.js","sourceRoot":"","sources":["../../../../src/presentation/screens/hooks/useFeatureDetection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,gCAAgC;AAChC,IAAI,mBAAmB,GAGZ,IAAI,CAAC;AAChB,IAAI,CAAC;IACH,iEAAiE;IACjE,MAAM,MAAM,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;IAC7D,IAAI,MAAM,EAAE,mBAAmB,IAAI,OAAO,MAAM,CAAC,mBAAmB,KAAK,QAAQ,EAAE,CAAC;QAClF,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;IACnD,CAAC;AACH,CAAC;AAAC,MAAM,CAAC;IACP,wBAAwB;AAC1B,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAC1B,UAAe,EACf,UAAkB;IAElB,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC;QACpC,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAEzB,MAAM,WAAW,GAA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AO;SACxC,CAAC;IACJ,CAAC,EAAE,CAAC,gBAAgB,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Custom Settings Section Type
3
+ * Allows apps to add custom sections to the settings screen
4
+ */
5
+ import type { ReactNode } from "react";
6
+ /**
7
+ * Custom Settings Section
8
+ */
9
+ export interface CustomSettingsSection {
10
+ /** Section title */
11
+ title: string;
12
+ /** Section content (React nodes) */
13
+ content: ReactNode;
14
+ /** Section order (lower = higher in list) */
15
+ order?: number;
16
+ /** Section ID for identification */
17
+ id?: string;
18
+ }
19
+ //# sourceMappingURL=CustomSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomSection.d.ts","sourceRoot":"","sources":["../../../../src/presentation/screens/types/CustomSection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,OAAO,EAAE,SAAS,CAAC;IACnB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Custom Settings Section Type
3
+ * Allows apps to add custom sections to the settings screen
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=CustomSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomSection.js","sourceRoot":"","sources":["../../../../src/presentation/screens/types/CustomSection.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Extended Configuration Types
3
+ * Account, Support, and Developer configurations
4
+ */
5
+ import type { ComponentType } from "react";
6
+ import type { FeatureVisibility } from "./FeatureConfig";
7
+ /**
8
+ * Account Settings Configuration
9
+ */
10
+ export interface AccountConfig {
11
+ /** Show account section */
12
+ enabled?: FeatureVisibility;
13
+ /** Custom navigation route for account screen */
14
+ route?: string;
15
+ /** Custom account title */
16
+ title?: string;
17
+ /** Custom account description */
18
+ description?: string;
19
+ }
20
+ /**
21
+ * Support Settings Configuration
22
+ */
23
+ export interface SupportConfig {
24
+ /** Show support section */
25
+ enabled?: FeatureVisibility;
26
+ /** Support items configuration */
27
+ items?: {
28
+ /** Live support configuration */
29
+ liveSupport?: {
30
+ enabled?: boolean;
31
+ route?: string;
32
+ title?: string;
33
+ description?: string;
34
+ };
35
+ /** Help support configuration */
36
+ helpSupport?: {
37
+ enabled?: boolean;
38
+ route?: string;
39
+ title?: string;
40
+ description?: string;
41
+ };
42
+ };
43
+ /** Custom support section title */
44
+ title?: string;
45
+ }
46
+ /**
47
+ * Developer Settings Configuration
48
+ */
49
+ export interface DeveloperConfig {
50
+ /** Show developer section (only in __DEV__ mode) */
51
+ enabled?: boolean;
52
+ /** Developer settings items */
53
+ items?: Array<{
54
+ title: string;
55
+ description?: string;
56
+ route?: string;
57
+ onPress?: () => void;
58
+ icon?: ComponentType<{
59
+ size?: number;
60
+ color?: string;
61
+ }>;
62
+ iconColor?: string;
63
+ titleColor?: string;
64
+ }>;
65
+ /** Custom developer section title */
66
+ title?: string;
67
+ }
68
+ //# sourceMappingURL=ExtendedConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtendedConfig.d.ts","sourceRoot":"","sources":["../../../../src/presentation/screens/types/ExtendedConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,2BAA2B;IAC3B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,iDAAiD;IACjD,KAAK,CAA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,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Extended Configuration Types
3
+ * Account, Support, and Developer configurations
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=ExtendedConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtendedConfig.js","sourceRoot":"","sources":["../../../../src/presentation/screens/types/ExtendedConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Feature Configuration Types
3
+ * Core types for feature visibility and configuration
4
+ */
5
+ /**
6
+ * Feature visibility configuration
7
+ * - true: Always show (if navigation screen exists)
8
+ * - false: Never show
9
+ * - 'auto': Automatically detect (check if navigation screen exists and package is available)
10
+ */
11
+ export type FeatureVisibility = boolean | "auto";
12
+ /**
13
+ * Appearance Settings Configuration
14
+ */
15
+ export interface AppearanceConfig {
16
+ /** Show appearance section */
17
+ enabled?: FeatureVisibility;
18
+ /** Custom navigation route for appearance screen */
19
+ route?: string;
20
+ /** Show theme toggle */
21
+ showTheme?: boolean;
22
+ /** Custom appearance title */
23
+ title?: string;
24
+ /** Custom appearance description */
25
+ description?: string;
26
+ /** Default route name when no custom route provided */
27
+ defaultRoute?: string;
28
+ }
29
+ /**
30
+ * Language Settings Configuration
31
+ */
32
+ export interface LanguageConfig {
33
+ /** Show language section */
34
+ enabled?: FeatureVisibility;
35
+ /** Custom navigation route for language selection screen */
36
+ route?: string;
37
+ /** Custom language title */
38
+ title?: string;
39
+ /** Custom language description */
40
+ description?: string;
41
+ /** Default language display when no language is detected */
42
+ defaultLanguageDisplay?: string;
43
+ }
44
+ /**
45
+ * Notifications Settings Configuration
46
+ */
47
+ export interface NotificationsConfig {
48
+ /** Show notifications section */
49
+ enabled?: FeatureVisibility;
50
+ /** Show notification toggle switch */
51
+ showToggle?: boolean;
52
+ /** Initial toggle value */
53
+ initialValue?: boolean;
54
+ /** Toggle change handler */
55
+ onToggleChange?: (value: boolean) => void;
56
+ /** Custom navigation route for notifications screen */
57
+ route?: string;
58
+ /** Custom notifications title */
59
+ title?: string;
60
+ /** Custom notifications description */
61
+ description?: string;
62
+ /** Default route name when no custom route provided */
63
+ defaultRoute?: string;
64
+ }
65
+ /**
66
+ * About Settings Configuration
67
+ */
68
+ export interface AboutConfig {
69
+ /** Show about section */
70
+ enabled?: FeatureVisibility;
71
+ /** Custom navigation route for about screen */
72
+ route?: string;
73
+ /** Custom about title */
74
+ title?: string;
75
+ /** Custom about description */
76
+ description?: string;
77
+ /** Default route name when no custom route provided */
78
+ defaultRoute?: string;
79
+ }
80
+ /**
81
+ * Legal Settings Configuration
82
+ */
83
+ export interface LegalConfig {
84
+ /** Show legal section */
85
+ enabled?: FeatureVisibility;
86
+ /** Custom navigation route for legal screen */
87
+ route?: string;
88
+ /** Custom legal title */
89
+ title?: string;
90
+ /** Custom legal description */
91
+ description?: string;
92
+ /** Default route name when no custom route provided */
93
+ defaultRoute?: string;
94
+ }
95
+ //# sourceMappingURL=FeatureConfig.d.ts.map