@oxyhq/services 6.10.8 → 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 (450) 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 +59 -131
  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 +59 -131
  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/useAuth.d.ts +8 -2
  210. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  211. package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
  212. package/lib/typescript/commonjs/ui/index.d.ts +32 -18
  213. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  214. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  215. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  216. package/lib/typescript/{module/ui/screens/AccountOverviewScreen.d.ts → commonjs/ui/screens/ConnectedAppsScreen.d.ts} +1 -1
  217. package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -0
  218. package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
  219. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
  220. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  221. package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  222. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +13 -0
  223. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -0
  224. package/lib/typescript/commonjs/ui/screens/{AccountOverviewScreen.d.ts → NotificationsScreen.d.ts} +1 -1
  225. package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -0
  226. package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts +1 -1
  227. package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  228. package/lib/typescript/commonjs/ui/screens/{AccountSettingsScreen.d.ts → PreferencesScreen.d.ts} +2 -5
  229. package/lib/typescript/commonjs/ui/screens/PreferencesScreen.d.ts.map +1 -0
  230. package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  231. package/lib/typescript/commonjs/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  232. package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts +42 -0
  234. package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts.map +1 -0
  235. package/lib/typescript/module/index.d.ts +23 -6
  236. package/lib/typescript/module/index.d.ts.map +1 -1
  237. package/lib/typescript/module/ui/client.d.ts +7 -2
  238. package/lib/typescript/module/ui/client.d.ts.map +1 -1
  239. package/lib/typescript/module/ui/components/AccountMenu.d.ts +23 -0
  240. package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +1 -0
  241. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +19 -0
  242. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +1 -0
  243. package/lib/typescript/module/ui/components/accountMenuRows.d.ts +27 -0
  244. package/lib/typescript/module/ui/components/accountMenuRows.d.ts.map +1 -0
  245. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  246. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  247. package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts +5 -0
  248. package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts.map +1 -1
  249. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +26 -1
  250. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  251. package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +32 -3
  252. package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
  253. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +10 -1
  254. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  255. package/lib/typescript/module/ui/hooks/useAuth.d.ts +8 -2
  256. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  257. package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
  258. package/lib/typescript/module/ui/index.d.ts +32 -18
  259. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  260. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  261. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  262. package/lib/typescript/module/ui/screens/{AccountSettingsScreen.d.ts → ConnectedAppsScreen.d.ts} +2 -5
  263. package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -0
  264. package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
  265. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
  266. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  267. package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  268. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +13 -0
  269. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -0
  270. package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts +5 -0
  271. package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -0
  272. package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts +1 -1
  273. package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  274. package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts +5 -0
  275. package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -0
  276. package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  277. package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  278. package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  279. package/lib/typescript/module/ui/utils/activeAuthuser.d.ts +42 -0
  280. package/lib/typescript/module/ui/utils/activeAuthuser.d.ts.map +1 -0
  281. package/package.json +20 -9
  282. package/src/index.ts +141 -47
  283. package/src/ui/client.ts +7 -2
  284. package/src/ui/components/AccountMenu.tsx +534 -0
  285. package/src/ui/components/AccountMenuButton.tsx +113 -0
  286. package/src/ui/components/ActingAsBanner.tsx +2 -2
  287. package/src/ui/components/ProfileCard.tsx +1 -1
  288. package/src/ui/components/StepBasedScreen.tsx +1 -1
  289. package/src/ui/components/accountMenuRows.ts +60 -0
  290. package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
  291. package/src/ui/components/payment/PaymentMethodStep.tsx +1 -1
  292. package/src/ui/components/theming.tsx +1 -1
  293. package/src/ui/context/OxyContext.tsx +61 -145
  294. package/src/ui/context/hooks/useAuthOperations.ts +36 -2
  295. package/src/ui/hooks/mutations/mutationKeys.ts +11 -0
  296. package/src/ui/hooks/mutations/useAccountMutations.ts +154 -2
  297. package/src/ui/hooks/queries/queryKeys.ts +54 -4
  298. package/src/ui/hooks/queries/useAccountQueries.ts +25 -1
  299. package/src/ui/hooks/useAuth.ts +23 -4
  300. package/src/ui/hooks/useSessionManagement.ts +29 -0
  301. package/src/ui/index.ts +37 -98
  302. package/src/ui/navigation/routes.ts +9 -11
  303. package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
  304. package/src/ui/screens/ConnectedAppsScreen.tsx +225 -0
  305. package/src/ui/screens/CreateManagedAccountScreen.tsx +1 -1
  306. package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
  307. package/src/ui/screens/FAQScreen.tsx +3 -1
  308. package/src/ui/screens/FeedbackScreen.tsx +6 -10
  309. package/src/ui/screens/HelpSupportScreen.tsx +1 -1
  310. package/src/ui/screens/HistoryViewScreen.tsx +3 -1
  311. package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
  312. package/src/ui/screens/LegalDocumentsScreen.tsx +2 -1
  313. package/src/ui/screens/ManageAccountScreen.tsx +1102 -0
  314. package/src/ui/screens/NotificationsScreen.tsx +189 -0
  315. package/src/ui/screens/PaymentGatewayScreen.tsx +10 -12
  316. package/src/ui/screens/PreferencesScreen.tsx +263 -0
  317. package/src/ui/screens/PrivacySettingsScreen.tsx +4 -1
  318. package/src/ui/screens/ProfileScreen.tsx +2 -2
  319. package/src/ui/screens/SavesCollectionsScreen.tsx +3 -1
  320. package/src/ui/screens/SearchSettingsScreen.tsx +2 -1
  321. package/src/ui/screens/UserLinksScreen.tsx +1 -1
  322. package/src/ui/screens/UserListScreen.tsx +1 -1
  323. package/src/ui/screens/karma/KarmaAboutScreen.tsx +1 -1
  324. package/src/ui/screens/karma/KarmaFAQScreen.tsx +1 -1
  325. package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
  326. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +1 -1
  327. package/src/ui/screens/karma/KarmaRulesScreen.tsx +1 -1
  328. package/src/ui/utils/activeAuthuser.ts +78 -0
  329. package/lib/commonjs/ui/components/feedback/index.js +0 -54
  330. package/lib/commonjs/ui/components/feedback/index.js.map +0 -1
  331. package/lib/commonjs/ui/components/icon/index.js +0 -21
  332. package/lib/commonjs/ui/components/icon/index.js.map +0 -1
  333. package/lib/commonjs/ui/components/index.js +0 -104
  334. package/lib/commonjs/ui/components/index.js.map +0 -1
  335. package/lib/commonjs/ui/components/modals/index.js +0 -14
  336. package/lib/commonjs/ui/components/modals/index.js.map +0 -1
  337. package/lib/commonjs/ui/components/payment/index.js +0 -80
  338. package/lib/commonjs/ui/components/payment/index.js.map +0 -1
  339. package/lib/commonjs/ui/hooks/index.js +0 -92
  340. package/lib/commonjs/ui/hooks/index.js.map +0 -1
  341. package/lib/commonjs/ui/hooks/mutations/index.js +0 -68
  342. package/lib/commonjs/ui/hooks/mutations/index.js.map +0 -1
  343. package/lib/commonjs/ui/hooks/queries/index.js +0 -155
  344. package/lib/commonjs/ui/hooks/queries/index.js.map +0 -1
  345. package/lib/commonjs/ui/screens/AccountCenterScreen.js +0 -344
  346. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +0 -1
  347. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +0 -724
  348. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +0 -1
  349. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +0 -643
  350. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +0 -1
  351. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -1029
  352. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
  353. package/lib/commonjs/ui/screens/SessionManagementScreen.js +0 -512
  354. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +0 -1
  355. package/lib/commonjs/ui/styles/index.js +0 -39
  356. package/lib/commonjs/ui/styles/index.js.map +0 -1
  357. package/lib/module/ui/components/feedback/index.js +0 -8
  358. package/lib/module/ui/components/feedback/index.js.map +0 -1
  359. package/lib/module/ui/components/icon/index.js +0 -5
  360. package/lib/module/ui/components/icon/index.js.map +0 -1
  361. package/lib/module/ui/components/index.js +0 -18
  362. package/lib/module/ui/components/index.js.map +0 -1
  363. package/lib/module/ui/components/modals/index.js +0 -4
  364. package/lib/module/ui/components/modals/index.js.map +0 -1
  365. package/lib/module/ui/components/payment/index.js +0 -10
  366. package/lib/module/ui/components/payment/index.js.map +0 -1
  367. package/lib/module/ui/hooks/index.js +0 -11
  368. package/lib/module/ui/hooks/index.js.map +0 -1
  369. package/lib/module/ui/hooks/mutations/index.js +0 -15
  370. package/lib/module/ui/hooks/mutations/index.js.map +0 -1
  371. package/lib/module/ui/hooks/queries/index.js +0 -26
  372. package/lib/module/ui/hooks/queries/index.js.map +0 -1
  373. package/lib/module/ui/screens/AccountCenterScreen.js +0 -339
  374. package/lib/module/ui/screens/AccountCenterScreen.js.map +0 -1
  375. package/lib/module/ui/screens/AccountOverviewScreen.js +0 -719
  376. package/lib/module/ui/screens/AccountOverviewScreen.js.map +0 -1
  377. package/lib/module/ui/screens/AccountSettingsScreen.js +0 -638
  378. package/lib/module/ui/screens/AccountSettingsScreen.js.map +0 -1
  379. package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -1024
  380. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
  381. package/lib/module/ui/screens/SessionManagementScreen.js +0 -508
  382. package/lib/module/ui/screens/SessionManagementScreen.js.map +0 -1
  383. package/lib/module/ui/styles/index.js +0 -6
  384. package/lib/module/ui/styles/index.js.map +0 -1
  385. package/lib/typescript/commonjs/ui/components/feedback/index.d.ts +0 -7
  386. package/lib/typescript/commonjs/ui/components/feedback/index.d.ts.map +0 -1
  387. package/lib/typescript/commonjs/ui/components/icon/index.d.ts +0 -4
  388. package/lib/typescript/commonjs/ui/components/icon/index.d.ts.map +0 -1
  389. package/lib/typescript/commonjs/ui/components/index.d.ts +0 -13
  390. package/lib/typescript/commonjs/ui/components/index.d.ts.map +0 -1
  391. package/lib/typescript/commonjs/ui/components/modals/index.d.ts +0 -2
  392. package/lib/typescript/commonjs/ui/components/modals/index.d.ts.map +0 -1
  393. package/lib/typescript/commonjs/ui/components/payment/index.d.ts +0 -9
  394. package/lib/typescript/commonjs/ui/components/payment/index.d.ts.map +0 -1
  395. package/lib/typescript/commonjs/ui/hooks/index.d.ts +0 -9
  396. package/lib/typescript/commonjs/ui/hooks/index.d.ts.map +0 -1
  397. package/lib/typescript/commonjs/ui/hooks/mutations/index.d.ts +0 -9
  398. package/lib/typescript/commonjs/ui/hooks/mutations/index.d.ts.map +0 -1
  399. package/lib/typescript/commonjs/ui/hooks/queries/index.d.ts +0 -13
  400. package/lib/typescript/commonjs/ui/hooks/queries/index.d.ts.map +0 -1
  401. package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts +0 -5
  402. package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +0 -1
  403. package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +0 -1
  404. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +0 -1
  405. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -5
  406. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  407. package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts +0 -5
  408. package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +0 -1
  409. package/lib/typescript/commonjs/ui/styles/index.d.ts +0 -4
  410. package/lib/typescript/commonjs/ui/styles/index.d.ts.map +0 -1
  411. package/lib/typescript/module/ui/components/feedback/index.d.ts +0 -7
  412. package/lib/typescript/module/ui/components/feedback/index.d.ts.map +0 -1
  413. package/lib/typescript/module/ui/components/icon/index.d.ts +0 -4
  414. package/lib/typescript/module/ui/components/icon/index.d.ts.map +0 -1
  415. package/lib/typescript/module/ui/components/index.d.ts +0 -13
  416. package/lib/typescript/module/ui/components/index.d.ts.map +0 -1
  417. package/lib/typescript/module/ui/components/modals/index.d.ts +0 -2
  418. package/lib/typescript/module/ui/components/modals/index.d.ts.map +0 -1
  419. package/lib/typescript/module/ui/components/payment/index.d.ts +0 -9
  420. package/lib/typescript/module/ui/components/payment/index.d.ts.map +0 -1
  421. package/lib/typescript/module/ui/hooks/index.d.ts +0 -9
  422. package/lib/typescript/module/ui/hooks/index.d.ts.map +0 -1
  423. package/lib/typescript/module/ui/hooks/mutations/index.d.ts +0 -9
  424. package/lib/typescript/module/ui/hooks/mutations/index.d.ts.map +0 -1
  425. package/lib/typescript/module/ui/hooks/queries/index.d.ts +0 -13
  426. package/lib/typescript/module/ui/hooks/queries/index.d.ts.map +0 -1
  427. package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts +0 -5
  428. package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +0 -1
  429. package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +0 -1
  430. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +0 -1
  431. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -5
  432. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  433. package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts +0 -5
  434. package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +0 -1
  435. package/lib/typescript/module/ui/styles/index.d.ts +0 -4
  436. package/lib/typescript/module/ui/styles/index.d.ts.map +0 -1
  437. package/src/ui/components/feedback/index.ts +0 -6
  438. package/src/ui/components/icon/index.ts +0 -3
  439. package/src/ui/components/index.ts +0 -15
  440. package/src/ui/components/modals/index.ts +0 -1
  441. package/src/ui/components/payment/index.ts +0 -9
  442. package/src/ui/hooks/index.ts +0 -13
  443. package/src/ui/hooks/mutations/index.ts +0 -25
  444. package/src/ui/hooks/queries/index.ts +0 -61
  445. package/src/ui/screens/AccountCenterScreen.tsx +0 -182
  446. package/src/ui/screens/AccountOverviewScreen.tsx +0 -696
  447. package/src/ui/screens/AccountSettingsScreen.tsx +0 -620
  448. package/src/ui/screens/AccountSwitcherScreen.tsx +0 -1003
  449. package/src/ui/screens/SessionManagementScreen.tsx +0 -477
  450. package/src/ui/styles/index.ts +0 -3
@@ -1,696 +0,0 @@
1
- import React, { useState, useMemo, useCallback, useRef, useEffect } from 'react';
2
- import {
3
- View,
4
- Text,
5
- TouchableOpacity,
6
- StyleSheet,
7
- ActivityIndicator,
8
- ScrollView,
9
- Platform,
10
- Image,
11
- TextStyle,
12
- } from 'react-native';
13
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
14
- import type { BaseScreenProps } from '../types/navigation';
15
- import OxyLogo from '../components/OxyLogo';
16
- import Avatar from '../components/Avatar';
17
- import { Dialog, toast, useDialogControl } from '@oxyhq/bloom';
18
- import { Ionicons } from '@expo/vector-icons';
19
- import { SettingsIcon } from '../components/SettingsIcon';
20
- import { useI18n } from '../hooks/useI18n';
21
- import { useTheme } from '@oxyhq/bloom/theme';
22
- import { getDisplayName, getShortDisplayName } from '../utils/userUtils';
23
- import { getAccountDisplayName, getAccountFallbackHandle } from '@oxyhq/core';
24
- import { useColorScheme } from '../hooks/useColorScheme';
25
- import { Colors } from '../constants/theme';
26
- import { normalizeColorScheme, normalizeTheme } from '../utils/themeUtils';
27
- import { useOxy } from '../context/OxyContext';
28
- import { useUsersBySessions } from '../hooks/queries/useAccountQueries';
29
- import {
30
- SCREEN_PADDING_HORIZONTAL,
31
- SECTION_GAP,
32
- HEADER_PADDING_TOP_OVERVIEW,
33
- createScreenContentStyle,
34
- } from '../constants/spacing';
35
- import { DeleteAccountModal } from '../components/modals';
36
- import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
37
-
38
- // Optional Lottie import - gracefully handle if not available
39
- let LottieView: any = null;
40
- try {
41
- // eslint-disable-next-line @typescript-eslint/no-require-imports
42
- LottieView = require('lottie-react-native').default;
43
- } catch {
44
- // Lottie not available, will use fallback
45
- }
46
-
47
- // Import Lottie animation - will be undefined if file doesn't exist
48
- let lottieAnimation: any = undefined;
49
- try {
50
- // eslint-disable-next-line @typescript-eslint/no-require-imports
51
- lottieAnimation = require('../assets/lottie/welcomeheader_background_op1.json');
52
- } catch {
53
- // Animation file not available
54
- }
55
-
56
- /**
57
- * AccountOverviewScreen - Optimized for performance
58
- *
59
- * Performance optimizations implemented:
60
- * - useMemo for theme calculations (only recalculates when theme changes)
61
- * - useMemo for additional accounts filtering (only recalculates when dependencies change)
62
- * - useCallback for event handlers to prevent unnecessary re-renders
63
- * - React.memo wrapper to prevent re-renders when props haven't changed
64
- * - SettingsListGroup/SettingsListItem from bloom for consistent grouped list rendering
65
- */
66
- const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
67
- onClose,
68
- theme,
69
- navigate,
70
- }) => {
71
- // Use useOxy() hook for OxyContext values
72
- const {
73
- user,
74
- logout,
75
- isLoading,
76
- sessions,
77
- activeSessionId,
78
- oxyServices,
79
- isAuthenticated,
80
- openAvatarPicker,
81
- } = useOxy();
82
- const { t, locale } = useI18n();
83
- const [showMoreAccounts, setShowMoreAccounts] = useState(false);
84
- const [additionalAccountsData, setAdditionalAccountsData] = useState<any[]>([]);
85
- const [loadingAdditionalAccounts, setLoadingAdditionalAccounts] = useState(false);
86
- const deleteAccountControl = useDialogControl();
87
- const logoutDialog = useDialogControl();
88
- const signOutAllDialog = useDialogControl();
89
- const downloadDataDialog = useDialogControl();
90
- const lottieRef = useRef<any>(null);
91
- const hasPlayedRef = useRef(false);
92
- const insets = useSafeAreaInsets();
93
-
94
- // Use bloom theme for ActivityIndicator and other non-style color props
95
- const bloomTheme = useTheme();
96
- const colorScheme = useColorScheme();
97
- const normalizedTheme = normalizeTheme(theme);
98
- // AccountOverviewScreen uses a custom primary color (purple) instead of the default blue
99
- const themeColors = {
100
- primaryColor: '#d169e5',
101
- };
102
- // Icon colors from the Colors constant
103
- const baseThemeColors = Colors[normalizeColorScheme(colorScheme, normalizedTheme)];
104
-
105
- // Compute user data for display
106
- const displayName = useMemo(() => getDisplayName(user), [user]);
107
- const shortDisplayName = useMemo(() => getShortDisplayName(user), [user]);
108
- const avatarUrl = useMemo(() => {
109
- if (user?.avatar && oxyServices) {
110
- return oxyServices.getFileDownloadUrl(user.avatar, 'thumb');
111
- }
112
- return undefined;
113
- }, [user?.avatar, oxyServices]);
114
-
115
- // Handle avatar press - use openAvatarPicker from context
116
- const handleAvatarPress = useCallback(() => {
117
- openAvatarPicker();
118
- }, [openAvatarPicker]);
119
-
120
- // Play Lottie animation once when component mounts
121
- useEffect(() => {
122
- if (hasPlayedRef.current || !LottieView || !lottieRef.current || !lottieAnimation) return;
123
-
124
- const timer = setTimeout(() => {
125
- if (lottieRef.current && !hasPlayedRef.current) {
126
- lottieRef.current.play();
127
- hasPlayedRef.current = true;
128
- }
129
- }, 100);
130
-
131
- return () => clearTimeout(timer);
132
- }, []);
133
-
134
- // Memoize additional accounts filtering to prevent recalculation on every render
135
- const additionalAccounts = useMemo(() =>
136
- (sessions || []).filter(session =>
137
- session.sessionId !== activeSessionId && session.userId !== user?.id
138
- ), [sessions, activeSessionId, user?.id]
139
- );
140
-
141
- // Load user profiles for additional accounts using TanStack Query
142
- const sessionIds = additionalAccounts.map(s => s.sessionId);
143
- const { data: usersData, isLoading: isLoadingUsers } = useUsersBySessions(sessionIds, {
144
- enabled: additionalAccounts.length > 0
145
- });
146
-
147
- React.useEffect(() => {
148
- if (usersData && usersData.length > 0) {
149
- const accountsData = usersData.map(({ sessionId, user: userProfile }: { sessionId: string; user: any }) => ({
150
- id: sessionId,
151
- sessionId,
152
- userProfile: userProfile ?? null,
153
- avatar: userProfile?.avatar ?? null,
154
- email: userProfile?.email,
155
- }));
156
- setAdditionalAccountsData(accountsData);
157
- setLoadingAdditionalAccounts(false);
158
- } else if (additionalAccounts.length === 0) {
159
- setAdditionalAccountsData([]);
160
- setLoadingAdditionalAccounts(false);
161
- } else if (!isLoadingUsers) {
162
- setLoadingAdditionalAccounts(false);
163
- }
164
- }, [usersData, additionalAccounts.length, isLoadingUsers]);
165
-
166
- // Feature settings (with mock values)
167
- const features = {
168
- safeSearch: false,
169
- language: 'English',
170
- };
171
-
172
- // Memoize event handlers to prevent recreation on every render
173
- const handleLogout = useCallback(async () => {
174
- try {
175
- await logout();
176
- if (onClose) {
177
- onClose();
178
- }
179
- } catch (error) {
180
- if (__DEV__) {
181
- console.error('Logout failed:', error);
182
- }
183
- toast.error(t('common.errors.signOutFailed'));
184
- }
185
- }, [logout, onClose]);
186
-
187
- const handleAddAccount = useCallback(() => {
188
- toast.info(t('accountOverview.addAccountComing'));
189
- }, [t]);
190
-
191
- const performDownload = useCallback(async (format: 'json' | 'csv') => {
192
- if (!oxyServices || !user) { toast.error(t('accountOverview.items.downloadData.error') || 'Service not available'); return; }
193
- try {
194
- toast.info(t('accountOverview.items.downloadData.downloading') || 'Preparing download...');
195
- const blob = await oxyServices.downloadAccountData(format);
196
- if (Platform.OS === 'web') {
197
- const url = URL.createObjectURL(blob);
198
- const link = document.createElement('a');
199
- link.href = url;
200
- link.download = `account-data-${Date.now()}.${format}`;
201
- document.body.appendChild(link);
202
- link.click();
203
- document.body.removeChild(link);
204
- URL.revokeObjectURL(url);
205
- }
206
- toast.success(t('accountOverview.items.downloadData.success') || 'Data downloaded successfully');
207
- } catch (error: unknown) {
208
- if (__DEV__) { console.error('Failed to download data:', error); }
209
- toast.error((error instanceof Error ? error.message : null) || t('accountOverview.items.downloadData.error') || 'Failed to download data');
210
- }
211
- }, [oxyServices, user, t]);
212
-
213
- const handleDownloadData = useCallback(() => {
214
- if (!oxyServices || !user) { toast.error(t('accountOverview.items.downloadData.error') || 'Service not available'); return; }
215
- downloadDataDialog.open();
216
- }, [oxyServices, user, t, downloadDataDialog]);
217
-
218
- const handleDeleteAccount = useCallback(() => {
219
- if (!user) {
220
- toast.error(t('accountOverview.items.deleteAccount.error') || 'User not available');
221
- return;
222
- }
223
- deleteAccountControl.open();
224
- }, [user, t, deleteAccountControl]);
225
-
226
- const handleConfirmDelete = useCallback(async (confirmText: string) => {
227
- if (!oxyServices || !user) {
228
- throw new Error(t('accountOverview.items.deleteAccount.error') || 'Service not available');
229
- }
230
-
231
- await oxyServices.deleteAccount(confirmText);
232
- toast.success(t('accountOverview.items.deleteAccount.success') || 'Account deleted successfully');
233
- deleteAccountControl.close();
234
- await logout();
235
- if (onClose) {
236
- onClose();
237
- }
238
- }, [oxyServices, user, logout, onClose, t]);
239
-
240
- if (!isAuthenticated) {
241
- return (
242
- <View style={[styles.container, { backgroundColor: bloomTheme.colors.background }]}>
243
- <Text style={styles.message} className="text-foreground">{t('common.status.notSignedIn')}</Text>
244
- </View>
245
- );
246
- }
247
-
248
- if (isLoading) {
249
- return (
250
- <View style={[styles.container, { justifyContent: 'center', backgroundColor: bloomTheme.colors.background }]}>
251
- <ActivityIndicator size="large" color={themeColors.primaryColor} />
252
- </View>
253
- );
254
- }
255
-
256
-
257
- return (
258
- <View style={[styles.container, { backgroundColor: bloomTheme.colors.background }]}>
259
- <ScrollView
260
- style={styles.content}
261
- contentContainerStyle={styles.scrollContent}
262
- showsVerticalScrollIndicator={false}
263
- >
264
- {/* Centered Avatar and Name Header Section */}
265
- {user && (
266
- <View style={styles.headerSection}>
267
- <View style={styles.avatarSectionWrapper}>
268
- <View style={styles.avatarContainer}>
269
- {LottieView && lottieAnimation && (
270
- <LottieView
271
- ref={lottieRef}
272
- source={lottieAnimation}
273
- style={styles.lottieBackground}
274
- loop={false}
275
- autoPlay={false}
276
- />
277
- )}
278
- <TouchableOpacity
279
- style={styles.avatarWrapper}
280
- onPress={handleAvatarPress}
281
- activeOpacity={0.8}
282
- >
283
- <Avatar
284
- uri={avatarUrl}
285
- name={displayName}
286
- size={100}
287
- theme={normalizedTheme}
288
- />
289
- </TouchableOpacity>
290
- </View>
291
- <View style={styles.nameWrapper}>
292
- <Text style={styles.welcomeText} className="text-foreground">
293
- {displayName}
294
- </Text>
295
- <Text style={styles.welcomeSubtext} className="text-muted-foreground">
296
- Manage your Oxy account.
297
- </Text>
298
- </View>
299
- </View>
300
- </View>
301
- )}
302
-
303
- {/* User Profile Section */}
304
- <SettingsListGroup title={t('accountOverview.sections.profile')}>
305
- <SettingsListItem
306
- icon={<SettingsIcon name="account" color={baseThemeColors.iconSecurity} />}
307
- title={displayName}
308
- description={(() => {
309
- if (!user) return t('common.status.loading') || 'Loading...';
310
- if (user.email) return user.email;
311
- const handle = getAccountFallbackHandle(user);
312
- if (!handle) return '';
313
- return user.username ? `@${handle}` : handle;
314
- })()}
315
- onPress={() => navigate?.('AccountSettings', { activeTab: 'profile' })}
316
- />
317
- </SettingsListGroup>
318
-
319
- {/* Account Settings */}
320
- <SettingsListGroup title={t('accountOverview.sections.accountSettings')}>
321
- <SettingsListItem
322
- icon={<SettingsIcon name="account-circle" color={baseThemeColors.iconPersonalInfo} />}
323
- title={t('accountOverview.items.editProfile.title')}
324
- description={t('accountOverview.items.editProfile.subtitle')}
325
- onPress={() => navigate?.('AccountSettings', { activeTab: 'profile' })}
326
- />
327
- <SettingsListItem
328
- icon={<SettingsIcon name="shield-check" color={baseThemeColors.iconSecurity} />}
329
- title={t('accountOverview.items.security.title')}
330
- description={t('accountOverview.items.security.subtitle')}
331
- onPress={() => navigate?.('AccountSettings', { activeTab: 'password' })}
332
- />
333
- <SettingsListItem
334
- icon={<SettingsIcon name="bell" color={baseThemeColors.iconStorage} />}
335
- title={t('accountOverview.items.notifications.title')}
336
- description={t('accountOverview.items.notifications.subtitle')}
337
- onPress={() => navigate?.('AccountSettings', { activeTab: 'notifications' })}
338
- />
339
- <SettingsListItem
340
- icon={<SettingsIcon name="star" color={baseThemeColors.iconPayments} />}
341
- title={t('accountOverview.items.premium.title')}
342
- description={user?.isPremium ? t('accountOverview.items.premium.manage') : t('accountOverview.items.premium.upgrade')}
343
- onPress={() => navigate?.('PremiumSubscription')}
344
- />
345
- {user?.isPremium ? (
346
- <SettingsListItem
347
- icon={<SettingsIcon name="credit-card" color={baseThemeColors.iconPersonalInfo} />}
348
- title={t('accountOverview.items.billing.title')}
349
- description={t('accountOverview.items.billing.subtitle')}
350
- onPress={() => toast.info(t('accountOverview.items.billing.coming'))}
351
- />
352
- ) : null}
353
- </SettingsListGroup>
354
-
355
- {/* Additional Accounts */}
356
- {showMoreAccounts && (
357
- <SettingsListGroup title={`${t('accountOverview.sections.additionalAccounts') || 'Additional Accounts'}${additionalAccountsData.length > 0 ? ` (${additionalAccountsData.length})` : ''}`}>
358
- {loadingAdditionalAccounts ? (
359
- <SettingsListItem
360
- icon={<SettingsIcon name="sync" color={baseThemeColors.iconSecurity} />}
361
- title={t('accountOverview.loadingAdditional.title') || 'Loading accounts...'}
362
- description={t('accountOverview.loadingAdditional.subtitle') || 'Please wait while we load your additional accounts'}
363
- rightElement={
364
- <View style={styles.loadingContainer}>
365
- <ActivityIndicator size="small" color={baseThemeColors.iconSecurity} />
366
- </View>
367
- }
368
- showChevron={false}
369
- />
370
- ) : additionalAccountsData.length > 0 ? (
371
- additionalAccountsData.map((account) => {
372
- const accountDisplayName = getAccountDisplayName(account.userProfile, locale);
373
- const accountHandle = getAccountFallbackHandle(account.userProfile);
374
- const description = account.email
375
- ?? (accountHandle && account.userProfile?.username ? `@${accountHandle}` : accountHandle)
376
- ?? '';
377
- return (
378
- <SettingsListItem
379
- key={`account-${account.id}`}
380
- icon={
381
- <View style={styles.userIcon}>
382
- {account.avatar ? (
383
- <Image
384
- source={{ uri: oxyServices.getFileDownloadUrl(account.avatar, 'thumb') }}
385
- style={styles.accountAvatarImage}
386
- />
387
- ) : (
388
- <View style={styles.accountAvatarFallback}>
389
- <Text style={styles.accountAvatarText}>
390
- {accountDisplayName.charAt(0).toUpperCase()}
391
- </Text>
392
- </View>
393
- )}
394
- </View>
395
- }
396
- title={accountDisplayName}
397
- description={description}
398
- onPress={() => {
399
- toast.info(t('accountOverview.items.accountSwitcher.switchPrompt', { username: accountDisplayName }) || `Switch to ${accountDisplayName}?`);
400
- }}
401
- />
402
- );
403
- })
404
- ) : (
405
- <SettingsListItem
406
- icon={<SettingsIcon name="account-outline" color={bloomTheme.colors.textTertiary} />}
407
- title={t('accountOverview.additional.noAccounts.title') || 'No other accounts'}
408
- description={t('accountOverview.additional.noAccounts.subtitle') || 'Add another account to switch between them'}
409
- showChevron={false}
410
- />
411
- )}
412
- </SettingsListGroup>
413
- )}
414
-
415
- {/* Account Management */}
416
- {showMoreAccounts && (
417
- <SettingsListGroup title={t('accountOverview.sections.accountManagement') || 'Account Management'}>
418
- <SettingsListItem
419
- icon={<SettingsIcon name="plus" color={baseThemeColors.iconSecurity} />}
420
- title={t('accountOverview.items.addAccount.title') || 'Add Another Account'}
421
- description={t('accountOverview.items.addAccount.subtitle') || 'Sign in with a different account'}
422
- onPress={handleAddAccount}
423
- />
424
- <SettingsListItem
425
- icon={<SettingsIcon name="logout" color={baseThemeColors.iconSharing} />}
426
- title={t('accountOverview.items.signOutAll.title') || 'Sign out of all accounts'}
427
- description={t('accountOverview.items.signOutAll.subtitle') || 'Remove all accounts from this device'}
428
- onPress={() => signOutAllDialog.open()}
429
- />
430
- </SettingsListGroup>
431
- )}
432
-
433
- {/* Quick Actions */}
434
- <SettingsListGroup title={t('accountOverview.sections.quickActions')}>
435
- <SettingsListItem
436
- icon={<SettingsIcon name="account-group" color={baseThemeColors.iconData} />}
437
- title={showMoreAccounts
438
- ? t('accountOverview.items.accountSwitcher.titleHide')
439
- : t('accountOverview.items.accountSwitcher.titleShow')}
440
- description={showMoreAccounts
441
- ? t('accountOverview.items.accountSwitcher.subtitleHide')
442
- : additionalAccountsData.length > 0
443
- ? t('accountOverview.items.accountSwitcher.subtitleSwitchBetween', { count: String(additionalAccountsData.length + 1) })
444
- : loadingAdditionalAccounts
445
- ? t('accountOverview.items.accountSwitcher.subtitleLoading')
446
- : t('accountOverview.items.accountSwitcher.subtitleManageMultiple')}
447
- onPress={() => setShowMoreAccounts(!showMoreAccounts)}
448
- />
449
- <SettingsListItem
450
- icon={<SettingsIcon name="clock" color={baseThemeColors.iconSecurity} />}
451
- title={t('accountOverview.items.history.title') || 'History'}
452
- description={t('accountOverview.items.history.subtitle') || 'View and manage your search history'}
453
- onPress={() => navigate?.('HistoryView')}
454
- />
455
- <SettingsListItem
456
- icon={<SettingsIcon name="bookmark" color={baseThemeColors.iconStorage} />}
457
- title={t('accountOverview.items.saves.title') || 'Saves & Collections'}
458
- description={t('accountOverview.items.saves.subtitle') || 'View your saved items and collections'}
459
- onPress={() => navigate?.('SavesCollections')}
460
- />
461
- <SettingsListItem
462
- icon={<SettingsIcon name="download" color={baseThemeColors.iconPersonalInfo} />}
463
- title={t('accountOverview.items.downloadData.title')}
464
- description={t('accountOverview.items.downloadData.subtitle')}
465
- onPress={handleDownloadData}
466
- />
467
- <SettingsListItem
468
- icon={<SettingsIcon name="delete" color={baseThemeColors.iconSharing} />}
469
- title={t('accountOverview.items.deleteAccount.title')}
470
- description={t('accountOverview.items.deleteAccount.subtitle')}
471
- onPress={handleDeleteAccount}
472
- />
473
- </SettingsListGroup>
474
-
475
- {/* Support & Settings */}
476
- <SettingsListGroup title={t('accountOverview.sections.support')}>
477
- <SettingsListItem
478
- icon={<SettingsIcon name="magnify" color={baseThemeColors.iconSecurity} />}
479
- title={t('accountOverview.items.searchSettings.title') || 'Search Settings'}
480
- description={t('accountOverview.items.searchSettings.subtitle') || 'SafeSearch and personalization'}
481
- onPress={() => navigate?.('SearchSettings')}
482
- />
483
- <SettingsListItem
484
- icon={<SettingsIcon name="translate" color={baseThemeColors.iconPersonalInfo} />}
485
- title={t('accountOverview.items.language.title') || 'Language'}
486
- description={t('accountOverview.items.language.subtitle') || 'Choose your preferred language'}
487
- onPress={() => navigate?.('LanguageSelector')}
488
- />
489
- <SettingsListItem
490
- icon={<SettingsIcon name="cog" color={bloomTheme.colors.textTertiary} />}
491
- title={t('accountOverview.items.preferences.title')}
492
- description={t('accountOverview.items.preferences.subtitle')}
493
- onPress={() => toast.info(t('accountOverview.items.preferences.coming'))}
494
- />
495
- <SettingsListItem
496
- icon={<SettingsIcon name="help-circle" color={baseThemeColors.iconSecurity} />}
497
- title={t('accountOverview.items.help.title')}
498
- description={t('accountOverview.items.help.subtitle')}
499
- onPress={() => navigate?.('HelpSupport')}
500
- />
501
- <SettingsListItem
502
- icon={<SettingsIcon name="shield-check" color={baseThemeColors.iconPersonalInfo} />}
503
- title={t('accountOverview.items.privacyPolicy.title') || 'Privacy Policy'}
504
- description={t('accountOverview.items.privacyPolicy.subtitle') || 'How we handle your data'}
505
- onPress={() => navigate?.('LegalDocuments', { initialStep: 1 })}
506
- />
507
- <SettingsListItem
508
- icon={<SettingsIcon name="file-document" color={baseThemeColors.iconSecurity} />}
509
- title={t('accountOverview.items.termsOfService.title') || 'Terms of Service'}
510
- description={t('accountOverview.items.termsOfService.subtitle') || 'Terms and conditions of use'}
511
- onPress={() => navigate?.('LegalDocuments', { initialStep: 2 })}
512
- />
513
- <SettingsListItem
514
- icon={<SettingsIcon name="link" color={baseThemeColors.iconPersonalInfo} />}
515
- title={t('accountOverview.items.connectedApps.title')}
516
- description={t('accountOverview.items.connectedApps.subtitle')}
517
- onPress={() => toast.info(t('accountOverview.items.connectedApps.coming'))}
518
- />
519
- <SettingsListItem
520
- icon={<SettingsIcon name="information" color={bloomTheme.colors.textTertiary} />}
521
- title={t('accountOverview.items.about.title')}
522
- description={t('accountOverview.items.about.subtitle')}
523
- onPress={() => navigate?.('AppInfo')}
524
- />
525
- </SettingsListGroup>
526
-
527
- {/* Sign Out */}
528
- <SettingsListGroup title={t('accountOverview.sections.actions')}>
529
- <SettingsListItem
530
- icon={<SettingsIcon name="logout" color={bloomTheme.colors.error} />}
531
- title={t('accountOverview.items.signOut.title')}
532
- description={t('accountOverview.items.signOut.subtitle')}
533
- onPress={() => logoutDialog.open()}
534
- destructive={true}
535
- showChevron={false}
536
- />
537
- </SettingsListGroup>
538
- </ScrollView>
539
-
540
- {/* Delete Account Dialog */}
541
- {user && (
542
- <DeleteAccountModal
543
- control={deleteAccountControl}
544
- username={user.username || ''}
545
- onDelete={handleConfirmDelete}
546
- t={t}
547
- />
548
- )}
549
-
550
- <Dialog
551
- control={logoutDialog}
552
- title={t('accountOverview.items.signOut.title') || 'Sign Out'}
553
- description={t('common.confirms.signOut') || 'Are you sure you want to sign out?'}
554
- actions={[
555
- {
556
- label: t('accountOverview.items.signOut.title') || 'Sign Out',
557
- color: 'destructive',
558
- onPress: handleLogout,
559
- },
560
- { label: t('common.cancel') || 'Cancel', color: 'cancel' },
561
- ]}
562
- />
563
- <Dialog
564
- control={signOutAllDialog}
565
- title={t('accountOverview.items.signOutAll.title') || 'Sign Out All'}
566
- description={t('common.confirms.signOutAll') || 'Are you sure you want to sign out of all accounts?'}
567
- actions={[
568
- {
569
- label: t('accountOverview.items.signOutAll.title') || 'Sign Out All',
570
- color: 'destructive',
571
- onPress: handleLogout,
572
- },
573
- { label: t('common.cancel') || 'Cancel', color: 'cancel' },
574
- ]}
575
- />
576
- <Dialog
577
- control={downloadDataDialog}
578
- title={t('accountOverview.items.downloadData.confirmTitle') || 'Download Account Data'}
579
- description={t('accountOverview.items.downloadData.confirmMessage') || 'Choose the format for your account data export:'}
580
- actions={[
581
- { label: 'JSON', onPress: () => performDownload('json') },
582
- { label: 'CSV', onPress: () => performDownload('csv') },
583
- { label: t('common.cancel') || 'Cancel', color: 'cancel' },
584
- ]}
585
- />
586
- </View>
587
- );
588
- };
589
-
590
- const styles = StyleSheet.create({
591
- container: {
592
- flex: 1,
593
- },
594
- content: {
595
- flex: 1,
596
- },
597
- scrollContent: createScreenContentStyle(HEADER_PADDING_TOP_OVERVIEW),
598
- headerSection: {
599
- alignItems: 'center',
600
- marginBottom: SECTION_GAP,
601
- paddingTop: HEADER_PADDING_TOP_OVERVIEW,
602
- },
603
- avatarSectionWrapper: {
604
- alignItems: 'center',
605
- justifyContent: 'center',
606
- width: '100%',
607
- },
608
- avatarContainer: {
609
- position: 'relative',
610
- alignItems: 'center',
611
- justifyContent: 'center',
612
- width: '100%',
613
- maxWidth: 600,
614
- minHeight: 100,
615
- overflow: 'hidden',
616
- alignSelf: 'center',
617
- aspectRatio: 6,
618
- },
619
- lottieBackground: {
620
- position: 'absolute',
621
- width: '100%',
622
- maxWidth: 600,
623
- minHeight: 100,
624
- top: 0,
625
- left: 0,
626
- right: 0,
627
- bottom: 0,
628
- zIndex: 0,
629
- aspectRatio: 6,
630
- },
631
- avatarWrapper: {
632
- zIndex: 1,
633
- position: 'absolute',
634
- alignItems: 'center',
635
- justifyContent: 'center',
636
- width: 100,
637
- height: 100,
638
- left: '50%',
639
- marginLeft: -50,
640
- top: 0,
641
- },
642
- nameWrapper: {
643
- marginTop: 12,
644
- alignItems: 'center',
645
- justifyContent: 'center',
646
- },
647
- welcomeText: {
648
- fontSize: 28,
649
- fontWeight: '600',
650
- marginBottom: 8,
651
- maxWidth: '90%',
652
- },
653
- welcomeSubtext: {
654
- fontSize: 16,
655
- fontWeight: '400',
656
- opacity: 0.6,
657
- },
658
- userIcon: {
659
- marginRight: 12,
660
- },
661
- accountAvatarImage: {
662
- width: 40,
663
- height: 40,
664
- borderRadius: 20,
665
- },
666
- accountAvatarFallback: {
667
- width: 40,
668
- height: 40,
669
- borderRadius: 20,
670
- backgroundColor: '#d169e5',
671
- alignItems: 'center',
672
- justifyContent: 'center',
673
- },
674
- accountAvatarText: {
675
- color: 'white',
676
- fontSize: 18,
677
- fontWeight: 'bold',
678
- },
679
- message: {
680
- fontSize: 16,
681
- textAlign: 'center',
682
- marginTop: 24,
683
- },
684
- loadingContainer: {
685
- flexDirection: 'row',
686
- alignItems: 'center',
687
- justifyContent: 'center',
688
- paddingVertical: 20,
689
- gap: 12,
690
- },
691
- loadingText: {
692
- fontSize: 16,
693
- },
694
- });
695
-
696
- export default React.memo(AccountOverviewScreen);