@oxyhq/services 5.4.0 → 5.4.2

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 (395) hide show
  1. package/package.json +3 -2
  2. package/src/__tests__/ui/screens/AccountSettingsScreen.test.tsx +8 -8
  3. package/src/core/index.ts +103 -0
  4. package/src/lib/sonner.ts +9 -4
  5. package/src/ui/components/OxyProvider.tsx +5 -5
  6. package/src/ui/context/OxyContext.tsx +61 -41
  7. package/src/ui/screens/AccountManagementDemo.tsx +1 -1
  8. package/src/ui/screens/AccountOverviewScreen.tsx +44 -26
  9. package/src/ui/screens/AccountSettingsScreen.tsx +25 -19
  10. package/src/ui/screens/AppInfoScreen.tsx +5 -5
  11. package/src/ui/screens/FileManagementScreen.tsx +246 -211
  12. package/src/ui/screens/SignInScreen.tsx +382 -326
  13. package/src/ui/screens/SignUpScreen.tsx +443 -273
  14. package/src/ui/screens/karma/KarmaFAQScreen.tsx +50 -29
  15. package/lib/commonjs/assets/OxyLogo.svg +0 -1
  16. package/lib/commonjs/assets/assets/OxyLogo.svg +0 -1
  17. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  18. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  19. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  20. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  21. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  22. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  23. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  24. package/lib/commonjs/assets/assets/icons/OxyServices.tsx +0 -67
  25. package/lib/commonjs/assets/assets/icons/logo_OxyServices.svg +0 -1
  26. package/lib/commonjs/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  27. package/lib/commonjs/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  28. package/lib/commonjs/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  29. package/lib/commonjs/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  30. package/lib/commonjs/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  31. package/lib/commonjs/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  32. package/lib/commonjs/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  33. package/lib/commonjs/assets/icons/OxyServices.js +0 -53
  34. package/lib/commonjs/assets/icons/OxyServices.js.map +0 -1
  35. package/lib/commonjs/assets/icons/logo_OxyServices.svg +0 -1
  36. package/lib/commonjs/constants/version.js +0 -28
  37. package/lib/commonjs/constants/version.js.map +0 -1
  38. package/lib/commonjs/core/index.js +0 -1543
  39. package/lib/commonjs/core/index.js.map +0 -1
  40. package/lib/commonjs/index.js +0 -160
  41. package/lib/commonjs/index.js.map +0 -1
  42. package/lib/commonjs/lib/react-native-polyfills.js +0 -181
  43. package/lib/commonjs/lib/react-native-polyfills.js.map +0 -1
  44. package/lib/commonjs/lib/sonner-safe.js +0 -41
  45. package/lib/commonjs/lib/sonner-safe.js.map +0 -1
  46. package/lib/commonjs/lib/sonner.js +0 -18
  47. package/lib/commonjs/lib/sonner.js.map +0 -1
  48. package/lib/commonjs/lib/sonner.web.js +0 -17
  49. package/lib/commonjs/lib/sonner.web.js.map +0 -1
  50. package/lib/commonjs/models/interfaces.js +0 -2
  51. package/lib/commonjs/models/interfaces.js.map +0 -1
  52. package/lib/commonjs/models/secureSession.js +0 -2
  53. package/lib/commonjs/models/secureSession.js.map +0 -1
  54. package/lib/commonjs/node/index.js +0 -54
  55. package/lib/commonjs/node/index.js.map +0 -1
  56. package/lib/commonjs/package.json +0 -1
  57. package/lib/commonjs/ui/components/Avatar.js +0 -98
  58. package/lib/commonjs/ui/components/Avatar.js.map +0 -1
  59. package/lib/commonjs/ui/components/FollowButton.js +0 -246
  60. package/lib/commonjs/ui/components/FollowButton.js.map +0 -1
  61. package/lib/commonjs/ui/components/FontLoader.js +0 -181
  62. package/lib/commonjs/ui/components/FontLoader.js.map +0 -1
  63. package/lib/commonjs/ui/components/GroupedItem.js +0 -109
  64. package/lib/commonjs/ui/components/GroupedItem.js.map +0 -1
  65. package/lib/commonjs/ui/components/GroupedSection.js +0 -33
  66. package/lib/commonjs/ui/components/GroupedSection.js.map +0 -1
  67. package/lib/commonjs/ui/components/OxyLogo.js +0 -56
  68. package/lib/commonjs/ui/components/OxyLogo.js.map +0 -1
  69. package/lib/commonjs/ui/components/OxyProvider.js +0 -517
  70. package/lib/commonjs/ui/components/OxyProvider.js.map +0 -1
  71. package/lib/commonjs/ui/components/OxySignInButton.js +0 -178
  72. package/lib/commonjs/ui/components/OxySignInButton.js.map +0 -1
  73. package/lib/commonjs/ui/components/ProfileCard.js +0 -124
  74. package/lib/commonjs/ui/components/ProfileCard.js.map +0 -1
  75. package/lib/commonjs/ui/components/QuickActions.js +0 -87
  76. package/lib/commonjs/ui/components/QuickActions.js.map +0 -1
  77. package/lib/commonjs/ui/components/Section.js +0 -36
  78. package/lib/commonjs/ui/components/Section.js.map +0 -1
  79. package/lib/commonjs/ui/components/SectionTitle.js +0 -35
  80. package/lib/commonjs/ui/components/SectionTitle.js.map +0 -1
  81. package/lib/commonjs/ui/components/bottomSheet/index.js +0 -37
  82. package/lib/commonjs/ui/components/bottomSheet/index.js.map +0 -1
  83. package/lib/commonjs/ui/components/icon/OxyIcon.js +0 -27
  84. package/lib/commonjs/ui/components/icon/OxyIcon.js.map +0 -1
  85. package/lib/commonjs/ui/components/icon/index.js +0 -14
  86. package/lib/commonjs/ui/components/icon/index.js.map +0 -1
  87. package/lib/commonjs/ui/components/index.js +0 -97
  88. package/lib/commonjs/ui/components/index.js.map +0 -1
  89. package/lib/commonjs/ui/context/OxyContext.js +0 -568
  90. package/lib/commonjs/ui/context/OxyContext.js.map +0 -1
  91. package/lib/commonjs/ui/index.js +0 -128
  92. package/lib/commonjs/ui/index.js.map +0 -1
  93. package/lib/commonjs/ui/navigation/OxyRouter.js +0 -264
  94. package/lib/commonjs/ui/navigation/OxyRouter.js.map +0 -1
  95. package/lib/commonjs/ui/navigation/types.js +0 -6
  96. package/lib/commonjs/ui/navigation/types.js.map +0 -1
  97. package/lib/commonjs/ui/screens/AccountCenterScreen.js +0 -313
  98. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +0 -1
  99. package/lib/commonjs/ui/screens/AccountManagementDemo.js +0 -299
  100. package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +0 -1
  101. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +0 -837
  102. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +0 -1
  103. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +0 -836
  104. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +0 -1
  105. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -788
  106. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
  107. package/lib/commonjs/ui/screens/AppInfoScreen.js +0 -664
  108. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +0 -1
  109. package/lib/commonjs/ui/screens/BillingManagementScreen.js +0 -636
  110. package/lib/commonjs/ui/screens/BillingManagementScreen.js.map +0 -1
  111. package/lib/commonjs/ui/screens/FileManagementScreen.js +0 -2497
  112. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +0 -1
  113. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +0 -1620
  114. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +0 -1
  115. package/lib/commonjs/ui/screens/ProfileScreen.js +0 -450
  116. package/lib/commonjs/ui/screens/ProfileScreen.js.map +0 -1
  117. package/lib/commonjs/ui/screens/SessionManagementScreen.js +0 -449
  118. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +0 -1
  119. package/lib/commonjs/ui/screens/SignInScreen.js +0 -956
  120. package/lib/commonjs/ui/screens/SignInScreen.js.map +0 -1
  121. package/lib/commonjs/ui/screens/SignUpScreen.js +0 -762
  122. package/lib/commonjs/ui/screens/SignUpScreen.js.map +0 -1
  123. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +0 -88
  124. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +0 -1
  125. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +0 -364
  126. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +0 -1
  127. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +0 -202
  128. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +0 -1
  129. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +0 -148
  130. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +0 -1
  131. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +0 -127
  132. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +0 -1
  133. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +0 -105
  134. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +0 -1
  135. package/lib/commonjs/ui/styles/FONTS.md +0 -126
  136. package/lib/commonjs/ui/styles/fonts.js +0 -84
  137. package/lib/commonjs/ui/styles/fonts.js.map +0 -1
  138. package/lib/commonjs/ui/styles/index.js +0 -28
  139. package/lib/commonjs/ui/styles/index.js.map +0 -1
  140. package/lib/commonjs/ui/styles/theme.js +0 -121
  141. package/lib/commonjs/ui/styles/theme.js.map +0 -1
  142. package/lib/commonjs/utils/deviceManager.js +0 -173
  143. package/lib/commonjs/utils/deviceManager.js.map +0 -1
  144. package/lib/commonjs/utils/index.js +0 -13
  145. package/lib/commonjs/utils/index.js.map +0 -1
  146. package/lib/commonjs/utils/polyfills.js +0 -42
  147. package/lib/commonjs/utils/polyfills.js.map +0 -1
  148. package/lib/module/assets/OxyLogo.svg +0 -1
  149. package/lib/module/assets/assets/OxyLogo.svg +0 -1
  150. package/lib/module/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  151. package/lib/module/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  152. package/lib/module/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  153. package/lib/module/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  154. package/lib/module/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  155. package/lib/module/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  156. package/lib/module/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  157. package/lib/module/assets/assets/icons/OxyServices.tsx +0 -67
  158. package/lib/module/assets/assets/icons/logo_OxyServices.svg +0 -1
  159. package/lib/module/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  160. package/lib/module/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  161. package/lib/module/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  162. package/lib/module/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  163. package/lib/module/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  164. package/lib/module/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  165. package/lib/module/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  166. package/lib/module/assets/icons/OxyServices.js +0 -46
  167. package/lib/module/assets/icons/OxyServices.js.map +0 -1
  168. package/lib/module/assets/icons/logo_OxyServices.svg +0 -1
  169. package/lib/module/constants/version.js +0 -21
  170. package/lib/module/constants/version.js.map +0 -1
  171. package/lib/module/core/index.js +0 -1517
  172. package/lib/module/core/index.js.map +0 -1
  173. package/lib/module/index.js +0 -48
  174. package/lib/module/index.js.map +0 -1
  175. package/lib/module/lib/react-native-polyfills.js +0 -179
  176. package/lib/module/lib/react-native-polyfills.js.map +0 -1
  177. package/lib/module/lib/sonner-safe.js +0 -37
  178. package/lib/module/lib/sonner-safe.js.map +0 -1
  179. package/lib/module/lib/sonner.js +0 -8
  180. package/lib/module/lib/sonner.js.map +0 -1
  181. package/lib/module/lib/sonner.web.js +0 -4
  182. package/lib/module/lib/sonner.web.js.map +0 -1
  183. package/lib/module/models/interfaces.js +0 -2
  184. package/lib/module/models/interfaces.js.map +0 -1
  185. package/lib/module/models/secureSession.js +0 -2
  186. package/lib/module/models/secureSession.js.map +0 -1
  187. package/lib/module/node/index.js +0 -23
  188. package/lib/module/node/index.js.map +0 -1
  189. package/lib/module/package.json +0 -1
  190. package/lib/module/ui/components/Avatar.js +0 -93
  191. package/lib/module/ui/components/Avatar.js.map +0 -1
  192. package/lib/module/ui/components/FollowButton.js +0 -241
  193. package/lib/module/ui/components/FollowButton.js.map +0 -1
  194. package/lib/module/ui/components/FontLoader.js +0 -176
  195. package/lib/module/ui/components/FontLoader.js.map +0 -1
  196. package/lib/module/ui/components/GroupedItem.js +0 -104
  197. package/lib/module/ui/components/GroupedItem.js.map +0 -1
  198. package/lib/module/ui/components/GroupedSection.js +0 -28
  199. package/lib/module/ui/components/GroupedSection.js.map +0 -1
  200. package/lib/module/ui/components/OxyLogo.js +0 -49
  201. package/lib/module/ui/components/OxyLogo.js.map +0 -1
  202. package/lib/module/ui/components/OxyProvider.js +0 -511
  203. package/lib/module/ui/components/OxyProvider.js.map +0 -1
  204. package/lib/module/ui/components/OxySignInButton.js +0 -172
  205. package/lib/module/ui/components/OxySignInButton.js.map +0 -1
  206. package/lib/module/ui/components/ProfileCard.js +0 -119
  207. package/lib/module/ui/components/ProfileCard.js.map +0 -1
  208. package/lib/module/ui/components/QuickActions.js +0 -82
  209. package/lib/module/ui/components/QuickActions.js.map +0 -1
  210. package/lib/module/ui/components/Section.js +0 -31
  211. package/lib/module/ui/components/Section.js.map +0 -1
  212. package/lib/module/ui/components/SectionTitle.js +0 -30
  213. package/lib/module/ui/components/SectionTitle.js.map +0 -1
  214. package/lib/module/ui/components/bottomSheet/index.js +0 -5
  215. package/lib/module/ui/components/bottomSheet/index.js.map +0 -1
  216. package/lib/module/ui/components/icon/OxyIcon.js +0 -22
  217. package/lib/module/ui/components/icon/OxyIcon.js.map +0 -1
  218. package/lib/module/ui/components/icon/index.js +0 -4
  219. package/lib/module/ui/components/icon/index.js.map +0 -1
  220. package/lib/module/ui/components/index.js +0 -18
  221. package/lib/module/ui/components/index.js.map +0 -1
  222. package/lib/module/ui/context/OxyContext.js +0 -563
  223. package/lib/module/ui/context/OxyContext.js.map +0 -1
  224. package/lib/module/ui/index.js +0 -24
  225. package/lib/module/ui/index.js.map +0 -1
  226. package/lib/module/ui/navigation/OxyRouter.js +0 -257
  227. package/lib/module/ui/navigation/OxyRouter.js.map +0 -1
  228. package/lib/module/ui/navigation/types.js +0 -4
  229. package/lib/module/ui/navigation/types.js.map +0 -1
  230. package/lib/module/ui/screens/AccountCenterScreen.js +0 -308
  231. package/lib/module/ui/screens/AccountCenterScreen.js.map +0 -1
  232. package/lib/module/ui/screens/AccountManagementDemo.js +0 -296
  233. package/lib/module/ui/screens/AccountManagementDemo.js.map +0 -1
  234. package/lib/module/ui/screens/AccountOverviewScreen.js +0 -831
  235. package/lib/module/ui/screens/AccountOverviewScreen.js.map +0 -1
  236. package/lib/module/ui/screens/AccountSettingsScreen.js +0 -830
  237. package/lib/module/ui/screens/AccountSettingsScreen.js.map +0 -1
  238. package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -782
  239. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
  240. package/lib/module/ui/screens/AppInfoScreen.js +0 -658
  241. package/lib/module/ui/screens/AppInfoScreen.js.map +0 -1
  242. package/lib/module/ui/screens/BillingManagementScreen.js +0 -631
  243. package/lib/module/ui/screens/BillingManagementScreen.js.map +0 -1
  244. package/lib/module/ui/screens/FileManagementScreen.js +0 -2492
  245. package/lib/module/ui/screens/FileManagementScreen.js.map +0 -1
  246. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +0 -1615
  247. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +0 -1
  248. package/lib/module/ui/screens/ProfileScreen.js +0 -444
  249. package/lib/module/ui/screens/ProfileScreen.js.map +0 -1
  250. package/lib/module/ui/screens/SessionManagementScreen.js +0 -444
  251. package/lib/module/ui/screens/SessionManagementScreen.js.map +0 -1
  252. package/lib/module/ui/screens/SignInScreen.js +0 -950
  253. package/lib/module/ui/screens/SignInScreen.js.map +0 -1
  254. package/lib/module/ui/screens/SignUpScreen.js +0 -755
  255. package/lib/module/ui/screens/SignUpScreen.js.map +0 -1
  256. package/lib/module/ui/screens/karma/KarmaAboutScreen.js +0 -83
  257. package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +0 -1
  258. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +0 -358
  259. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +0 -1
  260. package/lib/module/ui/screens/karma/KarmaFAQScreen.js +0 -197
  261. package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +0 -1
  262. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +0 -142
  263. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +0 -1
  264. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +0 -122
  265. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +0 -1
  266. package/lib/module/ui/screens/karma/KarmaRulesScreen.js +0 -100
  267. package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +0 -1
  268. package/lib/module/ui/styles/FONTS.md +0 -126
  269. package/lib/module/ui/styles/fonts.js +0 -81
  270. package/lib/module/ui/styles/fonts.js.map +0 -1
  271. package/lib/module/ui/styles/index.js +0 -5
  272. package/lib/module/ui/styles/index.js.map +0 -1
  273. package/lib/module/ui/styles/theme.js +0 -114
  274. package/lib/module/ui/styles/theme.js.map +0 -1
  275. package/lib/module/utils/deviceManager.js +0 -167
  276. package/lib/module/utils/deviceManager.js.map +0 -1
  277. package/lib/module/utils/index.js +0 -4
  278. package/lib/module/utils/index.js.map +0 -1
  279. package/lib/module/utils/polyfills.js +0 -36
  280. package/lib/module/utils/polyfills.js.map +0 -1
  281. package/lib/typescript/assets/icons/OxyServices.d.ts +0 -29
  282. package/lib/typescript/assets/icons/OxyServices.d.ts.map +0 -1
  283. package/lib/typescript/constants/version.d.ts +0 -14
  284. package/lib/typescript/constants/version.d.ts.map +0 -1
  285. package/lib/typescript/core/index.d.ts +0 -563
  286. package/lib/typescript/core/index.d.ts.map +0 -1
  287. package/lib/typescript/index.d.ts +0 -20
  288. package/lib/typescript/index.d.ts.map +0 -1
  289. package/lib/typescript/lib/react-native-polyfills.d.ts +0 -8
  290. package/lib/typescript/lib/react-native-polyfills.d.ts.map +0 -1
  291. package/lib/typescript/lib/sonner-safe.d.ts +0 -11
  292. package/lib/typescript/lib/sonner-safe.d.ts.map +0 -1
  293. package/lib/typescript/lib/sonner.d.ts +0 -3
  294. package/lib/typescript/lib/sonner.d.ts.map +0 -1
  295. package/lib/typescript/lib/sonner.web.d.ts +0 -2
  296. package/lib/typescript/lib/sonner.web.d.ts.map +0 -1
  297. package/lib/typescript/models/interfaces.d.ts +0 -179
  298. package/lib/typescript/models/interfaces.d.ts.map +0 -1
  299. package/lib/typescript/models/secureSession.d.ts +0 -27
  300. package/lib/typescript/models/secureSession.d.ts.map +0 -1
  301. package/lib/typescript/node/index.d.ts +0 -11
  302. package/lib/typescript/node/index.d.ts.map +0 -1
  303. package/lib/typescript/ui/components/Avatar.d.ts +0 -62
  304. package/lib/typescript/ui/components/Avatar.d.ts.map +0 -1
  305. package/lib/typescript/ui/components/FollowButton.d.ts +0 -92
  306. package/lib/typescript/ui/components/FollowButton.d.ts.map +0 -1
  307. package/lib/typescript/ui/components/FontLoader.d.ts +0 -15
  308. package/lib/typescript/ui/components/FontLoader.d.ts.map +0 -1
  309. package/lib/typescript/ui/components/GroupedItem.d.ts +0 -17
  310. package/lib/typescript/ui/components/GroupedItem.d.ts.map +0 -1
  311. package/lib/typescript/ui/components/GroupedSection.d.ts +0 -19
  312. package/lib/typescript/ui/components/GroupedSection.d.ts.map +0 -1
  313. package/lib/typescript/ui/components/OxyLogo.d.ts +0 -29
  314. package/lib/typescript/ui/components/OxyLogo.d.ts.map +0 -1
  315. package/lib/typescript/ui/components/OxyProvider.d.ts +0 -12
  316. package/lib/typescript/ui/components/OxyProvider.d.ts.map +0 -1
  317. package/lib/typescript/ui/components/OxySignInButton.d.ts +0 -70
  318. package/lib/typescript/ui/components/OxySignInButton.d.ts.map +0 -1
  319. package/lib/typescript/ui/components/ProfileCard.d.ts +0 -20
  320. package/lib/typescript/ui/components/ProfileCard.d.ts.map +0 -1
  321. package/lib/typescript/ui/components/QuickActions.d.ts +0 -15
  322. package/lib/typescript/ui/components/QuickActions.d.ts.map +0 -1
  323. package/lib/typescript/ui/components/Section.d.ts +0 -11
  324. package/lib/typescript/ui/components/Section.d.ts.map +0 -1
  325. package/lib/typescript/ui/components/SectionTitle.d.ts +0 -9
  326. package/lib/typescript/ui/components/SectionTitle.d.ts.map +0 -1
  327. package/lib/typescript/ui/components/bottomSheet/index.d.ts +0 -4
  328. package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +0 -1
  329. package/lib/typescript/ui/components/icon/OxyIcon.d.ts +0 -10
  330. package/lib/typescript/ui/components/icon/OxyIcon.d.ts.map +0 -1
  331. package/lib/typescript/ui/components/icon/index.d.ts +0 -3
  332. package/lib/typescript/ui/components/icon/index.d.ts.map +0 -1
  333. package/lib/typescript/ui/components/index.d.ts +0 -13
  334. package/lib/typescript/ui/components/index.d.ts.map +0 -1
  335. package/lib/typescript/ui/context/OxyContext.d.ts +0 -42
  336. package/lib/typescript/ui/context/OxyContext.d.ts.map +0 -1
  337. package/lib/typescript/ui/index.d.ts +0 -15
  338. package/lib/typescript/ui/index.d.ts.map +0 -1
  339. package/lib/typescript/ui/navigation/OxyRouter.d.ts +0 -5
  340. package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +0 -1
  341. package/lib/typescript/ui/navigation/types.d.ts +0 -116
  342. package/lib/typescript/ui/navigation/types.d.ts.map +0 -1
  343. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts +0 -5
  344. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +0 -1
  345. package/lib/typescript/ui/screens/AccountManagementDemo.d.ts +0 -8
  346. package/lib/typescript/ui/screens/AccountManagementDemo.d.ts.map +0 -1
  347. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts +0 -5
  348. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +0 -1
  349. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts +0 -5
  350. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +0 -1
  351. package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts +0 -5
  352. package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  353. package/lib/typescript/ui/screens/AppInfoScreen.d.ts +0 -5
  354. package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +0 -1
  355. package/lib/typescript/ui/screens/BillingManagementScreen.d.ts +0 -5
  356. package/lib/typescript/ui/screens/BillingManagementScreen.d.ts.map +0 -1
  357. package/lib/typescript/ui/screens/FileManagementScreen.d.ts +0 -8
  358. package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +0 -1
  359. package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts +0 -5
  360. package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +0 -1
  361. package/lib/typescript/ui/screens/ProfileScreen.d.ts +0 -9
  362. package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +0 -1
  363. package/lib/typescript/ui/screens/SessionManagementScreen.d.ts +0 -5
  364. package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +0 -1
  365. package/lib/typescript/ui/screens/SignInScreen.d.ts +0 -5
  366. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +0 -1
  367. package/lib/typescript/ui/screens/SignUpScreen.d.ts +0 -5
  368. package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +0 -1
  369. package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts +0 -5
  370. package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +0 -1
  371. package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts +0 -5
  372. package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +0 -1
  373. package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts +0 -5
  374. package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts.map +0 -1
  375. package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts +0 -5
  376. package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +0 -1
  377. package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts +0 -5
  378. package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +0 -1
  379. package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts +0 -5
  380. package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts.map +0 -1
  381. package/lib/typescript/ui/styles/fonts.d.ts +0 -21
  382. package/lib/typescript/ui/styles/fonts.d.ts.map +0 -1
  383. package/lib/typescript/ui/styles/index.d.ts +0 -3
  384. package/lib/typescript/ui/styles/index.d.ts.map +0 -1
  385. package/lib/typescript/ui/styles/theme.d.ts +0 -68
  386. package/lib/typescript/ui/styles/theme.d.ts.map +0 -1
  387. package/lib/typescript/utils/deviceManager.d.ts +0 -66
  388. package/lib/typescript/utils/deviceManager.d.ts.map +0 -1
  389. package/lib/typescript/utils/index.d.ts +0 -3
  390. package/lib/typescript/utils/index.d.ts.map +0 -1
  391. package/lib/typescript/utils/polyfills.d.ts +0 -6
  392. package/lib/typescript/utils/polyfills.d.ts.map +0 -1
  393. package/src/lib/react-native-polyfills.ts +0 -219
  394. package/src/lib/sonner-safe.ts +0 -37
  395. package/src/lib/sonner.web.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/services",
3
- "version": "5.4.0",
3
+ "version": "5.4.2",
4
4
  "description": "Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀",
5
5
  "main": "lib/commonjs/node/index.js",
6
6
  "module": "lib/module/node/index.js",
@@ -69,6 +69,7 @@
69
69
  },
70
70
  "dependencies": {
71
71
  "@gorhom/bottom-sheet": "^5.1.6",
72
+ "@oxyhq/services": "^5.4.0",
72
73
  "@react-native-async-storage/async-storage": "^2.1.2",
73
74
  "axios": "^1.9.0",
74
75
  "expo-font": "^13.3.1",
@@ -148,4 +149,4 @@
148
149
  "react-native-gesture-handler": "^2.20.2",
149
150
  "react-native-reanimated": "^3.16.1"
150
151
  }
151
- }
152
+ }
@@ -15,10 +15,10 @@ jest.mock('../../../ui/context/OxyContext', () => ({
15
15
  avatar: { url: 'https://example.com/avatar.jpg' }
16
16
  },
17
17
  oxyServices: {
18
- updateUser: jest.fn(() => Promise.resolve({
19
- id: '123',
20
- username: 'testuser',
21
- email: 'test@example.com'
18
+ updateProfile: jest.fn(() => Promise.resolve({
19
+ id: '123',
20
+ username: 'testuser',
21
+ email: 'test@example.com'
22
22
  }))
23
23
  },
24
24
  isLoading: false
@@ -31,10 +31,10 @@ jest.mock('../../../ui/components/Avatar', () => 'Avatar');
31
31
 
32
32
  describe('AccountSettingsScreen', () => {
33
33
  const mockOxyServices = {
34
- updateUser: jest.fn(() => Promise.resolve({
35
- id: '123',
36
- username: 'testuser',
37
- email: 'test@example.com'
34
+ updateProfile: jest.fn(() => Promise.resolve({
35
+ id: '123',
36
+ username: 'testuser',
37
+ email: 'test@example.com'
38
38
  }))
39
39
  } as unknown as OxyServices;
40
40
 
package/src/core/index.ts CHANGED
@@ -153,6 +153,14 @@ export class OxyServices {
153
153
  );
154
154
  }
155
155
 
156
+ /**
157
+ * Gets the base URL configured for this OxyServices instance
158
+ * @returns The base URL
159
+ */
160
+ public getBaseURL(): string {
161
+ return this.client.defaults.baseURL || '';
162
+ }
163
+
156
164
  /**
157
165
  * Gets the currently authenticated user ID from the token
158
166
  * @returns The user ID or null if not authenticated
@@ -484,6 +492,33 @@ export class OxyServices {
484
492
  }
485
493
  }
486
494
 
495
+ /**
496
+ * Get the currently authenticated user's profile
497
+ * @returns User data for the current user
498
+ */
499
+ async getCurrentUser(): Promise<User> {
500
+ try {
501
+ const res = await this.client.get('/users/me');
502
+ return res.data;
503
+ } catch (error) {
504
+ throw this.handleError(error);
505
+ }
506
+ }
507
+
508
+ /**
509
+ * Update the authenticated user's profile
510
+ * @param updates - Object containing fields to update
511
+ * @returns Updated user data
512
+ */
513
+ async updateProfile(updates: Record<string, any>): Promise<User> {
514
+ try {
515
+ const res = await this.client.put('/users/me', updates);
516
+ return res.data;
517
+ } catch (error) {
518
+ throw this.handleError(error);
519
+ }
520
+ }
521
+
487
522
  /**
488
523
  * Update user profile (requires auth)
489
524
  * @param userId - User ID to update (must match authenticated user or have admin rights)
@@ -1554,6 +1589,74 @@ export class OxyServices {
1554
1589
 
1555
1590
  return apiError;
1556
1591
  }
1592
+
1593
+ /**
1594
+ * Check if a username is available
1595
+ * @param username - The username to check
1596
+ * @returns Promise with availability status
1597
+ */
1598
+ async checkUsernameAvailability(username: string): Promise<{ available: boolean; message: string }> {
1599
+ try {
1600
+ const res = await this.client.get(`/auth/check-username/${username}`);
1601
+ return res.data;
1602
+ } catch (error: any) {
1603
+ // If the endpoint doesn't exist, fall back to basic validation
1604
+ if (error.response?.status === 404) {
1605
+ console.warn('Username validation endpoint not found, using fallback validation');
1606
+ return { available: true, message: 'Username validation not available' };
1607
+ }
1608
+
1609
+ // If it's a validation error (400), return the error message
1610
+ if (error.response?.status === 400) {
1611
+ return error.response.data;
1612
+ }
1613
+
1614
+ // For other errors, log and return a fallback
1615
+ console.error('Username validation error:', error);
1616
+ return { available: true, message: 'Unable to validate username' };
1617
+ }
1618
+ }
1619
+
1620
+ /**
1621
+ * Check if an email is available
1622
+ * @param email - The email to check
1623
+ * @returns Promise with availability status
1624
+ */
1625
+ async checkEmailAvailability(email: string): Promise<{ available: boolean; message: string }> {
1626
+ try {
1627
+ const res = await this.client.post('/auth/check-email', { email });
1628
+ return res.data;
1629
+ } catch (error: any) {
1630
+ // If the endpoint doesn't exist, fall back to basic validation
1631
+ if (error.response?.status === 404) {
1632
+ console.warn('Email validation endpoint not found, using fallback validation');
1633
+ return { available: true, message: 'Email validation not available' };
1634
+ }
1635
+
1636
+ // If it's a validation error (400), return the error message
1637
+ if (error.response?.status === 400) {
1638
+ return error.response.data;
1639
+ }
1640
+
1641
+ // For other errors, log and return a fallback
1642
+ console.error('Email validation error:', error);
1643
+ return { available: true, message: 'Unable to validate email' };
1644
+ }
1645
+ }
1646
+
1647
+ /**
1648
+ * Get user profile by username
1649
+ * @param username - The username to look up
1650
+ * @returns Promise with user profile
1651
+ */
1652
+ async getUserProfileByUsername(username: string): Promise<User> {
1653
+ try {
1654
+ const res = await this.client.get(`/profiles/username/${username}`);
1655
+ return res.data;
1656
+ } catch (error) {
1657
+ throw this.handleError(error);
1658
+ }
1659
+ }
1557
1660
  }
1558
1661
 
1559
1662
  export default OxyServices;
package/src/lib/sonner.ts CHANGED
@@ -1,5 +1,10 @@
1
- // Import polyfills for React Native before importing sonner-native
2
- import './react-native-polyfills';
1
+ import { Platform } from 'react-native';
2
+ import * as WebSonner from 'sonner';
3
+ import * as NativeSonner from 'sonner-native';
3
4
 
4
- // Use the safe wrapper that handles potential import failures
5
- export * from './sonner-safe';
5
+ const { toast: webToast, Toaster: WebToaster } = WebSonner as any;
6
+ const { toast: nativeToast, Toaster: NativeToaster } = NativeSonner as any;
7
+
8
+ export const toast = Platform.OS === 'web' ? webToast : nativeToast;
9
+ export const Toaster = Platform.OS === 'web' ? WebToaster : NativeToaster;
10
+ export type ToastT = typeof webToast;
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useRef, useState, useEffect } from 'react';
1
+ import React, { useCallback, useRef, useState, useEffect, useMemo } from 'react';
2
2
  import { View, Text, StyleSheet, Dimensions, Platform, Animated, StatusBar, Keyboard, KeyboardEvent } from 'react-native';
3
3
  import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context';
4
4
  import { GestureHandlerRootView } from 'react-native-gesture-handler';
@@ -303,8 +303,8 @@ const OxyBottomSheet: React.FC<OxyProviderProps> = ({
303
303
  []
304
304
  );
305
305
 
306
- // Background style based on theme
307
- const getBackgroundStyle = () => {
306
+ // Memoize background style based on theme to prevent recalculation on every render
307
+ const backgroundStyle = useMemo(() => {
308
308
  const baseColor = customStyles.backgroundColor || (theme === 'light' ? '#FFFFFF' : '#121212');
309
309
  return {
310
310
  backgroundColor: baseColor,
@@ -317,7 +317,7 @@ const OxyBottomSheet: React.FC<OxyProviderProps> = ({
317
317
  }
318
318
  })
319
319
  };
320
- };
320
+ }, [customStyles.backgroundColor, theme]);
321
321
 
322
322
  // Method to adjust snap points from Router
323
323
  const adjustSnapPoints = useCallback((points: string[]) => {
@@ -398,7 +398,7 @@ const OxyBottomSheet: React.FC<OxyProviderProps> = ({
398
398
  enablePanDownToClose
399
399
  backdropComponent={renderBackdrop}
400
400
  backgroundStyle={[
401
- getBackgroundStyle(),
401
+ backgroundStyle,
402
402
  {
403
403
  borderTopLeftRadius: 35,
404
404
  borderTopRightRadius: 35,
@@ -161,11 +161,11 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
161
161
 
162
162
  if (sessionsData) {
163
163
  const parsedSessions: SecureClientSession[] = JSON.parse(sessionsData);
164
-
164
+
165
165
  // Migrate old session format to include user info
166
166
  const migratedSessions: SecureClientSession[] = [];
167
167
  let shouldUpdateStorage = false;
168
-
168
+
169
169
  for (const session of parsedSessions) {
170
170
  if (!session.userId || !session.username) {
171
171
  // Session is missing user info, try to fetch it
@@ -188,31 +188,31 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
188
188
  migratedSessions.push(session);
189
189
  }
190
190
  }
191
-
191
+
192
192
  // Update storage if we made changes
193
193
  if (shouldUpdateStorage) {
194
194
  await saveSessionsToStorage(migratedSessions);
195
195
  }
196
-
196
+
197
197
  setSessions(migratedSessions);
198
198
 
199
199
  if (storedActiveSessionId && migratedSessions.length > 0) {
200
200
  const activeSession = migratedSessions.find(s => s.sessionId === storedActiveSessionId);
201
-
201
+
202
202
  if (activeSession) {
203
203
  console.log('SecureAuth - activeSession found:', activeSession);
204
-
204
+
205
205
  // Validate session
206
206
  try {
207
207
  const validation = await oxyServices.validateSession(activeSession.sessionId);
208
-
208
+
209
209
  if (validation.valid) {
210
210
  console.log('SecureAuth - session validated successfully');
211
211
  setActiveSessionId(activeSession.sessionId);
212
-
212
+
213
213
  // Get access token for API calls
214
214
  await oxyServices.getTokenBySession(activeSession.sessionId);
215
-
215
+
216
216
  // Load full user data
217
217
  const fullUser = await oxyServices.getUserBySession(activeSession.sessionId);
218
218
  setUser(fullUser);
@@ -221,7 +221,7 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
221
221
  username: fullUser.username,
222
222
  avatar: fullUser.avatar
223
223
  });
224
-
224
+
225
225
  if (onAuthStateChange) {
226
226
  onAuthStateChange(fullUser);
227
227
  }
@@ -254,7 +254,7 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
254
254
  const filteredSessions = sessions.filter(s => s.sessionId !== sessionId);
255
255
  setSessions(filteredSessions);
256
256
  await saveSessionsToStorage(filteredSessions);
257
-
257
+
258
258
  // If there are other sessions, switch to the first one
259
259
  if (filteredSessions.length > 0) {
260
260
  await switchToSession(filteredSessions[0].sessionId);
@@ -264,7 +264,7 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
264
264
  setUser(null);
265
265
  setMinimalUser(null);
266
266
  await storage?.removeItem(keys.activeSessionId);
267
-
267
+
268
268
  if (onAuthStateChange) {
269
269
  onAuthStateChange(null);
270
270
  }
@@ -298,13 +298,13 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
298
298
  const switchToSession = useCallback(async (sessionId: string): Promise<void> => {
299
299
  try {
300
300
  setIsLoading(true);
301
-
301
+
302
302
  // Get access token for this session
303
303
  await oxyServices.getTokenBySession(sessionId);
304
-
304
+
305
305
  // Load full user data
306
306
  const fullUser = await oxyServices.getUserBySession(sessionId);
307
-
307
+
308
308
  setActiveSessionId(sessionId);
309
309
  setUser(fullUser);
310
310
  setMinimalUser({
@@ -312,9 +312,9 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
312
312
  username: fullUser.username,
313
313
  avatar: fullUser.avatar
314
314
  });
315
-
315
+
316
316
  await saveActiveSessionId(sessionId);
317
-
317
+
318
318
  if (onAuthStateChange) {
319
319
  onAuthStateChange(fullUser);
320
320
  }
@@ -336,20 +336,20 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
336
336
  try {
337
337
  // Get device fingerprint for enhanced device identification
338
338
  const deviceFingerprint = DeviceManager.getDeviceFingerprint();
339
-
339
+
340
340
  // Get or generate persistent device info
341
341
  const deviceInfo = await DeviceManager.getDeviceInfo();
342
-
342
+
343
343
  console.log('SecureAuth - Using device fingerprint:', deviceFingerprint);
344
344
  console.log('SecureAuth - Using device ID:', deviceInfo.deviceId);
345
345
 
346
346
  const response: SecureLoginResponse = await oxyServices.secureLogin(
347
- username,
348
- password,
347
+ username,
348
+ password,
349
349
  deviceName || deviceInfo.deviceName || DeviceManager.getDefaultDeviceName(),
350
350
  deviceFingerprint
351
351
  );
352
-
352
+
353
353
  // Create client session object with user info for duplicate detection
354
354
  const clientSession: SecureClientSession = {
355
355
  sessionId: response.sessionId,
@@ -361,20 +361,20 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
361
361
  };
362
362
 
363
363
  // Check if this user already has a session (prevent duplicate accounts)
364
- const existingUserSessionIndex = sessions.findIndex(s =>
364
+ const existingUserSessionIndex = sessions.findIndex(s =>
365
365
  s.userId === response.user.id || s.username === response.user.username
366
366
  );
367
367
 
368
368
  let updatedSessions: SecureClientSession[];
369
-
369
+
370
370
  if (existingUserSessionIndex !== -1) {
371
371
  // User already has a session - replace it with the new one (reused session scenario)
372
372
  const existingSession = sessions[existingUserSessionIndex];
373
373
  updatedSessions = [...sessions];
374
374
  updatedSessions[existingUserSessionIndex] = clientSession;
375
-
375
+
376
376
  console.log(`Reusing/updating existing session for user ${response.user.username}. Previous session: ${existingSession.sessionId}, New session: ${response.sessionId}`);
377
-
377
+
378
378
  // If the replaced session was the active one, update active session
379
379
  if (activeSessionId === existingSession.sessionId) {
380
380
  setActiveSessionId(response.sessionId);
@@ -438,7 +438,7 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
438
438
  setUser(null);
439
439
  setMinimalUser(null);
440
440
  await storage?.removeItem(keys.activeSessionId);
441
-
441
+
442
442
  if (onAuthStateChange) {
443
443
  onAuthStateChange(null);
444
444
  }
@@ -453,7 +453,7 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
453
453
  // Logout all sessions
454
454
  const logoutAll = async (): Promise<void> => {
455
455
  console.log('logoutAll called with activeSessionId:', activeSessionId);
456
-
456
+
457
457
  if (!activeSessionId) {
458
458
  console.error('No active session ID found, cannot logout all');
459
459
  setError('No active session found');
@@ -470,7 +470,7 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
470
470
  console.log('Calling oxyServices.logoutAllSecureSessions with sessionId:', activeSessionId);
471
471
  await oxyServices.logoutAllSecureSessions(activeSessionId);
472
472
  console.log('logoutAllSecureSessions completed successfully');
473
-
473
+
474
474
  // Clear all local data
475
475
  setSessions([]);
476
476
  setActiveSessionId(null);
@@ -478,7 +478,7 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
478
478
  setMinimalUser(null);
479
479
  await clearAllStorage();
480
480
  console.log('Local storage cleared');
481
-
481
+
482
482
  if (onAuthStateChange) {
483
483
  onAuthStateChange(null);
484
484
  console.log('Auth state change callback called');
@@ -490,10 +490,30 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
490
490
  }
491
491
  };
492
492
 
493
- // Sign up method (placeholder - you can implement based on your needs)
493
+ // Sign up method
494
494
  const signUp = async (username: string, email: string, password: string): Promise<User> => {
495
- // Implement sign up logic similar to secureLogin
496
- throw new Error('Sign up not implemented yet');
495
+ if (!storage) throw new Error('Storage not initialized');
496
+
497
+ setIsLoading(true);
498
+ setError(null);
499
+
500
+ try {
501
+ // Create new account using the OxyServices signUp method
502
+ const response = await oxyServices.signUp(username, email, password);
503
+
504
+ console.log('SignUp successful:', response);
505
+
506
+ // Now log the user in securely to create a session
507
+ // This will handle the session creation and device registration
508
+ const user = await login(username, password);
509
+
510
+ return user;
511
+ } catch (error: any) {
512
+ setError(error.message || 'Sign up failed');
513
+ throw error;
514
+ } finally {
515
+ setIsLoading(false);
516
+ }
497
517
  };
498
518
 
499
519
  // Switch session method
@@ -512,7 +532,7 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
512
532
 
513
533
  try {
514
534
  const serverSessions = await oxyServices.getSessionsBySessionId(activeSessionId);
515
-
535
+
516
536
  // Update local sessions with server data
517
537
  const updatedSessions: SecureClientSession[] = serverSessions.map(serverSession => ({
518
538
  sessionId: serverSession.sessionId,
@@ -520,7 +540,7 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
520
540
  expiresAt: new Date().toISOString(), // You might want to get this from server
521
541
  lastActive: new Date().toISOString()
522
542
  }));
523
-
543
+
524
544
  setSessions(updatedSessions);
525
545
  await saveSessionsToStorage(updatedSessions);
526
546
  } catch (error) {
@@ -545,14 +565,14 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
545
565
 
546
566
  try {
547
567
  await oxyServices.logoutAllDeviceSessions(activeSessionId);
548
-
568
+
549
569
  // Clear all local sessions since we logged out from all devices
550
570
  setSessions([]);
551
571
  setActiveSessionId(null);
552
572
  setUser(null);
553
573
  setMinimalUser(null);
554
574
  await clearAllStorage();
555
-
575
+
556
576
  if (onAuthStateChange) {
557
577
  onAuthStateChange(null);
558
578
  }
@@ -567,7 +587,7 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
567
587
 
568
588
  try {
569
589
  await oxyServices.updateDeviceName(activeSessionId, deviceName);
570
-
590
+
571
591
  // Update local device info
572
592
  await DeviceManager.updateDeviceName(deviceName);
573
593
  } catch (error) {
@@ -579,10 +599,10 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
579
599
  // Bottom sheet control methods
580
600
  const showBottomSheet = useCallback((screenOrConfig?: string | { screen: string; props?: Record<string, any> }) => {
581
601
  console.log('showBottomSheet called with:', screenOrConfig);
582
-
602
+
583
603
  if (bottomSheetRef?.current) {
584
604
  console.log('bottomSheetRef is available');
585
-
605
+
586
606
  // First, show the bottom sheet
587
607
  if (bottomSheetRef.current.expand) {
588
608
  console.log('Expanding bottom sheet');
@@ -593,7 +613,7 @@ export const OxyContextProvider: React.FC<OxyContextProviderProps> = ({
593
613
  } else {
594
614
  console.warn('No expand or present method available on bottomSheetRef');
595
615
  }
596
-
616
+
597
617
  // Then navigate to the specified screen if provided
598
618
  if (screenOrConfig) {
599
619
  // Add a small delay to ensure the bottom sheet is opened first
@@ -9,7 +9,7 @@ import { OxyServices } from '../../core';
9
9
  */
10
10
  const AccountManagementDemo: React.FC = () => {
11
11
  const oxyServices = new OxyServices({
12
- baseURL: 'http://localhost:3001'
12
+ baseURL: 'https://api.oxy.so'
13
13
  });
14
14
 
15
15
  return (
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useMemo, useCallback } from 'react';
2
2
  import {
3
3
  View,
4
4
  Text,
@@ -20,6 +20,15 @@ import { fontFamilies } from '../styles/fonts';
20
20
  import { toast } from '../../lib/sonner';
21
21
  import { Ionicons } from '@expo/vector-icons';
22
22
 
23
+ /**
24
+ * AccountOverviewScreen - Optimized for performance
25
+ *
26
+ * Performance optimizations implemented:
27
+ * - useMemo for theme calculations (only recalculates when theme changes)
28
+ * - useMemo for additional accounts filtering (only recalculates when dependencies change)
29
+ * - useCallback for event handlers to prevent unnecessary re-renders
30
+ * - React.memo wrapper to prevent re-renders when props haven't changed
31
+ */
23
32
  const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
24
33
  onClose,
25
34
  theme,
@@ -30,18 +39,26 @@ const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
30
39
  const [additionalAccountsData, setAdditionalAccountsData] = useState<any[]>([]);
31
40
  const [loadingAdditionalAccounts, setLoadingAdditionalAccounts] = useState(false);
32
41
 
33
- const isDarkTheme = theme === 'dark';
34
- const textColor = isDarkTheme ? '#FFFFFF' : '#000000';
35
- const backgroundColor = isDarkTheme ? '#121212' : '#FFFFFF';
36
- const secondaryBackgroundColor = isDarkTheme ? '#222222' : '#F5F5F5';
37
- const borderColor = isDarkTheme ? '#444444' : '#E0E0E0';
38
- const primaryColor = '#d169e5';
39
- const dangerColor = '#D32F2F';
40
- const iconColor = isDarkTheme ? '#BBBBBB' : '#666666';
41
-
42
- // Get additional accounts from sessions (excluding current user)
43
- const additionalAccounts = sessions.filter(session =>
44
- session.sessionId !== activeSessionId && session.userId !== user?.id
42
+ // Memoize theme-related calculations to prevent unnecessary recalculations
43
+ const themeStyles = useMemo(() => {
44
+ const isDarkTheme = theme === 'dark';
45
+ return {
46
+ isDarkTheme,
47
+ textColor: isDarkTheme ? '#FFFFFF' : '#000000',
48
+ backgroundColor: isDarkTheme ? '#121212' : '#FFFFFF',
49
+ secondaryBackgroundColor: isDarkTheme ? '#222222' : '#F5F5F5',
50
+ borderColor: isDarkTheme ? '#444444' : '#E0E0E0',
51
+ primaryColor: '#d169e5',
52
+ dangerColor: '#D32F2F',
53
+ iconColor: isDarkTheme ? '#BBBBBB' : '#666666',
54
+ };
55
+ }, [theme]);
56
+
57
+ // Memoize additional accounts filtering to prevent recalculation on every render
58
+ const additionalAccounts = useMemo(() =>
59
+ sessions.filter(session =>
60
+ session.sessionId !== activeSessionId && session.userId !== user?.id
61
+ ), [sessions, activeSessionId, user?.id]
45
62
  );
46
63
 
47
64
  // Load user profiles for additional accounts
@@ -98,7 +115,8 @@ const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
98
115
  language: 'English',
99
116
  };
100
117
 
101
- const handleLogout = async () => {
118
+ // Memoize event handlers to prevent recreation on every render
119
+ const handleLogout = useCallback(async () => {
102
120
  try {
103
121
  await logout();
104
122
  if (onClose) {
@@ -108,9 +126,9 @@ const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
108
126
  console.error('Logout failed:', error);
109
127
  toast.error('There was a problem signing you out. Please try again.');
110
128
  }
111
- };
129
+ }, [logout, onClose]);
112
130
 
113
- const confirmLogout = () => {
131
+ const confirmLogout = useCallback(() => {
114
132
  Alert.alert(
115
133
  'Sign Out',
116
134
  'Are you sure you want to sign out?',
@@ -127,13 +145,13 @@ const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
127
145
  ],
128
146
  { cancelable: true }
129
147
  );
130
- };
148
+ }, [handleLogout]);
131
149
 
132
- const handleAddAccount = () => {
150
+ const handleAddAccount = useCallback(() => {
133
151
  toast.info('Add another account feature coming soon!');
134
- };
152
+ }, []);
135
153
 
136
- const handleSignOutAll = () => {
154
+ const handleSignOutAll = useCallback(() => {
137
155
  Alert.alert(
138
156
  'Sign Out of All Accounts',
139
157
  'Are you sure you want to sign out of all accounts?',
@@ -150,20 +168,20 @@ const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
150
168
  ],
151
169
  { cancelable: true }
152
170
  );
153
- };
171
+ }, [handleLogout]);
154
172
 
155
173
  if (!user) {
156
174
  return (
157
- <View style={[styles.container, { backgroundColor }]}>
158
- <Text style={[styles.message, { color: textColor }]}>Not signed in</Text>
175
+ <View style={[styles.container, { backgroundColor: themeStyles.backgroundColor }]}>
176
+ <Text style={[styles.message, { color: themeStyles.textColor }]}>Not signed in</Text>
159
177
  </View>
160
178
  );
161
179
  }
162
180
 
163
181
  if (isLoading) {
164
182
  return (
165
- <View style={[styles.container, { backgroundColor, justifyContent: 'center' }]}>
166
- <ActivityIndicator size="large" color={primaryColor} />
183
+ <View style={[styles.container, { backgroundColor: themeStyles.backgroundColor, justifyContent: 'center' }]}>
184
+ <ActivityIndicator size="large" color={themeStyles.primaryColor} />
167
185
  </View>
168
186
  );
169
187
  }
@@ -676,4 +694,4 @@ const styles = StyleSheet.create({
676
694
  },
677
695
  });
678
696
 
679
- export default AccountOverviewScreen;
697
+ export default React.memo(AccountOverviewScreen);