@oxyhq/services 6.10.7 → 7.0.0

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 (454) hide show
  1. package/lib/commonjs/index.js +211 -49
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/ui/client.js +25 -4
  4. package/lib/commonjs/ui/client.js.map +1 -1
  5. package/lib/commonjs/ui/components/AccountMenu.js +485 -0
  6. package/lib/commonjs/ui/components/AccountMenu.js.map +1 -0
  7. package/lib/commonjs/ui/components/AccountMenuButton.js +120 -0
  8. package/lib/commonjs/ui/components/AccountMenuButton.js.map +1 -0
  9. package/lib/commonjs/ui/components/ActingAsBanner.js +2 -2
  10. package/lib/commonjs/ui/components/ActingAsBanner.js.map +1 -1
  11. package/lib/commonjs/ui/components/ProfileCard.js +2 -2
  12. package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
  13. package/lib/commonjs/ui/components/StepBasedScreen.js +2 -2
  14. package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
  15. package/lib/commonjs/ui/components/accountMenuRows.js +45 -0
  16. package/lib/commonjs/ui/components/accountMenuRows.js.map +1 -0
  17. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +5 -5
  18. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  19. package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +3 -2
  20. package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
  21. package/lib/commonjs/ui/components/theming.js +2 -2
  22. package/lib/commonjs/ui/components/theming.js.map +1 -1
  23. package/lib/commonjs/ui/context/OxyContext.js +211 -21
  24. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  25. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +36 -2
  26. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  27. package/lib/commonjs/ui/hooks/mutations/mutationKeys.js +6 -0
  28. package/lib/commonjs/ui/hooks/mutations/mutationKeys.js.map +1 -1
  29. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +138 -1
  30. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  31. package/lib/commonjs/ui/hooks/queries/queryKeys.js +67 -2
  32. package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
  33. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +27 -2
  34. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
  35. package/lib/commonjs/ui/hooks/useAuth.js +13 -2
  36. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  37. package/lib/commonjs/ui/hooks/useSessionManagement.js +30 -0
  38. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  39. package/lib/commonjs/ui/index.js +132 -85
  40. package/lib/commonjs/ui/index.js.map +1 -1
  41. package/lib/commonjs/ui/navigation/routes.js +6 -7
  42. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  43. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +3 -2
  44. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
  45. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +202 -0
  46. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -0
  47. package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js +3 -2
  48. package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js.map +1 -1
  49. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +3 -2
  50. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  51. package/lib/commonjs/ui/screens/FAQScreen.js +7 -4
  52. package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
  53. package/lib/commonjs/ui/screens/FeedbackScreen.js +21 -16
  54. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  55. package/lib/commonjs/ui/screens/HelpSupportScreen.js +3 -2
  56. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
  57. package/lib/commonjs/ui/screens/HistoryViewScreen.js +7 -4
  58. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  59. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -2
  60. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  61. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +6 -4
  62. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  63. package/lib/commonjs/ui/screens/ManageAccountScreen.js +780 -0
  64. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -0
  65. package/lib/commonjs/ui/screens/NotificationsScreen.js +175 -0
  66. package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -0
  67. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +18 -12
  68. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  69. package/lib/commonjs/ui/screens/PreferencesScreen.js +220 -0
  70. package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -0
  71. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +14 -10
  72. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
  73. package/lib/commonjs/ui/screens/ProfileScreen.js +3 -3
  74. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  75. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +8 -5
  76. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
  77. package/lib/commonjs/ui/screens/SearchSettingsScreen.js +6 -4
  78. package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
  79. package/lib/commonjs/ui/screens/UserLinksScreen.js +3 -2
  80. package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
  81. package/lib/commonjs/ui/screens/UserListScreen.js +2 -2
  82. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
  83. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +3 -2
  84. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  85. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +3 -2
  86. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
  87. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +2 -2
  88. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  89. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +4 -3
  90. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  91. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +3 -2
  92. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  93. package/lib/commonjs/ui/utils/activeAuthuser.js +85 -0
  94. package/lib/commonjs/ui/utils/activeAuthuser.js.map +1 -0
  95. package/lib/module/index.js +58 -16
  96. package/lib/module/index.js.map +1 -1
  97. package/lib/module/ui/client.js +5 -3
  98. package/lib/module/ui/client.js.map +1 -1
  99. package/lib/module/ui/components/AccountMenu.js +480 -0
  100. package/lib/module/ui/components/AccountMenu.js.map +1 -0
  101. package/lib/module/ui/components/AccountMenuButton.js +115 -0
  102. package/lib/module/ui/components/AccountMenuButton.js.map +1 -0
  103. package/lib/module/ui/components/ActingAsBanner.js +2 -2
  104. package/lib/module/ui/components/ActingAsBanner.js.map +1 -1
  105. package/lib/module/ui/components/ProfileCard.js +1 -1
  106. package/lib/module/ui/components/ProfileCard.js.map +1 -1
  107. package/lib/module/ui/components/StepBasedScreen.js +1 -1
  108. package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
  109. package/lib/module/ui/components/accountMenuRows.js +41 -0
  110. package/lib/module/ui/components/accountMenuRows.js.map +1 -0
  111. package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
  112. package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  113. package/lib/module/ui/components/payment/PaymentMethodStep.js +1 -1
  114. package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
  115. package/lib/module/ui/components/theming.js +1 -1
  116. package/lib/module/ui/components/theming.js.map +1 -1
  117. package/lib/module/ui/context/OxyContext.js +211 -21
  118. package/lib/module/ui/context/OxyContext.js.map +1 -1
  119. package/lib/module/ui/context/hooks/useAuthOperations.js +36 -2
  120. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  121. package/lib/module/ui/hooks/mutations/mutationKeys.js +6 -0
  122. package/lib/module/ui/hooks/mutations/mutationKeys.js.map +1 -1
  123. package/lib/module/ui/hooks/mutations/useAccountMutations.js +135 -1
  124. package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  125. package/lib/module/ui/hooks/queries/queryKeys.js +60 -1
  126. package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
  127. package/lib/module/ui/hooks/queries/useAccountQueries.js +24 -0
  128. package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
  129. package/lib/module/ui/hooks/useAuth.js +13 -2
  130. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  131. package/lib/module/ui/hooks/useSessionManagement.js +30 -0
  132. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  133. package/lib/module/ui/index.js +34 -78
  134. package/lib/module/ui/index.js.map +1 -1
  135. package/lib/module/ui/navigation/routes.js +6 -7
  136. package/lib/module/ui/navigation/routes.js.map +1 -1
  137. package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
  138. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
  139. package/lib/module/ui/screens/ConnectedAppsScreen.js +198 -0
  140. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -0
  141. package/lib/module/ui/screens/CreateManagedAccountScreen.js +1 -1
  142. package/lib/module/ui/screens/CreateManagedAccountScreen.js.map +1 -1
  143. package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -1
  144. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  145. package/lib/module/ui/screens/FAQScreen.js +3 -1
  146. package/lib/module/ui/screens/FAQScreen.js.map +1 -1
  147. package/lib/module/ui/screens/FeedbackScreen.js +6 -2
  148. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  149. package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
  150. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
  151. package/lib/module/ui/screens/HistoryViewScreen.js +3 -1
  152. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  153. package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
  154. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  155. package/lib/module/ui/screens/LegalDocumentsScreen.js +2 -1
  156. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  157. package/lib/module/ui/screens/ManageAccountScreen.js +775 -0
  158. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -0
  159. package/lib/module/ui/screens/NotificationsScreen.js +169 -0
  160. package/lib/module/ui/screens/NotificationsScreen.js.map +1 -0
  161. package/lib/module/ui/screens/PaymentGatewayScreen.js +9 -3
  162. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  163. package/lib/module/ui/screens/PreferencesScreen.js +214 -0
  164. package/lib/module/ui/screens/PreferencesScreen.js.map +1 -0
  165. package/lib/module/ui/screens/PrivacySettingsScreen.js +4 -1
  166. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
  167. package/lib/module/ui/screens/ProfileScreen.js +2 -2
  168. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  169. package/lib/module/ui/screens/SavesCollectionsScreen.js +3 -1
  170. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
  171. package/lib/module/ui/screens/SearchSettingsScreen.js +2 -1
  172. package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
  173. package/lib/module/ui/screens/UserLinksScreen.js +1 -1
  174. package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
  175. package/lib/module/ui/screens/UserListScreen.js +1 -1
  176. package/lib/module/ui/screens/UserListScreen.js.map +1 -1
  177. package/lib/module/ui/screens/karma/KarmaAboutScreen.js +1 -1
  178. package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  179. package/lib/module/ui/screens/karma/KarmaFAQScreen.js +1 -1
  180. package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
  181. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
  182. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  183. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +1 -1
  184. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  185. package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
  186. package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  187. package/lib/module/ui/utils/activeAuthuser.js +79 -0
  188. package/lib/module/ui/utils/activeAuthuser.js.map +1 -0
  189. package/lib/typescript/commonjs/index.d.ts +23 -6
  190. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  191. package/lib/typescript/commonjs/ui/client.d.ts +7 -2
  192. package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
  193. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +23 -0
  194. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +19 -0
  196. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/ui/components/accountMenuRows.d.ts +27 -0
  198. package/lib/typescript/commonjs/ui/components/accountMenuRows.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  200. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  201. package/lib/typescript/commonjs/ui/hooks/mutations/mutationKeys.d.ts +5 -0
  202. package/lib/typescript/commonjs/ui/hooks/mutations/mutationKeys.d.ts.map +1 -1
  203. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +26 -1
  204. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  205. package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts +32 -3
  206. package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts.map +1 -1
  207. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +10 -1
  208. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  209. package/lib/typescript/commonjs/ui/hooks/queries/useSecurityQueries.d.ts +1 -1
  210. package/lib/typescript/commonjs/ui/hooks/queries/useSecurityQueries.d.ts.map +1 -1
  211. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +8 -2
  212. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  213. package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
  214. package/lib/typescript/commonjs/ui/index.d.ts +32 -18
  215. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  216. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  217. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  218. package/lib/typescript/{module/ui/screens/AccountOverviewScreen.d.ts → commonjs/ui/screens/ConnectedAppsScreen.d.ts} +1 -1
  219. package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -0
  220. package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
  221. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
  222. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  223. package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  224. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +13 -0
  225. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -0
  226. package/lib/typescript/commonjs/ui/screens/{AccountOverviewScreen.d.ts → NotificationsScreen.d.ts} +1 -1
  227. package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -0
  228. package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts +1 -1
  229. package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  230. package/lib/typescript/commonjs/ui/screens/{AccountSettingsScreen.d.ts → PreferencesScreen.d.ts} +2 -5
  231. package/lib/typescript/commonjs/ui/screens/PreferencesScreen.d.ts.map +1 -0
  232. package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  234. package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  235. package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts +42 -0
  236. package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts.map +1 -0
  237. package/lib/typescript/module/index.d.ts +23 -6
  238. package/lib/typescript/module/index.d.ts.map +1 -1
  239. package/lib/typescript/module/ui/client.d.ts +7 -2
  240. package/lib/typescript/module/ui/client.d.ts.map +1 -1
  241. package/lib/typescript/module/ui/components/AccountMenu.d.ts +23 -0
  242. package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +1 -0
  243. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +19 -0
  244. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +1 -0
  245. package/lib/typescript/module/ui/components/accountMenuRows.d.ts +27 -0
  246. package/lib/typescript/module/ui/components/accountMenuRows.d.ts.map +1 -0
  247. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  248. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  249. package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts +5 -0
  250. package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts.map +1 -1
  251. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +26 -1
  252. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  253. package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +32 -3
  254. package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
  255. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +10 -1
  256. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  257. package/lib/typescript/module/ui/hooks/queries/useSecurityQueries.d.ts +1 -1
  258. package/lib/typescript/module/ui/hooks/queries/useSecurityQueries.d.ts.map +1 -1
  259. package/lib/typescript/module/ui/hooks/useAuth.d.ts +8 -2
  260. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  261. package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
  262. package/lib/typescript/module/ui/index.d.ts +32 -18
  263. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  264. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  265. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  266. package/lib/typescript/module/ui/screens/{AccountSettingsScreen.d.ts → ConnectedAppsScreen.d.ts} +2 -5
  267. package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -0
  268. package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
  269. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
  270. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  271. package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  272. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +13 -0
  273. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -0
  274. package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts +5 -0
  275. package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -0
  276. package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts +1 -1
  277. package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  278. package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts +5 -0
  279. package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -0
  280. package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  281. package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  282. package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  283. package/lib/typescript/module/ui/utils/activeAuthuser.d.ts +42 -0
  284. package/lib/typescript/module/ui/utils/activeAuthuser.d.ts.map +1 -0
  285. package/package.json +20 -9
  286. package/src/index.ts +141 -47
  287. package/src/ui/client.ts +7 -2
  288. package/src/ui/components/AccountMenu.tsx +534 -0
  289. package/src/ui/components/AccountMenuButton.tsx +113 -0
  290. package/src/ui/components/ActingAsBanner.tsx +2 -2
  291. package/src/ui/components/ProfileCard.tsx +1 -1
  292. package/src/ui/components/StepBasedScreen.tsx +1 -1
  293. package/src/ui/components/accountMenuRows.ts +60 -0
  294. package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
  295. package/src/ui/components/payment/PaymentMethodStep.tsx +1 -1
  296. package/src/ui/components/theming.tsx +1 -1
  297. package/src/ui/context/OxyContext.tsx +204 -18
  298. package/src/ui/context/hooks/useAuthOperations.ts +36 -2
  299. package/src/ui/hooks/mutations/mutationKeys.ts +11 -0
  300. package/src/ui/hooks/mutations/useAccountMutations.ts +154 -2
  301. package/src/ui/hooks/queries/queryKeys.ts +54 -4
  302. package/src/ui/hooks/queries/useAccountQueries.ts +25 -1
  303. package/src/ui/hooks/useAuth.ts +23 -4
  304. package/src/ui/hooks/useSessionManagement.ts +29 -0
  305. package/src/ui/index.ts +37 -98
  306. package/src/ui/navigation/routes.ts +9 -11
  307. package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
  308. package/src/ui/screens/ConnectedAppsScreen.tsx +225 -0
  309. package/src/ui/screens/CreateManagedAccountScreen.tsx +1 -1
  310. package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
  311. package/src/ui/screens/FAQScreen.tsx +3 -1
  312. package/src/ui/screens/FeedbackScreen.tsx +6 -10
  313. package/src/ui/screens/HelpSupportScreen.tsx +1 -1
  314. package/src/ui/screens/HistoryViewScreen.tsx +3 -1
  315. package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
  316. package/src/ui/screens/LegalDocumentsScreen.tsx +2 -1
  317. package/src/ui/screens/ManageAccountScreen.tsx +1102 -0
  318. package/src/ui/screens/NotificationsScreen.tsx +189 -0
  319. package/src/ui/screens/PaymentGatewayScreen.tsx +10 -12
  320. package/src/ui/screens/PreferencesScreen.tsx +263 -0
  321. package/src/ui/screens/PrivacySettingsScreen.tsx +4 -1
  322. package/src/ui/screens/ProfileScreen.tsx +2 -2
  323. package/src/ui/screens/SavesCollectionsScreen.tsx +3 -1
  324. package/src/ui/screens/SearchSettingsScreen.tsx +2 -1
  325. package/src/ui/screens/UserLinksScreen.tsx +1 -1
  326. package/src/ui/screens/UserListScreen.tsx +1 -1
  327. package/src/ui/screens/karma/KarmaAboutScreen.tsx +1 -1
  328. package/src/ui/screens/karma/KarmaFAQScreen.tsx +1 -1
  329. package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
  330. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +1 -1
  331. package/src/ui/screens/karma/KarmaRulesScreen.tsx +1 -1
  332. package/src/ui/utils/activeAuthuser.ts +78 -0
  333. package/lib/commonjs/ui/components/feedback/index.js +0 -54
  334. package/lib/commonjs/ui/components/feedback/index.js.map +0 -1
  335. package/lib/commonjs/ui/components/icon/index.js +0 -21
  336. package/lib/commonjs/ui/components/icon/index.js.map +0 -1
  337. package/lib/commonjs/ui/components/index.js +0 -104
  338. package/lib/commonjs/ui/components/index.js.map +0 -1
  339. package/lib/commonjs/ui/components/modals/index.js +0 -14
  340. package/lib/commonjs/ui/components/modals/index.js.map +0 -1
  341. package/lib/commonjs/ui/components/payment/index.js +0 -80
  342. package/lib/commonjs/ui/components/payment/index.js.map +0 -1
  343. package/lib/commonjs/ui/hooks/index.js +0 -92
  344. package/lib/commonjs/ui/hooks/index.js.map +0 -1
  345. package/lib/commonjs/ui/hooks/mutations/index.js +0 -68
  346. package/lib/commonjs/ui/hooks/mutations/index.js.map +0 -1
  347. package/lib/commonjs/ui/hooks/queries/index.js +0 -155
  348. package/lib/commonjs/ui/hooks/queries/index.js.map +0 -1
  349. package/lib/commonjs/ui/screens/AccountCenterScreen.js +0 -344
  350. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +0 -1
  351. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +0 -724
  352. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +0 -1
  353. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +0 -643
  354. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +0 -1
  355. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -1029
  356. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
  357. package/lib/commonjs/ui/screens/SessionManagementScreen.js +0 -512
  358. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +0 -1
  359. package/lib/commonjs/ui/styles/index.js +0 -39
  360. package/lib/commonjs/ui/styles/index.js.map +0 -1
  361. package/lib/module/ui/components/feedback/index.js +0 -8
  362. package/lib/module/ui/components/feedback/index.js.map +0 -1
  363. package/lib/module/ui/components/icon/index.js +0 -5
  364. package/lib/module/ui/components/icon/index.js.map +0 -1
  365. package/lib/module/ui/components/index.js +0 -18
  366. package/lib/module/ui/components/index.js.map +0 -1
  367. package/lib/module/ui/components/modals/index.js +0 -4
  368. package/lib/module/ui/components/modals/index.js.map +0 -1
  369. package/lib/module/ui/components/payment/index.js +0 -10
  370. package/lib/module/ui/components/payment/index.js.map +0 -1
  371. package/lib/module/ui/hooks/index.js +0 -11
  372. package/lib/module/ui/hooks/index.js.map +0 -1
  373. package/lib/module/ui/hooks/mutations/index.js +0 -15
  374. package/lib/module/ui/hooks/mutations/index.js.map +0 -1
  375. package/lib/module/ui/hooks/queries/index.js +0 -26
  376. package/lib/module/ui/hooks/queries/index.js.map +0 -1
  377. package/lib/module/ui/screens/AccountCenterScreen.js +0 -339
  378. package/lib/module/ui/screens/AccountCenterScreen.js.map +0 -1
  379. package/lib/module/ui/screens/AccountOverviewScreen.js +0 -719
  380. package/lib/module/ui/screens/AccountOverviewScreen.js.map +0 -1
  381. package/lib/module/ui/screens/AccountSettingsScreen.js +0 -638
  382. package/lib/module/ui/screens/AccountSettingsScreen.js.map +0 -1
  383. package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -1024
  384. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
  385. package/lib/module/ui/screens/SessionManagementScreen.js +0 -508
  386. package/lib/module/ui/screens/SessionManagementScreen.js.map +0 -1
  387. package/lib/module/ui/styles/index.js +0 -6
  388. package/lib/module/ui/styles/index.js.map +0 -1
  389. package/lib/typescript/commonjs/ui/components/feedback/index.d.ts +0 -7
  390. package/lib/typescript/commonjs/ui/components/feedback/index.d.ts.map +0 -1
  391. package/lib/typescript/commonjs/ui/components/icon/index.d.ts +0 -4
  392. package/lib/typescript/commonjs/ui/components/icon/index.d.ts.map +0 -1
  393. package/lib/typescript/commonjs/ui/components/index.d.ts +0 -13
  394. package/lib/typescript/commonjs/ui/components/index.d.ts.map +0 -1
  395. package/lib/typescript/commonjs/ui/components/modals/index.d.ts +0 -2
  396. package/lib/typescript/commonjs/ui/components/modals/index.d.ts.map +0 -1
  397. package/lib/typescript/commonjs/ui/components/payment/index.d.ts +0 -9
  398. package/lib/typescript/commonjs/ui/components/payment/index.d.ts.map +0 -1
  399. package/lib/typescript/commonjs/ui/hooks/index.d.ts +0 -9
  400. package/lib/typescript/commonjs/ui/hooks/index.d.ts.map +0 -1
  401. package/lib/typescript/commonjs/ui/hooks/mutations/index.d.ts +0 -9
  402. package/lib/typescript/commonjs/ui/hooks/mutations/index.d.ts.map +0 -1
  403. package/lib/typescript/commonjs/ui/hooks/queries/index.d.ts +0 -13
  404. package/lib/typescript/commonjs/ui/hooks/queries/index.d.ts.map +0 -1
  405. package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts +0 -5
  406. package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +0 -1
  407. package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +0 -1
  408. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +0 -1
  409. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -5
  410. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  411. package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts +0 -5
  412. package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +0 -1
  413. package/lib/typescript/commonjs/ui/styles/index.d.ts +0 -4
  414. package/lib/typescript/commonjs/ui/styles/index.d.ts.map +0 -1
  415. package/lib/typescript/module/ui/components/feedback/index.d.ts +0 -7
  416. package/lib/typescript/module/ui/components/feedback/index.d.ts.map +0 -1
  417. package/lib/typescript/module/ui/components/icon/index.d.ts +0 -4
  418. package/lib/typescript/module/ui/components/icon/index.d.ts.map +0 -1
  419. package/lib/typescript/module/ui/components/index.d.ts +0 -13
  420. package/lib/typescript/module/ui/components/index.d.ts.map +0 -1
  421. package/lib/typescript/module/ui/components/modals/index.d.ts +0 -2
  422. package/lib/typescript/module/ui/components/modals/index.d.ts.map +0 -1
  423. package/lib/typescript/module/ui/components/payment/index.d.ts +0 -9
  424. package/lib/typescript/module/ui/components/payment/index.d.ts.map +0 -1
  425. package/lib/typescript/module/ui/hooks/index.d.ts +0 -9
  426. package/lib/typescript/module/ui/hooks/index.d.ts.map +0 -1
  427. package/lib/typescript/module/ui/hooks/mutations/index.d.ts +0 -9
  428. package/lib/typescript/module/ui/hooks/mutations/index.d.ts.map +0 -1
  429. package/lib/typescript/module/ui/hooks/queries/index.d.ts +0 -13
  430. package/lib/typescript/module/ui/hooks/queries/index.d.ts.map +0 -1
  431. package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts +0 -5
  432. package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +0 -1
  433. package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +0 -1
  434. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +0 -1
  435. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -5
  436. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  437. package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts +0 -5
  438. package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +0 -1
  439. package/lib/typescript/module/ui/styles/index.d.ts +0 -4
  440. package/lib/typescript/module/ui/styles/index.d.ts.map +0 -1
  441. package/src/ui/components/feedback/index.ts +0 -6
  442. package/src/ui/components/icon/index.ts +0 -3
  443. package/src/ui/components/index.ts +0 -15
  444. package/src/ui/components/modals/index.ts +0 -1
  445. package/src/ui/components/payment/index.ts +0 -9
  446. package/src/ui/hooks/index.ts +0 -13
  447. package/src/ui/hooks/mutations/index.ts +0 -25
  448. package/src/ui/hooks/queries/index.ts +0 -61
  449. package/src/ui/screens/AccountCenterScreen.tsx +0 -182
  450. package/src/ui/screens/AccountOverviewScreen.tsx +0 -696
  451. package/src/ui/screens/AccountSettingsScreen.tsx +0 -620
  452. package/src/ui/screens/AccountSwitcherScreen.tsx +0 -1003
  453. package/src/ui/screens/SessionManagementScreen.tsx +0 -477
  454. package/src/ui/styles/index.ts +0 -3
@@ -0,0 +1,189 @@
1
+ import React, { useCallback, useMemo } from 'react';
2
+ import { View, StyleSheet, ScrollView } from 'react-native';
3
+ import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
4
+ import { Switch } from '@oxyhq/bloom/switch';
5
+ import { useTheme } from '@oxyhq/bloom/theme';
6
+ import type { NotificationPreferences } from '@oxyhq/core';
7
+ import type { BaseScreenProps } from '../types/navigation';
8
+ import Header from '../components/Header';
9
+ import { SettingsIcon } from '../components/SettingsIcon';
10
+ import { useI18n } from '../hooks/useI18n';
11
+ import { useOxy } from '../context/OxyContext';
12
+ import { useCurrentUser } from '../hooks/queries/useAccountQueries';
13
+ import { useUpdateNotificationPreferences } from '../hooks/mutations/useAccountMutations';
14
+ import { useSettingToggles } from '../hooks/useSettingToggle';
15
+ import { useColorScheme } from '../hooks/useColorScheme';
16
+ import { Colors } from '../constants/theme';
17
+ import { normalizeColorScheme, normalizeTheme } from '../utils/themeUtils';
18
+
19
+ interface NotificationToggleValues {
20
+ pushEnabled: boolean;
21
+ emailDigest: boolean;
22
+ securityAlerts: boolean;
23
+ marketingEmails: boolean;
24
+ }
25
+
26
+ const DEFAULT_VALUES: NotificationToggleValues = {
27
+ pushEnabled: true,
28
+ emailDigest: true,
29
+ securityAlerts: true,
30
+ marketingEmails: false,
31
+ };
32
+
33
+ /**
34
+ * NotificationsScreen — manage per-channel notification preferences.
35
+ *
36
+ * Persists every toggle change via `useUpdateNotificationPreferences`, which
37
+ * uses optimistic updates + offline-queue support. The initial values seed
38
+ * from the current user's `notificationPreferences` field, defaulting to the
39
+ * platform defaults when the field has never been set.
40
+ */
41
+ const NotificationsScreen: React.FC<BaseScreenProps> = ({ onClose, theme, goBack }) => {
42
+ const bloomTheme = useTheme();
43
+ const { t } = useI18n();
44
+ const colorScheme = useColorScheme();
45
+ const palette = useMemo(
46
+ () => Colors[normalizeColorScheme(colorScheme, normalizeTheme(theme))],
47
+ [colorScheme, theme],
48
+ );
49
+ const { isAuthenticated } = useOxy();
50
+ const { data: user } = useCurrentUser({ enabled: isAuthenticated });
51
+ const updateMutation = useUpdateNotificationPreferences();
52
+
53
+ const initialValues = useMemo<NotificationToggleValues>(() => {
54
+ const prefs = user?.notificationPreferences;
55
+ return {
56
+ pushEnabled: prefs?.pushEnabled ?? DEFAULT_VALUES.pushEnabled,
57
+ emailDigest: prefs?.emailDigest ?? DEFAULT_VALUES.emailDigest,
58
+ securityAlerts: prefs?.securityAlerts ?? DEFAULT_VALUES.securityAlerts,
59
+ marketingEmails: prefs?.marketingEmails ?? DEFAULT_VALUES.marketingEmails,
60
+ };
61
+ }, [user?.notificationPreferences]);
62
+
63
+ const handleSave = useCallback(
64
+ async (key: keyof NotificationToggleValues, value: boolean) => {
65
+ const patch: Partial<NotificationPreferences> = { [key]: value };
66
+ await updateMutation.mutateAsync(patch);
67
+ },
68
+ [updateMutation],
69
+ );
70
+
71
+ const { values, toggle, savingKeys } = useSettingToggles<NotificationToggleValues>({
72
+ initialValues,
73
+ onSave: handleSave,
74
+ errorMessage: t('notifications.updateError') || 'Failed to update notification preferences',
75
+ });
76
+
77
+ const isSaving = savingKeys.size > 0;
78
+
79
+ return (
80
+ <View style={[styles.container, { backgroundColor: bloomTheme.colors.background }]}>
81
+ <Header
82
+ title={t('notifications.title') || 'Notifications'}
83
+ onBack={goBack || onClose}
84
+ variant="minimal"
85
+ elevation="subtle"
86
+ />
87
+ <ScrollView style={styles.scroll} contentContainerStyle={styles.scrollContent}>
88
+ <SettingsListGroup
89
+ title={t('notifications.sections.channels') || 'Channels'}
90
+ >
91
+ <SettingsListItem
92
+ icon={<SettingsIcon name="bell" color={palette.iconPersonalInfo} />}
93
+ title={t('notifications.items.push.title') || 'Push notifications'}
94
+ description={
95
+ t('notifications.items.push.subtitle')
96
+ || 'Real-time alerts on your devices'
97
+ }
98
+ rightElement={
99
+ <Switch
100
+ value={values.pushEnabled}
101
+ onValueChange={() => toggle('pushEnabled')}
102
+ disabled={isSaving}
103
+ />
104
+ }
105
+ showChevron={false}
106
+ />
107
+ <SettingsListItem
108
+ icon={<SettingsIcon name="email" color={palette.iconData} />}
109
+ title={t('notifications.items.emailDigest.title') || 'Email digest'}
110
+ description={
111
+ t('notifications.items.emailDigest.subtitle')
112
+ || 'Periodic summary of your account activity'
113
+ }
114
+ rightElement={
115
+ <Switch
116
+ value={values.emailDigest}
117
+ onValueChange={() => toggle('emailDigest')}
118
+ disabled={isSaving}
119
+ />
120
+ }
121
+ showChevron={false}
122
+ />
123
+ </SettingsListGroup>
124
+
125
+ <SettingsListGroup
126
+ title={t('notifications.sections.alerts') || 'Alerts'}
127
+ >
128
+ <SettingsListItem
129
+ icon={<SettingsIcon name="shield-check" color={palette.iconSecurity} />}
130
+ title={
131
+ t('notifications.items.securityAlerts.title') || 'Security alerts'
132
+ }
133
+ description={
134
+ t('notifications.items.securityAlerts.subtitle')
135
+ || 'Sign-ins, recovery codes, and key changes'
136
+ }
137
+ rightElement={
138
+ <Switch
139
+ value={values.securityAlerts}
140
+ onValueChange={() => toggle('securityAlerts')}
141
+ disabled={isSaving}
142
+ />
143
+ }
144
+ showChevron={false}
145
+ />
146
+ </SettingsListGroup>
147
+
148
+ <SettingsListGroup
149
+ title={t('notifications.sections.marketing') || 'Marketing'}
150
+ >
151
+ <SettingsListItem
152
+ icon={<SettingsIcon name="megaphone" color={palette.iconSharing} />}
153
+ title={
154
+ t('notifications.items.marketingEmails.title')
155
+ || 'Marketing emails'
156
+ }
157
+ description={
158
+ t('notifications.items.marketingEmails.subtitle')
159
+ || 'Product news and occasional offers'
160
+ }
161
+ rightElement={
162
+ <Switch
163
+ value={values.marketingEmails}
164
+ onValueChange={() => toggle('marketingEmails')}
165
+ disabled={isSaving}
166
+ />
167
+ }
168
+ showChevron={false}
169
+ />
170
+ </SettingsListGroup>
171
+ </ScrollView>
172
+ </View>
173
+ );
174
+ };
175
+
176
+ const styles = StyleSheet.create({
177
+ container: {
178
+ flex: 1,
179
+ },
180
+ scroll: {
181
+ flex: 1,
182
+ },
183
+ scrollContent: {
184
+ paddingHorizontal: 16,
185
+ paddingBottom: 24,
186
+ },
187
+ });
188
+
189
+ export default React.memo(NotificationsScreen);
@@ -9,23 +9,21 @@ import {
9
9
  useWindowDimensions,
10
10
  } from 'react-native';
11
11
  import type { BaseScreenProps } from '../types/navigation';
12
- import { useThemeColors } from '../styles';
12
+ import { useThemeColors } from '../styles/theme';
13
13
  import { normalizeTheme } from '../utils/themeUtils';
14
14
  import { Button } from '@oxyhq/bloom/button';
15
15
  import { Ionicons } from '@expo/vector-icons';
16
16
  import { useI18n } from '../hooks/useI18n';
17
17
  import QRCode from 'react-native-qrcode-svg';
18
18
 
19
- import {
20
- PaymentSummaryStep,
21
- PaymentMethodStep,
22
- PaymentDetailsStep,
23
- PaymentReviewStep,
24
- PaymentSuccessStep,
25
- PAYMENT_METHODS,
26
- createPaymentStyles,
27
- } from '../components/payment';
28
- import type { PaymentItem, PaymentGatewayResult, CardDetails } from '../components/payment';
19
+ import PaymentSummaryStep from '../components/payment/PaymentSummaryStep';
20
+ import PaymentMethodStep from '../components/payment/PaymentMethodStep';
21
+ import PaymentDetailsStep from '../components/payment/PaymentDetailsStep';
22
+ import PaymentReviewStep from '../components/payment/PaymentReviewStep';
23
+ import PaymentSuccessStep from '../components/payment/PaymentSuccessStep';
24
+ import { PAYMENT_METHODS } from '../components/payment/constants';
25
+ import { createPaymentStyles } from '../components/payment/paymentStyles';
26
+ import type { PaymentItem, PaymentGatewayResult, CardDetails } from '../components/payment/types';
29
27
 
30
28
  export type { PaymentItem, PaymentGatewayResult };
31
29
 
@@ -166,7 +164,7 @@ const PaymentGatewayScreen: React.FC<PaymentGatewayScreenProps> = (props) => {
166
164
  if (onPaymentResult) {
167
165
  onPaymentResult({ success: true });
168
166
  }
169
- navigate?.('AccountOverview');
167
+ navigate?.('ManageAccount');
170
168
  }, [onPaymentResult, navigate]);
171
169
 
172
170
  const handleClose = useCallback(() => {
@@ -0,0 +1,263 @@
1
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
+ import { AccessibilityInfo, Platform, StyleSheet, View, ScrollView } from 'react-native';
3
+ import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
4
+ import { Switch } from '@oxyhq/bloom/switch';
5
+ import { useTheme } from '@oxyhq/bloom/theme';
6
+ import type { UserPreferences } from '@oxyhq/core';
7
+ import type { BaseScreenProps } from '../types/navigation';
8
+ import Header from '../components/Header';
9
+ import { SettingsIcon } from '../components/SettingsIcon';
10
+ import { useI18n } from '../hooks/useI18n';
11
+ import { useOxy } from '../context/OxyContext';
12
+ import { useCurrentUser } from '../hooks/queries/useAccountQueries';
13
+ import { useUpdateUserPreferences } from '../hooks/mutations/useAccountMutations';
14
+ import { useColorScheme } from '../hooks/useColorScheme';
15
+ import { Colors } from '../constants/theme';
16
+ import { normalizeColorScheme, normalizeTheme } from '../utils/themeUtils';
17
+
18
+ type ThemePreference = 'light' | 'dark' | 'system';
19
+
20
+ const THEME_ORDER: ThemePreference[] = ['system', 'light', 'dark'];
21
+
22
+ /**
23
+ * Resolve the device's timezone using `Intl.DateTimeFormat`. Available on
24
+ * every Hermes/JSC build we support; no `expo-localization` native module
25
+ * needed.
26
+ */
27
+ const getDeviceTimezone = (): string => {
28
+ try {
29
+ return Intl.DateTimeFormat().resolvedOptions().timeZone || '';
30
+ } catch {
31
+ return '';
32
+ }
33
+ };
34
+
35
+ /**
36
+ * PreferencesScreen — general user preferences applied across all Oxy apps.
37
+ *
38
+ * Language is delegated to the existing LanguageSelector screen. Theme,
39
+ * reduce-motion, and timezone are persisted on the User document via
40
+ * `useUpdateUserPreferences` so every Oxy app sees the same setting.
41
+ */
42
+ const PreferencesScreen: React.FC<BaseScreenProps> = ({
43
+ onClose,
44
+ theme,
45
+ goBack,
46
+ navigate,
47
+ }) => {
48
+ const bloomTheme = useTheme();
49
+ const { t, locale } = useI18n();
50
+ const colorScheme = useColorScheme();
51
+ const palette = useMemo(
52
+ () => Colors[normalizeColorScheme(colorScheme, normalizeTheme(theme))],
53
+ [colorScheme, theme],
54
+ );
55
+ const { isAuthenticated } = useOxy();
56
+ const { data: user } = useCurrentUser({ enabled: isAuthenticated });
57
+ const updateMutation = useUpdateUserPreferences();
58
+
59
+ const prefs = user?.userPreferences;
60
+ const themePref: ThemePreference = (prefs?.theme as ThemePreference) ?? 'system';
61
+ const reduceMotionPref = prefs?.reduceMotion ?? false;
62
+ const deviceTimezone = useMemo(getDeviceTimezone, []);
63
+ const timezone = prefs?.timezone || deviceTimezone;
64
+
65
+ // Mirror the OS reduce-motion state on first mount so users can see whether
66
+ // the device itself is in reduced-motion mode (independent of their saved
67
+ // server preference). Persists into the saved value when toggled.
68
+ const [systemReduceMotion, setSystemReduceMotion] = useState<boolean>(false);
69
+ useEffect(() => {
70
+ let cancelled = false;
71
+ AccessibilityInfo.isReduceMotionEnabled()
72
+ .then((value) => {
73
+ if (!cancelled) {
74
+ setSystemReduceMotion(value);
75
+ }
76
+ })
77
+ .catch(() => {
78
+ // AccessibilityInfo not available on this platform — keep default
79
+ });
80
+ const sub = AccessibilityInfo.addEventListener(
81
+ 'reduceMotionChanged',
82
+ (value) => setSystemReduceMotion(value),
83
+ );
84
+ return () => {
85
+ cancelled = true;
86
+ sub.remove();
87
+ };
88
+ }, []);
89
+
90
+ const handleThemeChange = useCallback(
91
+ async (nextTheme: ThemePreference) => {
92
+ const patch: Partial<UserPreferences> = { theme: nextTheme };
93
+ await updateMutation.mutateAsync(patch);
94
+ },
95
+ [updateMutation],
96
+ );
97
+
98
+ const handleReduceMotionToggle = useCallback(async () => {
99
+ const next = !reduceMotionPref;
100
+ const patch: Partial<UserPreferences> = { reduceMotion: next };
101
+ await updateMutation.mutateAsync(patch);
102
+ }, [reduceMotionPref, updateMutation]);
103
+
104
+ const handleResetTimezone = useCallback(async () => {
105
+ // Empty string means "follow device" — server-side default
106
+ const patch: Partial<UserPreferences> = { timezone: '' };
107
+ await updateMutation.mutateAsync(patch);
108
+ }, [updateMutation]);
109
+
110
+ const themeDisplay = useMemo(() => {
111
+ switch (themePref) {
112
+ case 'light':
113
+ return t('preferences.theme.light') || 'Light';
114
+ case 'dark':
115
+ return t('preferences.theme.dark') || 'Dark';
116
+ default:
117
+ return t('preferences.theme.system') || 'System default';
118
+ }
119
+ }, [themePref, t]);
120
+
121
+ const nextTheme: ThemePreference =
122
+ THEME_ORDER[(THEME_ORDER.indexOf(themePref) + 1) % THEME_ORDER.length] ?? 'system';
123
+
124
+ const languageDescription = useMemo(() => {
125
+ if (prefs?.language) {
126
+ return prefs.language;
127
+ }
128
+ return locale;
129
+ }, [prefs?.language, locale]);
130
+
131
+ const isSaving = updateMutation.isPending;
132
+
133
+ return (
134
+ <View style={[styles.container, { backgroundColor: bloomTheme.colors.background }]}>
135
+ <Header
136
+ title={t('preferences.title') || 'Preferences'}
137
+ onBack={goBack || onClose}
138
+ variant="minimal"
139
+ elevation="subtle"
140
+ />
141
+ <ScrollView style={styles.scroll} contentContainerStyle={styles.scrollContent}>
142
+ <SettingsListGroup
143
+ title={t('preferences.sections.appearance') || 'Appearance'}
144
+ >
145
+ <SettingsListItem
146
+ icon={
147
+ <SettingsIcon
148
+ name="theme-light-dark"
149
+ color={palette.iconData}
150
+ />
151
+ }
152
+ title={t('preferences.items.theme.title') || 'Theme'}
153
+ description={themeDisplay}
154
+ onPress={() => handleThemeChange(nextTheme)}
155
+ disabled={isSaving}
156
+ />
157
+ <SettingsListItem
158
+ icon={
159
+ <SettingsIcon
160
+ name="motion"
161
+ color={palette.iconPersonalInfo}
162
+ />
163
+ }
164
+ title={
165
+ t('preferences.items.reduceMotion.title') || 'Reduce motion'
166
+ }
167
+ description={
168
+ systemReduceMotion
169
+ ? (t('preferences.items.reduceMotion.systemOn')
170
+ || 'Following system: reduce motion is on')
171
+ : (t('preferences.items.reduceMotion.subtitle')
172
+ || 'Minimise animations across Oxy apps')
173
+ }
174
+ rightElement={
175
+ <Switch
176
+ value={reduceMotionPref}
177
+ onValueChange={handleReduceMotionToggle}
178
+ disabled={isSaving}
179
+ />
180
+ }
181
+ showChevron={false}
182
+ />
183
+ </SettingsListGroup>
184
+
185
+ <SettingsListGroup
186
+ title={t('preferences.sections.language') || 'Language'}
187
+ >
188
+ <SettingsListItem
189
+ icon={
190
+ <SettingsIcon
191
+ name="translate"
192
+ color={palette.iconPersonalInfo}
193
+ />
194
+ }
195
+ title={t('preferences.items.language.title') || 'Language'}
196
+ description={languageDescription}
197
+ onPress={() => navigate?.('LanguageSelector')}
198
+ />
199
+ </SettingsListGroup>
200
+
201
+ <SettingsListGroup
202
+ title={t('preferences.sections.region') || 'Region'}
203
+ >
204
+ <SettingsListItem
205
+ icon={
206
+ <SettingsIcon
207
+ name="clock-outline"
208
+ color={palette.iconSecurity}
209
+ />
210
+ }
211
+ title={t('preferences.items.timezone.title') || 'Timezone'}
212
+ description={
213
+ timezone
214
+ || (t('preferences.items.timezone.unknown')
215
+ || 'Unable to detect timezone')
216
+ }
217
+ onPress={prefs?.timezone ? handleResetTimezone : undefined}
218
+ disabled={isSaving || !prefs?.timezone}
219
+ showChevron={false}
220
+ />
221
+ </SettingsListGroup>
222
+
223
+ {Platform.OS === 'web' ? null : (
224
+ <SettingsListGroup>
225
+ <SettingsListItem
226
+ icon={
227
+ <SettingsIcon
228
+ name="information"
229
+ color={palette.iconHome}
230
+ />
231
+ }
232
+ title={
233
+ t('preferences.items.about.title')
234
+ || 'About preferences'
235
+ }
236
+ description={
237
+ t('preferences.items.about.subtitle')
238
+ || 'Preferences sync across every Oxy app you sign into'
239
+ }
240
+ showChevron={false}
241
+ disabled
242
+ />
243
+ </SettingsListGroup>
244
+ )}
245
+ </ScrollView>
246
+ </View>
247
+ );
248
+ };
249
+
250
+ const styles = StyleSheet.create({
251
+ container: {
252
+ flex: 1,
253
+ },
254
+ scroll: {
255
+ flex: 1,
256
+ },
257
+ scrollContent: {
258
+ paddingHorizontal: 16,
259
+ paddingBottom: 24,
260
+ },
261
+ });
262
+
263
+ export default React.memo(PreferencesScreen);
@@ -8,7 +8,10 @@ import {
8
8
  } from 'react-native';
9
9
  import type { BaseScreenProps } from '../types/navigation';
10
10
  import { toast } from '@oxyhq/bloom';
11
- import { Header, Avatar, LoadingState, EmptyState } from '../components';
11
+ import Header from '../components/Header';
12
+ import Avatar from '../components/Avatar';
13
+ import LoadingState from '../components/LoadingState';
14
+ import EmptyState from '../components/EmptyState';
12
15
  import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
13
16
  import { Switch } from '@oxyhq/bloom/switch';
14
17
  import { useI18n } from '../hooks/useI18n';
@@ -4,7 +4,7 @@ import { View, Text, StyleSheet, ActivityIndicator, ScrollView, TouchableOpacity
4
4
  import type { BaseScreenProps } from '../types/navigation';
5
5
  import { useTheme } from '@oxyhq/bloom/theme';
6
6
  import Avatar from '../components/Avatar';
7
- import { FollowButton } from '../components';
7
+ import FollowButton from '../components/FollowButton';
8
8
  import { useFollow } from '../hooks/useFollow';
9
9
  import { Ionicons } from '@expo/vector-icons';
10
10
  import { useI18n } from '../hooks/useI18n';
@@ -227,7 +227,7 @@ const ProfileScreen: React.FC<ProfileScreenProps> = ({ userId, username, theme,
227
227
  <TouchableOpacity
228
228
  style={styles.actionButton}
229
229
  className="bg-background border-primary"
230
- onPress={() => navigate?.('AccountSettings')}
230
+ onPress={() => navigate?.('ManageAccount')}
231
231
  >
232
232
  <Text style={styles.actionButtonText} className="text-primary">{t('editProfile.title') || 'Edit Profile'}</Text>
233
233
  </TouchableOpacity>
@@ -8,7 +8,9 @@ import {
8
8
  } from 'react-native';
9
9
  import type { BaseScreenProps } from '../types/navigation';
10
10
  import { toast } from '@oxyhq/bloom';
11
- import { Header, LoadingState, EmptyState } from '../components';
11
+ import Header from '../components/Header';
12
+ import LoadingState from '../components/LoadingState';
13
+ import EmptyState from '../components/EmptyState';
12
14
  import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
13
15
  import { SettingsIcon } from '../components/SettingsIcon';
14
16
  import { useI18n } from '../hooks/useI18n';
@@ -5,7 +5,8 @@ import {
5
5
  ScrollView,
6
6
  } from 'react-native';
7
7
  import type { BaseScreenProps } from '../types/navigation';
8
- import { Header, LoadingState } from '../components';
8
+ import Header from '../components/Header';
9
+ import LoadingState from '../components/LoadingState';
9
10
  import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
10
11
  import { Switch } from '@oxyhq/bloom/switch';
11
12
  import { useI18n } from '../hooks/useI18n';
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
2
  import { View, StyleSheet, ScrollView, Linking } from 'react-native';
3
3
  import type { BaseScreenProps } from '../types/navigation';
4
- import { Header } from '../components';
4
+ import Header from '../components/Header';
5
5
  import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
6
6
  import { SettingsIcon } from '../components/SettingsIcon';
7
7
  import { useTheme } from '@oxyhq/bloom/theme';
@@ -12,7 +12,7 @@ import {
12
12
  import type { BaseScreenProps } from '../types/navigation';
13
13
  import { useTheme } from '@oxyhq/bloom/theme';
14
14
  import Avatar from '../components/Avatar';
15
- import { FollowButton } from '../components';
15
+ import FollowButton from '../components/FollowButton';
16
16
  import { Ionicons } from '@expo/vector-icons';
17
17
  import { useI18n } from '../hooks/useI18n';
18
18
  import { useOxy } from '../context/OxyContext';
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
2
  import { View, Text, StyleSheet, ScrollView, Platform } from 'react-native';
3
3
  import type { BaseScreenProps } from '../../types/navigation';
4
- import { Header } from '../../components';
4
+ import Header from '../../components/Header';
5
5
  import { useI18n } from '../../hooks/useI18n';
6
6
  import { useTheme } from '@oxyhq/bloom/theme';
7
7
 
@@ -2,7 +2,7 @@ import React, { useState, useMemo, useCallback } from 'react';
2
2
  import { View, Text, StyleSheet, ScrollView, Platform, TextInput, LayoutAnimation } from 'react-native';
3
3
  import type { BaseScreenProps } from '../../types/navigation';
4
4
  import { Ionicons } from '@expo/vector-icons';
5
- import { Header } from '../../components';
5
+ import Header from '../../components/Header';
6
6
  import { SettingsListItem } from '@oxyhq/bloom/settings-list';
7
7
  import { useI18n } from '../../hooks/useI18n';
8
8
  import { useTheme } from '@oxyhq/bloom/theme';
@@ -3,7 +3,7 @@ import { useEffect, useState } from 'react';
3
3
  import { View, Text, StyleSheet, ScrollView, ActivityIndicator, TouchableOpacity } from 'react-native';
4
4
  import type { BaseScreenProps } from '../../types/navigation';
5
5
  import Avatar from '../../components/Avatar';
6
- import { Header } from '../../components';
6
+ import Header from '../../components/Header';
7
7
  import { useI18n } from '../../hooks/useI18n';
8
8
  import { useTheme } from '@oxyhq/bloom/theme';
9
9
  import { useOxy } from '../../context/OxyContext';
@@ -2,7 +2,7 @@ import type React from 'react';
2
2
  import { useMemo, useState, useEffect } from 'react';
3
3
  import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Platform } from 'react-native';
4
4
  import type { BaseScreenProps } from '../../types/navigation';
5
- import { Header } from '../../components';
5
+ import Header from '../../components/Header';
6
6
  import { Ionicons } from '@expo/vector-icons';
7
7
  import { useI18n } from '../../hooks/useI18n';
8
8
  import { useTheme } from '@oxyhq/bloom/theme';
@@ -2,7 +2,7 @@ import type React from 'react';
2
2
  import { useEffect, useState } from 'react';
3
3
  import { View, Text, StyleSheet, ScrollView, ActivityIndicator } from 'react-native';
4
4
  import type { BaseScreenProps } from '../../types/navigation';
5
- import { Header } from '../../components';
5
+ import Header from '../../components/Header';
6
6
  import { useI18n } from '../../hooks/useI18n';
7
7
  import { useTheme } from '@oxyhq/bloom/theme';
8
8
  import { useOxy } from '../../context/OxyContext';