@oxyhq/services 5.5.8 → 5.6.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 (388) hide show
  1. package/README.md +16 -2
  2. package/lib/commonjs/core/index.js +69 -82
  3. package/lib/commonjs/core/index.js.map +1 -1
  4. package/lib/commonjs/index.js +24 -183
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/node/index.js +0 -2
  7. package/lib/commonjs/node/index.js.map +1 -1
  8. package/lib/commonjs/ui/components/FollowButton.js +100 -229
  9. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  10. package/lib/commonjs/ui/components/OxyPayButton.js +131 -0
  11. package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -0
  12. package/lib/commonjs/ui/components/OxyProvider.js +41 -198
  13. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  14. package/lib/commonjs/ui/components/OxySignInButton.js +15 -2
  15. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  16. package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js +66 -0
  17. package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js.map +1 -0
  18. package/lib/commonjs/ui/components/icon/index.js +7 -0
  19. package/lib/commonjs/ui/components/icon/index.js.map +1 -1
  20. package/lib/commonjs/ui/components/index.js +7 -0
  21. package/lib/commonjs/ui/components/index.js.map +1 -1
  22. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +14 -7
  23. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
  24. package/lib/commonjs/ui/components/internal/PinInput.js +108 -0
  25. package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -0
  26. package/lib/commonjs/ui/components/internal/TextField.js +20 -0
  27. package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
  28. package/lib/commonjs/ui/context/OxyContext.js +26 -23
  29. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  30. package/lib/commonjs/ui/hooks/index.js +2 -15
  31. package/lib/commonjs/ui/hooks/index.js.map +1 -1
  32. package/lib/commonjs/ui/hooks/useFollow.js +52 -136
  33. package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
  34. package/lib/commonjs/ui/hooks/useSessionSocket.js +52 -0
  35. package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -0
  36. package/lib/commonjs/ui/index.js +8 -191
  37. package/lib/commonjs/ui/index.js.map +1 -1
  38. package/lib/commonjs/ui/navigation/OxyRouter.js +52 -60
  39. package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
  40. package/lib/commonjs/ui/screens/AccountCenterScreen.js +18 -30
  41. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  42. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +4 -22
  43. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  44. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +6 -14
  45. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  46. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +37 -66
  47. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  48. package/lib/commonjs/ui/screens/AppInfoScreen.js +21 -44
  49. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  50. package/lib/commonjs/ui/screens/FeedbackScreen.js +44 -23
  51. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  52. package/lib/commonjs/ui/screens/FileManagementScreen.js +59 -78
  53. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  54. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +1588 -0
  55. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -0
  56. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +22 -36
  57. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  58. package/lib/commonjs/ui/screens/RecoverAccountScreen.js +269 -0
  59. package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -0
  60. package/lib/commonjs/ui/screens/SessionManagementScreen.js +47 -69
  61. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
  62. package/lib/commonjs/ui/screens/SignInScreen.js +99 -333
  63. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  64. package/lib/commonjs/ui/screens/SignUpScreen.js +136 -340
  65. package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
  66. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +192 -0
  67. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -0
  68. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +135 -0
  69. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -0
  70. package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +108 -0
  71. package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -0
  72. package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +126 -0
  73. package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -0
  74. package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js +84 -0
  75. package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js.map +1 -0
  76. package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js +59 -0
  77. package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js.map +1 -0
  78. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +15 -2
  79. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  80. package/lib/commonjs/ui/stores/authStore.js +31 -0
  81. package/lib/commonjs/ui/stores/authStore.js.map +1 -0
  82. package/lib/commonjs/ui/stores/followStore.js +124 -0
  83. package/lib/commonjs/ui/stores/followStore.js.map +1 -0
  84. package/lib/commonjs/ui/styles/index.js +0 -11
  85. package/lib/commonjs/ui/styles/index.js.map +1 -1
  86. package/lib/commonjs/ui/utils/confirmAction.js +28 -0
  87. package/lib/commonjs/ui/utils/confirmAction.js.map +1 -0
  88. package/lib/module/core/index.js +69 -81
  89. package/lib/module/core/index.js.map +1 -1
  90. package/lib/module/index.js +14 -17
  91. package/lib/module/index.js.map +1 -1
  92. package/lib/module/node/index.js +0 -3
  93. package/lib/module/node/index.js.map +1 -1
  94. package/lib/module/ui/components/FollowButton.js +100 -229
  95. package/lib/module/ui/components/FollowButton.js.map +1 -1
  96. package/lib/module/ui/components/OxyPayButton.js +125 -0
  97. package/lib/module/ui/components/OxyPayButton.js.map +1 -0
  98. package/lib/module/ui/components/OxyProvider.js +42 -199
  99. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  100. package/lib/module/ui/components/OxySignInButton.js +15 -2
  101. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  102. package/lib/module/ui/components/icon/FAIRWalletIcon.js +60 -0
  103. package/lib/module/ui/components/icon/FAIRWalletIcon.js.map +1 -0
  104. package/lib/module/ui/components/icon/index.js +1 -0
  105. package/lib/module/ui/components/icon/index.js.map +1 -1
  106. package/lib/module/ui/components/index.js +1 -0
  107. package/lib/module/ui/components/index.js.map +1 -1
  108. package/lib/module/ui/components/internal/GroupedPillButtons.js +15 -8
  109. package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
  110. package/lib/module/ui/components/internal/PinInput.js +103 -0
  111. package/lib/module/ui/components/internal/PinInput.js.map +1 -0
  112. package/lib/module/ui/components/internal/TextField.js +20 -0
  113. package/lib/module/ui/components/internal/TextField.js.map +1 -1
  114. package/lib/module/ui/context/OxyContext.js +26 -23
  115. package/lib/module/ui/context/OxyContext.js.map +1 -1
  116. package/lib/module/ui/hooks/index.js +1 -2
  117. package/lib/module/ui/hooks/index.js.map +1 -1
  118. package/lib/module/ui/hooks/useFollow.js +52 -137
  119. package/lib/module/ui/hooks/useFollow.js.map +1 -1
  120. package/lib/module/ui/hooks/useSessionSocket.js +47 -0
  121. package/lib/module/ui/hooks/useSessionSocket.js.map +1 -0
  122. package/lib/module/ui/index.js +2 -13
  123. package/lib/module/ui/index.js.map +1 -1
  124. package/lib/module/ui/navigation/OxyRouter.js +53 -61
  125. package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
  126. package/lib/module/ui/screens/AccountCenterScreen.js +6 -18
  127. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  128. package/lib/module/ui/screens/AccountOverviewScreen.js +5 -23
  129. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  130. package/lib/module/ui/screens/AccountSettingsScreen.js +7 -15
  131. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  132. package/lib/module/ui/screens/AccountSwitcherScreen.js +38 -67
  133. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  134. package/lib/module/ui/screens/AppInfoScreen.js +22 -45
  135. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  136. package/lib/module/ui/screens/FeedbackScreen.js +44 -23
  137. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  138. package/lib/module/ui/screens/FileManagementScreen.js +59 -78
  139. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  140. package/lib/module/ui/screens/PaymentGatewayScreen.js +1583 -0
  141. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -0
  142. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +23 -37
  143. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  144. package/lib/module/ui/screens/RecoverAccountScreen.js +263 -0
  145. package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -0
  146. package/lib/module/ui/screens/SessionManagementScreen.js +47 -69
  147. package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
  148. package/lib/module/ui/screens/SignInScreen.js +100 -334
  149. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  150. package/lib/module/ui/screens/SignUpScreen.js +137 -341
  151. package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
  152. package/lib/module/ui/screens/internal/SignInPasswordStep.js +186 -0
  153. package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -0
  154. package/lib/module/ui/screens/internal/SignInUsernameStep.js +129 -0
  155. package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -0
  156. package/lib/module/ui/screens/internal/SignUpIdentityStep.js +102 -0
  157. package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -0
  158. package/lib/module/ui/screens/internal/SignUpSecurityStep.js +120 -0
  159. package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -0
  160. package/lib/module/ui/screens/internal/SignUpSummaryStep.js +79 -0
  161. package/lib/module/ui/screens/internal/SignUpSummaryStep.js.map +1 -0
  162. package/lib/module/ui/screens/internal/SignUpWelcomeStep.js +54 -0
  163. package/lib/module/ui/screens/internal/SignUpWelcomeStep.js.map +1 -0
  164. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +16 -3
  165. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  166. package/lib/module/ui/stores/authStore.js +27 -0
  167. package/lib/module/ui/stores/authStore.js.map +1 -0
  168. package/lib/module/ui/stores/followStore.js +120 -0
  169. package/lib/module/ui/stores/followStore.js.map +1 -0
  170. package/lib/module/ui/styles/index.js +0 -1
  171. package/lib/module/ui/styles/index.js.map +1 -1
  172. package/lib/module/ui/utils/confirmAction.js +25 -0
  173. package/lib/module/ui/utils/confirmAction.js.map +1 -0
  174. package/lib/typescript/core/index.d.ts +28 -10
  175. package/lib/typescript/core/index.d.ts.map +1 -1
  176. package/lib/typescript/index.d.ts +5 -4
  177. package/lib/typescript/index.d.ts.map +1 -1
  178. package/lib/typescript/models/secureSession.d.ts +0 -1
  179. package/lib/typescript/models/secureSession.d.ts.map +1 -1
  180. package/lib/typescript/node/index.d.ts +0 -1
  181. package/lib/typescript/node/index.d.ts.map +1 -1
  182. package/lib/typescript/ui/components/FollowButton.d.ts +1 -77
  183. package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
  184. package/lib/typescript/ui/components/OxyPayButton.d.ts +29 -0
  185. package/lib/typescript/ui/components/OxyPayButton.d.ts.map +1 -0
  186. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  187. package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -1
  188. package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts +8 -0
  189. package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts.map +1 -0
  190. package/lib/typescript/ui/components/icon/index.d.ts +1 -0
  191. package/lib/typescript/ui/components/icon/index.d.ts.map +1 -1
  192. package/lib/typescript/ui/components/index.d.ts +1 -0
  193. package/lib/typescript/ui/components/index.d.ts.map +1 -1
  194. package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
  195. package/lib/typescript/ui/components/internal/PinInput.d.ts +12 -0
  196. package/lib/typescript/ui/components/internal/PinInput.d.ts.map +1 -0
  197. package/lib/typescript/ui/components/internal/TextField.d.ts +1 -0
  198. package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
  199. package/lib/typescript/ui/context/OxyContext.d.ts +0 -1
  200. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  201. package/lib/typescript/ui/hooks/index.d.ts +1 -2
  202. package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
  203. package/lib/typescript/ui/hooks/useFollow.d.ts +14 -15
  204. package/lib/typescript/ui/hooks/useFollow.d.ts.map +1 -1
  205. package/lib/typescript/ui/hooks/useSessionSocket.d.ts +11 -0
  206. package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -0
  207. package/lib/typescript/ui/index.d.ts +2 -5
  208. package/lib/typescript/ui/index.d.ts.map +1 -1
  209. package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
  210. package/lib/typescript/ui/navigation/types.d.ts +5 -23
  211. package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
  212. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  213. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  214. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  215. package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  216. package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
  217. package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
  218. package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
  219. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +27 -0
  220. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -0
  221. package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  222. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +8 -0
  223. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -0
  224. package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  225. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
  226. package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
  227. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +27 -0
  228. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -0
  229. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +26 -0
  230. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -0
  231. package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts +20 -0
  232. package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -0
  233. package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts +24 -0
  234. package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -0
  235. package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts +15 -0
  236. package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts.map +1 -0
  237. package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts +13 -0
  238. package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts.map +1 -0
  239. package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
  240. package/lib/typescript/ui/stores/authStore.d.ts +14 -0
  241. package/lib/typescript/ui/stores/authStore.d.ts.map +1 -0
  242. package/lib/typescript/ui/stores/followStore.d.ts +15 -0
  243. package/lib/typescript/ui/stores/followStore.d.ts.map +1 -0
  244. package/lib/typescript/ui/styles/index.d.ts +0 -1
  245. package/lib/typescript/ui/styles/index.d.ts.map +1 -1
  246. package/lib/typescript/ui/utils/confirmAction.d.ts +7 -0
  247. package/lib/typescript/ui/utils/confirmAction.d.ts.map +1 -0
  248. package/package.json +12 -7
  249. package/src/core/index.ts +78 -88
  250. package/src/index.ts +8 -45
  251. package/src/models/secureSession.ts +1 -2
  252. package/src/node/index.ts +0 -3
  253. package/src/ui/components/FollowButton.tsx +100 -322
  254. package/src/ui/components/OxyPayButton.tsx +133 -0
  255. package/src/ui/components/OxyProvider.tsx +39 -201
  256. package/src/ui/components/OxySignInButton.tsx +13 -2
  257. package/src/ui/components/icon/FAIRWalletIcon.tsx +49 -0
  258. package/src/ui/components/icon/index.ts +1 -0
  259. package/src/ui/components/index.ts +1 -0
  260. package/src/ui/components/internal/GroupedPillButtons.tsx +12 -8
  261. package/src/ui/components/internal/PinInput.tsx +102 -0
  262. package/src/ui/components/internal/TextField.tsx +9 -0
  263. package/src/ui/context/OxyContext.tsx +26 -26
  264. package/src/ui/hooks/index.ts +1 -2
  265. package/src/ui/hooks/useFollow.ts +58 -129
  266. package/src/ui/hooks/useSessionSocket.ts +50 -0
  267. package/src/ui/index.ts +2 -37
  268. package/src/ui/navigation/OxyRouter.tsx +47 -63
  269. package/src/ui/navigation/types.ts +5 -26
  270. package/src/ui/screens/AccountCenterScreen.tsx +12 -21
  271. package/src/ui/screens/AccountOverviewScreen.tsx +6 -30
  272. package/src/ui/screens/AccountSettingsScreen.tsx +7 -22
  273. package/src/ui/screens/AccountSwitcherScreen.tsx +46 -88
  274. package/src/ui/screens/AppInfoScreen.tsx +27 -47
  275. package/src/ui/screens/FeedbackScreen.tsx +34 -19
  276. package/src/ui/screens/FileManagementScreen.tsx +293 -321
  277. package/src/ui/screens/PaymentGatewayScreen.tsx +1315 -0
  278. package/src/ui/screens/PremiumSubscriptionScreen.tsx +109 -124
  279. package/src/ui/screens/RecoverAccountScreen.tsx +260 -0
  280. package/src/ui/screens/SessionManagementScreen.tsx +65 -137
  281. package/src/ui/screens/SignInScreen.tsx +89 -283
  282. package/src/ui/screens/SignUpScreen.tsx +138 -291
  283. package/src/ui/screens/internal/SignInPasswordStep.tsx +179 -0
  284. package/src/ui/screens/internal/SignInUsernameStep.tsx +139 -0
  285. package/src/ui/screens/internal/SignUpIdentityStep.tsx +114 -0
  286. package/src/ui/screens/internal/SignUpSecurityStep.tsx +132 -0
  287. package/src/ui/screens/internal/SignUpSummaryStep.tsx +66 -0
  288. package/src/ui/screens/internal/SignUpWelcomeStep.tsx +52 -0
  289. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +13 -3
  290. package/src/ui/stores/authStore.ts +24 -0
  291. package/src/ui/stores/followStore.ts +80 -0
  292. package/src/ui/styles/index.ts +0 -1
  293. package/src/ui/utils/confirmAction.ts +23 -0
  294. package/lib/commonjs/ui/components/bottomSheet/index.js +0 -37
  295. package/lib/commonjs/ui/components/bottomSheet/index.js.map +0 -1
  296. package/lib/commonjs/ui/hooks/useAuthFetch.js +0 -216
  297. package/lib/commonjs/ui/hooks/useAuthFetch.js.map +0 -1
  298. package/lib/commonjs/ui/hooks/useOxyFollow.js +0 -190
  299. package/lib/commonjs/ui/hooks/useOxyFollow.js.map +0 -1
  300. package/lib/commonjs/ui/screens/BillingManagementScreen.js +0 -636
  301. package/lib/commonjs/ui/screens/BillingManagementScreen.js.map +0 -1
  302. package/lib/commonjs/ui/store/index.js +0 -67
  303. package/lib/commonjs/ui/store/index.js.map +0 -1
  304. package/lib/commonjs/ui/store/setupOxyStore.js +0 -63
  305. package/lib/commonjs/ui/store/setupOxyStore.js.map +0 -1
  306. package/lib/commonjs/ui/store/slices/authSlice.js +0 -56
  307. package/lib/commonjs/ui/store/slices/authSlice.js.map +0 -1
  308. package/lib/commonjs/ui/store/slices/followSlice.js +0 -238
  309. package/lib/commonjs/ui/store/slices/followSlice.js.map +0 -1
  310. package/lib/commonjs/ui/store/slices/index.js +0 -129
  311. package/lib/commonjs/ui/store/slices/index.js.map +0 -1
  312. package/lib/commonjs/ui/store/slices/types.js +0 -19
  313. package/lib/commonjs/ui/store/slices/types.js.map +0 -1
  314. package/lib/commonjs/ui/styles/shadows.js +0 -123
  315. package/lib/commonjs/ui/styles/shadows.js.map +0 -1
  316. package/lib/commonjs/utils/polyfills.js +0 -42
  317. package/lib/commonjs/utils/polyfills.js.map +0 -1
  318. package/lib/module/ui/components/bottomSheet/index.js +0 -5
  319. package/lib/module/ui/components/bottomSheet/index.js.map +0 -1
  320. package/lib/module/ui/hooks/useAuthFetch.js +0 -211
  321. package/lib/module/ui/hooks/useAuthFetch.js.map +0 -1
  322. package/lib/module/ui/hooks/useOxyFollow.js +0 -186
  323. package/lib/module/ui/hooks/useOxyFollow.js.map +0 -1
  324. package/lib/module/ui/screens/BillingManagementScreen.js +0 -631
  325. package/lib/module/ui/screens/BillingManagementScreen.js.map +0 -1
  326. package/lib/module/ui/store/index.js +0 -33
  327. package/lib/module/ui/store/index.js.map +0 -1
  328. package/lib/module/ui/store/setupOxyStore.js +0 -59
  329. package/lib/module/ui/store/setupOxyStore.js.map +0 -1
  330. package/lib/module/ui/store/slices/authSlice.js +0 -48
  331. package/lib/module/ui/store/slices/authSlice.js.map +0 -1
  332. package/lib/module/ui/store/slices/followSlice.js +0 -232
  333. package/lib/module/ui/store/slices/followSlice.js.map +0 -1
  334. package/lib/module/ui/store/slices/index.js +0 -11
  335. package/lib/module/ui/store/slices/index.js.map +0 -1
  336. package/lib/module/ui/store/slices/types.js +0 -15
  337. package/lib/module/ui/store/slices/types.js.map +0 -1
  338. package/lib/module/ui/styles/shadows.js +0 -119
  339. package/lib/module/ui/styles/shadows.js.map +0 -1
  340. package/lib/module/utils/polyfills.js +0 -36
  341. package/lib/module/utils/polyfills.js.map +0 -1
  342. package/lib/typescript/types/react-redux.d.ts +0 -5
  343. package/lib/typescript/ui/components/bottomSheet/index.d.ts +0 -4
  344. package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +0 -1
  345. package/lib/typescript/ui/hooks/useAuthFetch.d.ts +0 -34
  346. package/lib/typescript/ui/hooks/useAuthFetch.d.ts.map +0 -1
  347. package/lib/typescript/ui/hooks/useOxyFollow.d.ts +0 -81
  348. package/lib/typescript/ui/hooks/useOxyFollow.d.ts.map +0 -1
  349. package/lib/typescript/ui/screens/BillingManagementScreen.d.ts +0 -5
  350. package/lib/typescript/ui/screens/BillingManagementScreen.d.ts.map +0 -1
  351. package/lib/typescript/ui/store/index.d.ts +0 -27
  352. package/lib/typescript/ui/store/index.d.ts.map +0 -1
  353. package/lib/typescript/ui/store/setupOxyStore.d.ts +0 -29
  354. package/lib/typescript/ui/store/setupOxyStore.d.ts.map +0 -1
  355. package/lib/typescript/ui/store/slices/authSlice.d.ts +0 -32
  356. package/lib/typescript/ui/store/slices/authSlice.d.ts.map +0 -1
  357. package/lib/typescript/ui/store/slices/followSlice.d.ts +0 -120
  358. package/lib/typescript/ui/store/slices/followSlice.d.ts.map +0 -1
  359. package/lib/typescript/ui/store/slices/index.d.ts +0 -9
  360. package/lib/typescript/ui/store/slices/index.d.ts.map +0 -1
  361. package/lib/typescript/ui/store/slices/types.d.ts +0 -16
  362. package/lib/typescript/ui/store/slices/types.d.ts.map +0 -1
  363. package/lib/typescript/ui/styles/shadows.d.ts +0 -233
  364. package/lib/typescript/ui/styles/shadows.d.ts.map +0 -1
  365. package/lib/typescript/utils/polyfills.d.ts +0 -6
  366. package/lib/typescript/utils/polyfills.d.ts.map +0 -1
  367. package/src/__tests__/backend-middleware.test.ts +0 -209
  368. package/src/__tests__/polyfills.test.ts +0 -30
  369. package/src/__tests__/setup.ts +0 -43
  370. package/src/__tests__/ui/hooks/useAuthFetch.test.ts +0 -70
  371. package/src/__tests__/ui/hooks/useOxyFollow.test.tsx +0 -92
  372. package/src/__tests__/ui/screens/AccountSettingsScreen.test.tsx +0 -112
  373. package/src/__tests__/ui/store/setupOxyStore.test.ts +0 -50
  374. package/src/__tests__/validate-structure.js +0 -91
  375. package/src/__tests__/validation.js +0 -42
  376. package/src/types/react-redux.d.ts +0 -5
  377. package/src/ui/components/bottomSheet/index.tsx +0 -14
  378. package/src/ui/hooks/useAuthFetch.ts +0 -238
  379. package/src/ui/hooks/useOxyFollow.ts +0 -188
  380. package/src/ui/screens/BillingManagementScreen.tsx +0 -589
  381. package/src/ui/store/index.ts +0 -36
  382. package/src/ui/store/setupOxyStore.ts +0 -58
  383. package/src/ui/store/slices/authSlice.ts +0 -43
  384. package/src/ui/store/slices/followSlice.ts +0 -207
  385. package/src/ui/store/slices/index.ts +0 -31
  386. package/src/ui/store/slices/types.ts +0 -33
  387. package/src/ui/styles/shadows.ts +0 -112
  388. package/src/utils/polyfills.ts +0 -34
@@ -3,56 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.default = exports.FollowButton = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
- var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
10
- var _reactRedux = require("react-redux");
9
+ var _reactNativeReanimated = require("react-native-reanimated");
11
10
  var _OxyContext = require("../context/OxyContext");
12
11
  var _fonts = require("../styles/fonts");
13
12
  var _sonner = require("../../lib/sonner");
14
- var _store = require("../store");
13
+ var _useFollow = require("../hooks/useFollow");
15
14
  var _jsxRuntime = require("react/jsx-runtime");
16
15
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
17
- /**
18
- * An animated follow button with interactive state changes and preventDefault support
19
- * Uses Redux for state management to ensure all buttons with the same user ID stay synchronized
20
- *
21
- * @example
22
- * ```tsx
23
- * // Basic usage
24
- * <FollowButton userId="123" />
25
- *
26
- * // With custom styling
27
- * <FollowButton
28
- * userId="123"
29
- * initiallyFollowing={true}
30
- * size="large"
31
- * style={{ borderRadius: 12 }}
32
- * onFollowChange={(isFollowing) => console.log(`User is now ${isFollowing ? 'followed' : 'unfollowed'}`)}
33
- * />
34
- *
35
- * // Inside a pressable container (prevents parent actions)
36
- * <TouchableOpacity onPress={() => navigateToProfile()}>
37
- * <View>
38
- * <Text>User Profile</Text>
39
- * <FollowButton
40
- * userId="123"
41
- * preventParentActions={true} // Default: true
42
- * />
43
- * </View>
44
- * </TouchableOpacity>
45
- *
46
- * // Custom onPress handler
47
- * <FollowButton
48
- * userId="123"
49
- * onPress={(event) => {
50
- * event.preventDefault(); // Custom preventDefault
51
- * // Custom logic here
52
- * }}
53
- * />
54
- * ```
55
- */
56
16
  const FollowButton = ({
57
17
  userId,
58
18
  initiallyFollowing = false,
@@ -62,232 +22,143 @@ const FollowButton = ({
62
22
  textStyle,
63
23
  disabled = false,
64
24
  showLoadingState = true,
65
- preventParentActions = true,
66
- onPress
25
+ preventParentActions = true
67
26
  }) => {
68
- const dispatch = (0, _reactRedux.useDispatch)();
69
27
  const {
70
28
  oxyServices,
71
29
  isAuthenticated
72
30
  } = (0, _OxyContext.useOxy)();
73
-
74
- // Optimized single selector to prevent multiple re-renders
75
- const followState = (0, _reactRedux.useSelector)(state => ({
76
- isFollowing: state.follow.followingUsers[userId] ?? initiallyFollowing ?? false,
77
- isLoading: state.follow.loadingUsers[userId] ?? false,
78
- error: state.follow.errors[userId]
79
- }));
80
-
81
- // Whether the follow status has been loaded from the store
82
- const isStatusKnown = (0, _reactRedux.useSelector)(state => Object.prototype.hasOwnProperty.call(state.follow.followingUsers, userId));
83
31
  const {
84
32
  isFollowing,
85
33
  isLoading,
86
- error
87
- } = followState;
34
+ error,
35
+ toggleFollow,
36
+ setFollowStatus,
37
+ fetchStatus,
38
+ clearError
39
+ } = (0, _useFollow.useFollow)(userId);
88
40
 
89
41
  // Animation values
90
42
  const animationProgress = (0, _reactNativeReanimated.useSharedValue)(isFollowing ? 1 : 0);
91
43
  const scale = (0, _reactNativeReanimated.useSharedValue)(1);
92
44
 
93
- // Initialize Redux state with initial value if not already set
45
+ // Initialize Zustand state with initial value if not already set
94
46
  (0, _react.useEffect)(() => {
95
- if (userId && !isStatusKnown) {
96
- // Set the initial state regardless of whether initiallyFollowing is defined
97
- const initialState = initiallyFollowing ?? false;
98
- dispatch((0, _store.setFollowingStatus)({
99
- userId,
100
- isFollowing: initialState
101
- }));
47
+ if (userId && !isFollowing && initiallyFollowing) {
48
+ setFollowStatus?.(initiallyFollowing);
102
49
  }
103
- }, [userId, initiallyFollowing, isStatusKnown, dispatch]);
50
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51
+ }, [userId, initiallyFollowing]);
104
52
 
105
53
  // Fetch latest follow status from backend on mount if authenticated
106
- // This runs separately and will overwrite the initial state with actual data
107
54
  (0, _react.useEffect)(() => {
108
55
  if (userId && isAuthenticated) {
109
- dispatch((0, _store.fetchFollowStatus)({
110
- userId,
111
- oxyServices
112
- }));
56
+ fetchStatus?.();
113
57
  }
114
- }, [userId, oxyServices, isAuthenticated, dispatch]);
58
+ // eslint-disable-next-line react-hooks/exhaustive-deps
59
+ }, [userId, oxyServices, isAuthenticated]);
115
60
 
116
- // Update the animation value when isFollowing changes
61
+ // Animate button on follow/unfollow
117
62
  (0, _react.useEffect)(() => {
118
63
  animationProgress.value = (0, _reactNativeReanimated.withTiming)(isFollowing ? 1 : 0, {
119
64
  duration: 300,
120
- easing: _reactNativeReanimated.Easing.bezier(0.25, 0.1, 0.25, 1)
65
+ easing: _reactNativeReanimated.Easing.inOut(_reactNativeReanimated.Easing.ease)
121
66
  });
122
- }, [isFollowing]); // Removed animationProgress from dependencies as it's stable
123
-
124
- // Show error toast when error occurs
125
- (0, _react.useEffect)(() => {
126
- if (error) {
127
- _sonner.toast.error(error);
128
- dispatch((0, _store.clearFollowError)(userId));
129
- }
130
- }, [error]); // Removed userId and dispatch to prevent unnecessary runs
67
+ }, [isFollowing, animationProgress]);
131
68
 
132
- // The button press handler with preventDefault support - memoized to prevent recreation
69
+ // Button press handler
133
70
  const handlePress = (0, _react.useCallback)(async event => {
134
- // Prevent parent actions if enabled (e.g., if inside a link or pressable container)
135
- if (preventParentActions && event) {
136
- // For React Native Web compatibility
137
- if (_reactNative.Platform.OS === 'web' && event.preventDefault) {
138
- event.preventDefault();
139
- }
140
-
141
- // Stop event propagation to prevent parent TouchableOpacity/Pressable actions
142
- if (event.stopPropagation) {
143
- event.stopPropagation();
144
- }
145
-
146
- // For React Native, prevent gesture bubbling
147
- if (event.nativeEvent && event.nativeEvent.stopPropagation) {
148
- event.nativeEvent.stopPropagation();
149
- }
150
- }
151
-
152
- // If custom onPress is provided, use it instead of default behavior
153
- if (onPress) {
154
- onPress(event);
155
- return;
71
+ if (preventParentActions && event && event.preventDefault) {
72
+ event.preventDefault();
73
+ event.stopPropagation();
156
74
  }
157
- if (disabled || followState.isLoading) return;
158
-
159
- // Check if user is authenticated - show toast instead of disabling
160
- if (!isAuthenticated) {
161
- _sonner.toast.error('Please sign in to follow users');
162
- return;
163
- }
164
-
165
- // Touch feedback animation
166
- scale.value = (0, _reactNativeReanimated.withSpring)(0.95, {
167
- damping: 10
168
- }, () => {
169
- scale.value = (0, _reactNativeReanimated.withSpring)(1);
170
- });
75
+ if (disabled || isLoading) return;
171
76
  try {
172
- // Dispatch the async action to follow/unfollow
173
- const result = await dispatch((0, _store.toggleFollowUser)({
174
- userId,
175
- oxyServices,
176
- isCurrentlyFollowing: followState.isFollowing
177
- })).unwrap();
178
-
179
- // Call the callback if provided
180
- if (onFollowChange) {
181
- onFollowChange(result.isFollowing);
182
- }
183
-
184
- // Show success toast
185
- _sonner.toast.success(result.isFollowing ? 'Following user!' : 'Unfollowed user');
186
- } catch (error) {
187
- console.error('Follow action failed:', error);
188
-
189
- // Show user-friendly error messages for state mismatches
190
- const errorMessage = error?.toString() || 'Unknown error';
191
- if (errorMessage.includes('State synced with backend')) {
192
- _sonner.toast.info('Status updated. Please try again.');
193
- } else {
194
- _sonner.toast.error(`Failed to ${followState.isFollowing ? 'unfollow' : 'follow'} user. Please try again.`);
195
- }
196
- }
197
- }, [preventParentActions, onPress, disabled, followState.isLoading, followState.isFollowing, isAuthenticated, scale, dispatch, userId, oxyServices, onFollowChange]);
198
-
199
- // Animated styles for the button
200
- const animatedButtonStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
201
- const backgroundColor = (0, _reactNativeReanimated.interpolateColor)(animationProgress.value, [0, 1], ['#d169e5', '#FFFFFF']);
202
- const borderColor = (0, _reactNativeReanimated.interpolateColor)(animationProgress.value, [0, 1], ['#d169e5', '#d169e5']);
203
-
204
- // Add a slight scaling effect during the transition
205
- const transitionScale = 1 + 0.05 * Math.sin(animationProgress.value * Math.PI);
206
- return {
207
- backgroundColor,
208
- borderColor,
209
- borderWidth: 1,
210
- transform: [{
211
- scale: scale.value * transitionScale
212
- }]
213
- };
214
- });
215
-
216
- // Animated styles for the text
217
- const animatedTextStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
218
- const color = (0, _reactNativeReanimated.interpolateColor)(animationProgress.value, [0, 1], ['#FFFFFF', '#d169e5']);
219
- return {
220
- color
221
- };
222
- });
223
-
224
- // Get size-specific styles
225
- const getSizeStyles = () => {
226
- switch (size) {
227
- case 'small':
228
- return {
229
- button: {
230
- paddingVertical: 6,
231
- paddingHorizontal: 12
232
- },
233
- text: {
234
- fontSize: 12
235
- }
236
- };
237
- case 'large':
238
- return {
239
- button: {
240
- paddingVertical: 12,
241
- paddingHorizontal: 24
242
- },
243
- text: {
244
- fontSize: 18
245
- }
246
- };
247
- default:
248
- // medium
249
- return {
250
- button: {
251
- paddingVertical: 8,
252
- paddingHorizontal: 16
253
- },
254
- text: {
255
- fontSize: 14
256
- }
257
- };
77
+ await toggleFollow?.();
78
+ if (onFollowChange) onFollowChange(!isFollowing);
79
+ } catch (err) {
80
+ _sonner.toast.error(err?.message || 'Failed to update follow status');
258
81
  }
82
+ }, [disabled, isLoading, toggleFollow, onFollowChange, isFollowing, preventParentActions]);
83
+
84
+ // Button styles
85
+ const getButtonStyle = () => {
86
+ let baseStyle = styles.buttonMedium;
87
+ if (size === 'small') baseStyle = styles.buttonSmall;
88
+ if (size === 'large') baseStyle = styles.buttonLarge;
89
+ return [baseStyle, isFollowing ? styles.following : styles.notFollowing, style];
90
+ };
91
+ const getTextStyle = () => {
92
+ let baseStyle = styles.textMedium;
93
+ if (size === 'small') baseStyle = styles.textSmall;
94
+ if (size === 'large') baseStyle = styles.textLarge;
95
+ return [baseStyle, isFollowing ? styles.textFollowing : styles.textNotFollowing, textStyle];
259
96
  };
260
- const sizeStyles = getSizeStyles();
261
97
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
262
- activeOpacity: 0.8,
98
+ style: getButtonStyle(),
263
99
  onPress: handlePress,
264
100
  disabled: disabled || isLoading,
265
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
266
- style: [styles.button, sizeStyles.button, animatedButtonStyle, style],
267
- children: isLoading && showLoadingState ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
268
- size: "small",
269
- color: isFollowing ? '#d169e5' : '#FFFFFF'
270
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.Text, {
271
- style: [styles.text, sizeStyles.text, animatedTextStyle, textStyle],
272
- children: isFollowing ? 'Following' : 'Follow'
273
- })
101
+ activeOpacity: 0.8,
102
+ children: showLoadingState && isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
103
+ size: size === 'small' ? 'small' : 'large',
104
+ color: isFollowing ? '#fff' : '#007AFF'
105
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
106
+ style: getTextStyle(),
107
+ children: isFollowing ? 'Following' : 'Follow'
274
108
  })
275
109
  });
276
110
  };
111
+ exports.FollowButton = FollowButton;
277
112
  const styles = _reactNative.StyleSheet.create({
278
- button: {
279
- justifyContent: 'center',
113
+ buttonSmall: {
114
+ paddingVertical: 4,
115
+ paddingHorizontal: 12,
116
+ borderRadius: 16,
117
+ minWidth: 60,
118
+ alignItems: 'center',
119
+ justifyContent: 'center'
120
+ },
121
+ buttonMedium: {
122
+ paddingVertical: 8,
123
+ paddingHorizontal: 20,
124
+ borderRadius: 20,
125
+ minWidth: 90,
126
+ alignItems: 'center',
127
+ justifyContent: 'center'
128
+ },
129
+ buttonLarge: {
130
+ paddingVertical: 12,
131
+ paddingHorizontal: 32,
132
+ borderRadius: 24,
133
+ minWidth: 120,
280
134
  alignItems: 'center',
281
- flexDirection: 'row',
282
- borderRadius: 100
135
+ justifyContent: 'center'
136
+ },
137
+ following: {
138
+ backgroundColor: '#007AFF'
139
+ },
140
+ notFollowing: {
141
+ backgroundColor: '#fff',
142
+ borderWidth: 1,
143
+ borderColor: '#007AFF'
144
+ },
145
+ textSmall: {
146
+ fontSize: 13,
147
+ fontFamily: _fonts.fontFamilies.phuduMedium
148
+ },
149
+ textMedium: {
150
+ fontSize: 15,
151
+ fontFamily: _fonts.fontFamilies.phuduMedium
152
+ },
153
+ textLarge: {
154
+ fontSize: 18,
155
+ fontFamily: _fonts.fontFamilies.phuduMedium
156
+ },
157
+ textFollowing: {
158
+ color: '#fff'
283
159
  },
284
- text: {
285
- fontFamily: _reactNative.Platform.select({
286
- web: 'Phudu',
287
- default: _fonts.fontFamilies.phuduSemiBold
288
- }),
289
- fontWeight: _reactNative.Platform.OS === 'web' ? '600' : undefined,
290
- textAlign: 'center'
160
+ textNotFollowing: {
161
+ color: '#007AFF'
291
162
  }
292
163
  });
293
164
  var _default = exports.default = FollowButton;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_reactRedux","_OxyContext","_fonts","_sonner","_store","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FollowButton","userId","initiallyFollowing","size","onFollowChange","style","textStyle","disabled","showLoadingState","preventParentActions","onPress","dispatch","useDispatch","oxyServices","isAuthenticated","useOxy","followState","useSelector","state","isFollowing","follow","followingUsers","isLoading","loadingUsers","error","errors","isStatusKnown","prototype","animationProgress","useSharedValue","scale","useEffect","initialState","setFollowingStatus","fetchFollowStatus","value","withTiming","duration","easing","Easing","bezier","toast","clearFollowError","handlePress","useCallback","event","Platform","OS","preventDefault","stopPropagation","nativeEvent","withSpring","damping","result","toggleFollowUser","isCurrentlyFollowing","unwrap","success","console","errorMessage","toString","includes","info","animatedButtonStyle","useAnimatedStyle","backgroundColor","interpolateColor","borderColor","transitionScale","Math","sin","PI","borderWidth","transform","animatedTextStyle","color","getSizeStyles","button","paddingVertical","paddingHorizontal","text","fontSize","sizeStyles","jsx","TouchableOpacity","activeOpacity","children","View","styles","ActivityIndicator","Text","StyleSheet","create","justifyContent","alignItems","flexDirection","borderRadius","fontFamily","select","web","fontFamilies","phuduSemiBold","fontWeight","undefined","textAlign","_default","exports"],"sourceRoot":"../../../../src","sources":["ui/components/FollowButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IA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UAAU,CAACL,MAAM,EACjBd,mBAAmB,EACnB1D,KAAK,CACL;MAAAiF,QAAA,EAEDhE,SAAS,IAAId,gBAAgB,gBAC5B,IAAA5B,WAAA,CAAAuG,GAAA,EAAC9G,YAAA,CAAAoH,iBAAiB;QAChBtF,IAAI,EAAC,OAAO;QACZwE,KAAK,EAAExD,WAAW,GAAG,SAAS,GAAG;MAAU,CAC5C,CAAC,gBAEF,IAAAvC,WAAA,CAAAuG,GAAA,EAAC7G,sBAAA,CAAAiB,OAAQ,CAACmG,IAAI;QACZrF,KAAK,EAAE,CACLmF,MAAM,CAACR,IAAI,EACXE,UAAU,CAACF,IAAI,EACfN,iBAAiB,EACjBpE,SAAS,CACT;QAAAgF,QAAA,EAEDnE,WAAW,GAAG,WAAW,GAAG;MAAQ,CACxB;IAChB,CACY;EAAC,CACA,CAAC;AAEvB,CAAC;AAED,MAAMqE,MAAM,GAAGG,uBAAU,CAACC,MAAM,CAAC;EAC/Bf,MAAM,EAAE;IACNgB,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,YAAY,EAAE;EAChB,CAAC;EACDhB,IAAI,EAAE;IACJiB,UAAU,EAAEnD,qBAAQ,CAACoD,MAAM,CAAC;MAC1BC,GAAG,EAAE,OAAO;MACZ5G,OAAO,EAAE6G,mBAAY,CAACC;IACxB,CAAC,CAAC;IACFC,UAAU,EAAExD,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG,KAAK,GAAGwD,SAAS;IACrDC,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAnH,OAAA,GAEYS,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_OxyContext","_fonts","_sonner","_useFollow","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FollowButton","userId","initiallyFollowing","size","onFollowChange","style","textStyle","disabled","showLoadingState","preventParentActions","oxyServices","isAuthenticated","useOxy","isFollowing","isLoading","error","toggleFollow","setFollowStatus","fetchStatus","clearError","useFollow","animationProgress","useSharedValue","scale","useEffect","value","withTiming","duration","easing","Easing","inOut","ease","handlePress","useCallback","event","preventDefault","stopPropagation","err","toast","message","getButtonStyle","baseStyle","styles","buttonMedium","buttonSmall","buttonLarge","following","notFollowing","getTextStyle","textMedium","textSmall","textLarge","textFollowing","textNotFollowing","jsx","TouchableOpacity","onPress","activeOpacity","children","ActivityIndicator","color","Text","exports","StyleSheet","create","paddingVertical","paddingHorizontal","borderRadius","minWidth","alignItems","justifyContent","backgroundColor","borderWidth","borderColor","fontSize","fontFamily","fontFamilies","phuduMedium","_default"],"sourceRoot":"../../../../src","sources":["ui/components/FollowButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,sBAAA,GAAAF,OAAA;AAQA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAA+C,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAA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,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAAkB,QAAA,GAAAhB,OAAA,CAAAvE,OAAA,GAGYS,YAAY","ignoreList":[]}
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _fonts = require("../styles/fonts");
10
+ var _OxyContext = require("../context/OxyContext");
11
+ var _OxyLogo = _interopRequireDefault(require("./OxyLogo"));
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
+ /**
16
+ * A pre-styled button for OxyPay payments that opens the Payment Gateway
17
+ * - Only black or white by default, but can be customized with the color prop.
18
+ */
19
+ const OxyPayButton = ({
20
+ style,
21
+ textStyle,
22
+ text = 'Pay',
23
+ disabled = false,
24
+ amount,
25
+ currency = 'FAIR',
26
+ paymentItems,
27
+ description,
28
+ onPaymentResult,
29
+ color,
30
+ variant = 'white'
31
+ }) => {
32
+ const {
33
+ showBottomSheet
34
+ } = (0, _OxyContext.useOxy)();
35
+ const [buttonHeight, setButtonHeight] = (0, _react.useState)(52);
36
+ const handlePress = () => {
37
+ showBottomSheet?.({
38
+ screen: 'PaymentGateway',
39
+ props: {
40
+ amount,
41
+ currency,
42
+ paymentItems,
43
+ description,
44
+ onPaymentResult
45
+ }
46
+ });
47
+ };
48
+ // Determine background and text color
49
+ const backgroundColor = color || (variant === 'black' ? '#111' : '#fff');
50
+ const textColor = variant === 'black' || color && isColorDark(color) ? '#fff' : '#1b1f0a';
51
+ // Responsive sizing
52
+ const logoWidth = Math.round(buttonHeight * 0.5); // 50% of button height
53
+ const logoHeight = Math.round(buttonHeight * 0.25); // 25% of button height
54
+ const fontSize = Math.round(buttonHeight * 0.35); // 35% of button height
55
+ const handleLayout = e => {
56
+ const h = e.nativeEvent.layout.height;
57
+ if (h && Math.abs(h - buttonHeight) > 1) setButtonHeight(h);
58
+ };
59
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
60
+ style: [styles.button, {
61
+ backgroundColor,
62
+ borderColor: textColor,
63
+ borderWidth: 1
64
+ }, disabled && styles.buttonDisabled, style],
65
+ onPress: handlePress,
66
+ disabled: disabled,
67
+ activeOpacity: 0.85,
68
+ onLayout: handleLayout,
69
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
70
+ style: styles.buttonContent,
71
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyLogo.default, {
72
+ width: logoWidth,
73
+ height: logoHeight,
74
+ style: {
75
+ marginRight: logoWidth * 0.12,
76
+ marginTop: (fontSize - logoHeight) / 2
77
+ },
78
+ fillColor: textColor
79
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
80
+ style: [styles.text, {
81
+ color: textColor,
82
+ fontSize
83
+ }, textStyle],
84
+ children: text
85
+ })]
86
+ })
87
+ });
88
+ };
89
+
90
+ // Helper to determine if a color is dark (simple luminance check)
91
+ function isColorDark(hex) {
92
+ let c = hex.replace('#', '');
93
+ if (c.length === 3) c = c.split('').map(x => x + x).join('');
94
+ if (c.length !== 6) return false;
95
+ const r = parseInt(c.substr(0, 2), 16);
96
+ const g = parseInt(c.substr(2, 2), 16);
97
+ const b = parseInt(c.substr(4, 2), 16);
98
+ // Perceived luminance
99
+ return 0.299 * r + 0.587 * g + 0.114 * b < 150;
100
+ }
101
+ const styles = _reactNative.StyleSheet.create({
102
+ button: {
103
+ padding: 14,
104
+ borderRadius: 35,
105
+ alignItems: 'center',
106
+ justifyContent: 'center',
107
+ flexDirection: 'row',
108
+ minHeight: 52
109
+ },
110
+ buttonDisabled: {
111
+ opacity: 0.6
112
+ },
113
+ buttonContent: {
114
+ flexDirection: 'row',
115
+ alignItems: 'center',
116
+ justifyContent: 'center'
117
+ },
118
+ oxyLogo: {
119
+ // marginRight is set dynamically
120
+ },
121
+ centeredItem: {
122
+ justifyContent: 'center',
123
+ alignItems: 'center'
124
+ },
125
+ text: {
126
+ fontFamily: _fonts.fontFamilies.phudu,
127
+ fontWeight: '700'
128
+ }
129
+ });
130
+ var _default = exports.default = OxyPayButton;
131
+ //# sourceMappingURL=OxyPayButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_fonts","_OxyContext","_OxyLogo","_interopRequireDefault","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","OxyPayButton","style","textStyle","text","disabled","amount","currency","paymentItems","description","onPaymentResult","color","variant","showBottomSheet","useOxy","buttonHeight","setButtonHeight","useState","handlePress","screen","props","backgroundColor","textColor","isColorDark","logoWidth","Math","round","logoHeight","fontSize","handleLayout","h","nativeEvent","layout","height","abs","jsx","TouchableOpacity","styles","button","borderColor","borderWidth","buttonDisabled","onPress","activeOpacity","onLayout","children","jsxs","View","buttonContent","width","marginRight","marginTop","fillColor","Text","hex","c","replace","length","split","map","x","join","parseInt","substr","g","b","StyleSheet","create","padding","borderRadius","alignItems","justifyContent","flexDirection","minHeight","opacity","oxyLogo","centeredItem","fontFamily","fontFamilies","phudu","fontWeight","_default","exports"],"sourceRoot":"../../../../src","sources":["ui/components/OxyPayButton.tsx"],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