@amityco/react-native-social-uikit 4.0.0 → 4.0.1-324acbfd.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 (318) hide show
  1. package/lib/commonjs/core/assets/icons/index.js +8 -0
  2. package/lib/commonjs/core/assets/icons/index.js.map +1 -1
  3. package/lib/commonjs/core/assets/icons/visitorLimit.js +30 -0
  4. package/lib/commonjs/core/assets/icons/visitorLimit.js.map +1 -0
  5. package/lib/commonjs/core/constants/index.js +11 -1
  6. package/lib/commonjs/core/constants/index.js.map +1 -1
  7. package/lib/commonjs/core/hooks/useAuth.js +6 -2
  8. package/lib/commonjs/core/hooks/useAuth.js.map +1 -1
  9. package/lib/commonjs/core/providers/AmityUIKitProvider.js.map +1 -1
  10. package/lib/commonjs/core/providers/AuthProvider.js +46 -16
  11. package/lib/commonjs/core/providers/AuthProvider.js.map +1 -1
  12. package/lib/commonjs/core/routes/AmityPageRenderer.js +5 -1
  13. package/lib/commonjs/core/routes/AmityPageRenderer.js.map +1 -1
  14. package/lib/commonjs/core/routes/AmityUIKitNavigator.js +42 -1
  15. package/lib/commonjs/core/routes/AmityUIKitNavigator.js.map +1 -1
  16. package/lib/commonjs/index.js +12 -0
  17. package/lib/commonjs/index.js.map +1 -1
  18. package/lib/commonjs/social/components/Social/CommentList/CommentList.js +7 -1
  19. package/lib/commonjs/social/components/Social/CommentList/CommentList.js.map +1 -1
  20. package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js +16 -3
  21. package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
  22. package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js +12 -2
  23. package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
  24. package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +6 -1
  25. package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  26. package/lib/commonjs/social/enums/enumUIKitID.js +2 -0
  27. package/lib/commonjs/social/enums/enumUIKitID.js.map +1 -1
  28. package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +15 -3
  29. package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
  30. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js +12 -2
  31. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
  32. package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js +5 -1
  33. package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
  34. package/lib/commonjs/social/features/post/Detail/index.js +8 -2
  35. package/lib/commonjs/social/features/post/Detail/index.js.map +1 -1
  36. package/lib/commonjs/social/features/post/components/Content/Content.js +5 -1
  37. package/lib/commonjs/social/features/post/components/Content/Content.js.map +1 -1
  38. package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js +9 -1
  39. package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
  40. package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js +9 -1
  41. package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
  42. package/lib/commonjs/social/features/user/CreateProfile/CreateProfile.js +114 -0
  43. package/lib/commonjs/social/features/user/CreateProfile/CreateProfile.js.map +1 -0
  44. package/lib/commonjs/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.js +78 -0
  45. package/lib/commonjs/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.js.map +1 -0
  46. package/lib/commonjs/social/features/user/CreateProfile/components/ImageUpload/index.js +13 -0
  47. package/lib/commonjs/social/features/user/CreateProfile/components/ImageUpload/index.js.map +1 -0
  48. package/lib/commonjs/social/features/user/CreateProfile/components/ImageUpload/styles.js +51 -0
  49. package/lib/commonjs/social/features/user/CreateProfile/components/ImageUpload/styles.js.map +1 -0
  50. package/lib/commonjs/social/features/user/CreateProfile/components/TopBar/TopBar.js +34 -0
  51. package/lib/commonjs/social/features/user/CreateProfile/components/TopBar/TopBar.js.map +1 -0
  52. package/lib/commonjs/social/features/user/CreateProfile/components/TopBar/index.js +13 -0
  53. package/lib/commonjs/social/features/user/CreateProfile/components/TopBar/index.js.map +1 -0
  54. package/lib/commonjs/social/features/user/CreateProfile/components/TopBar/styles.js +37 -0
  55. package/lib/commonjs/social/features/user/CreateProfile/components/TopBar/styles.js.map +1 -0
  56. package/lib/commonjs/social/features/user/CreateProfile/components/index.js +28 -0
  57. package/lib/commonjs/social/features/user/CreateProfile/components/index.js.map +1 -0
  58. package/lib/commonjs/social/features/user/CreateProfile/hooks/index.js +17 -0
  59. package/lib/commonjs/social/features/user/CreateProfile/hooks/index.js.map +1 -0
  60. package/lib/commonjs/social/features/user/CreateProfile/hooks/useCreateProfile.js +194 -0
  61. package/lib/commonjs/social/features/user/CreateProfile/hooks/useCreateProfile.js.map +1 -0
  62. package/lib/commonjs/social/features/user/CreateProfile/index.js +13 -0
  63. package/lib/commonjs/social/features/user/CreateProfile/index.js.map +1 -0
  64. package/lib/commonjs/social/features/user/CreateProfile/styles.js +40 -0
  65. package/lib/commonjs/social/features/user/CreateProfile/styles.js.map +1 -0
  66. package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js +6 -1
  67. package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
  68. package/lib/commonjs/social/hooks/index.js +11 -0
  69. package/lib/commonjs/social/hooks/index.js.map +1 -1
  70. package/lib/commonjs/social/hooks/useGlobalBehavior.js +53 -0
  71. package/lib/commonjs/social/hooks/useGlobalBehavior.js.map +1 -0
  72. package/lib/commonjs/social/hooks/usePostPermission.js +4 -2
  73. package/lib/commonjs/social/hooks/usePostPermission.js.map +1 -1
  74. package/lib/commonjs/social/hooks/useStoryPermission.js +3 -2
  75. package/lib/commonjs/social/hooks/useStoryPermission.js.map +1 -1
  76. package/lib/commonjs/social/index.js +13 -0
  77. package/lib/commonjs/social/index.js.map +1 -1
  78. package/lib/commonjs/social/providers/BehaviourProvider.js +1 -0
  79. package/lib/commonjs/social/providers/BehaviourProvider.js.map +1 -1
  80. package/lib/commonjs/social/screens/CreateUserProfile/CreateUserProfile.js +20 -0
  81. package/lib/commonjs/social/screens/CreateUserProfile/CreateUserProfile.js.map +1 -0
  82. package/lib/commonjs/social/screens/CreateUserProfile/index.js +13 -0
  83. package/lib/commonjs/social/screens/CreateUserProfile/index.js.map +1 -0
  84. package/lib/commonjs/social/screens/SocialHomePage/index.js +22 -7
  85. package/lib/commonjs/social/screens/SocialHomePage/index.js.map +1 -1
  86. package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +78 -0
  87. package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +1 -0
  88. package/lib/commonjs/social/screens/VisitorUsageLimit/index.js +13 -0
  89. package/lib/commonjs/social/screens/VisitorUsageLimit/index.js.map +1 -0
  90. package/lib/commonjs/social/screens/VisitorUsageLimit/styles.js +50 -0
  91. package/lib/commonjs/social/screens/VisitorUsageLimit/styles.js.map +1 -0
  92. package/lib/commonjs/social/screens/index.js +11 -0
  93. package/lib/commonjs/social/screens/index.js.map +1 -1
  94. package/lib/module/core/assets/icons/index.js +1 -0
  95. package/lib/module/core/assets/icons/index.js.map +1 -1
  96. package/lib/module/core/assets/icons/visitorLimit.js +23 -0
  97. package/lib/module/core/assets/icons/visitorLimit.js.map +1 -0
  98. package/lib/module/core/constants/index.js +10 -0
  99. package/lib/module/core/constants/index.js.map +1 -1
  100. package/lib/module/core/hooks/useAuth.js +6 -2
  101. package/lib/module/core/hooks/useAuth.js.map +1 -1
  102. package/lib/module/core/providers/AmityUIKitProvider.js.map +1 -1
  103. package/lib/module/core/providers/AuthProvider.js +46 -16
  104. package/lib/module/core/providers/AuthProvider.js.map +1 -1
  105. package/lib/module/core/routes/AmityPageRenderer.js +5 -1
  106. package/lib/module/core/routes/AmityPageRenderer.js.map +1 -1
  107. package/lib/module/core/routes/AmityUIKitNavigator.js +42 -1
  108. package/lib/module/core/routes/AmityUIKitNavigator.js.map +1 -1
  109. package/lib/module/index.js +2 -2
  110. package/lib/module/index.js.map +1 -1
  111. package/lib/module/social/components/Social/CommentList/CommentList.js +7 -1
  112. package/lib/module/social/components/Social/CommentList/CommentList.js.map +1 -1
  113. package/lib/module/social/components/Social/CommentListItem/CommentListItem.js +16 -3
  114. package/lib/module/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
  115. package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js +12 -2
  116. package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
  117. package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +7 -2
  118. package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  119. package/lib/module/social/enums/enumUIKitID.js +2 -0
  120. package/lib/module/social/enums/enumUIKitID.js.map +1 -1
  121. package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +16 -4
  122. package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
  123. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js +12 -2
  124. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
  125. package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js +5 -1
  126. package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
  127. package/lib/module/social/features/post/Detail/index.js +8 -2
  128. package/lib/module/social/features/post/Detail/index.js.map +1 -1
  129. package/lib/module/social/features/post/components/Content/Content.js +5 -1
  130. package/lib/module/social/features/post/components/Content/Content.js.map +1 -1
  131. package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js +10 -2
  132. package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
  133. package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js +10 -2
  134. package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
  135. package/lib/module/social/features/user/CreateProfile/CreateProfile.js +107 -0
  136. package/lib/module/social/features/user/CreateProfile/CreateProfile.js.map +1 -0
  137. package/lib/module/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.js +72 -0
  138. package/lib/module/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.js.map +1 -0
  139. package/lib/module/social/features/user/CreateProfile/components/ImageUpload/index.js +2 -0
  140. package/lib/module/social/features/user/CreateProfile/components/ImageUpload/index.js.map +1 -0
  141. package/lib/module/social/features/user/CreateProfile/components/ImageUpload/styles.js +44 -0
  142. package/lib/module/social/features/user/CreateProfile/components/ImageUpload/styles.js.map +1 -0
  143. package/lib/module/social/features/user/CreateProfile/components/TopBar/TopBar.js +27 -0
  144. package/lib/module/social/features/user/CreateProfile/components/TopBar/TopBar.js.map +1 -0
  145. package/lib/module/social/features/user/CreateProfile/components/TopBar/index.js +2 -0
  146. package/lib/module/social/features/user/CreateProfile/components/TopBar/index.js.map +1 -0
  147. package/lib/module/social/features/user/CreateProfile/components/TopBar/styles.js +30 -0
  148. package/lib/module/social/features/user/CreateProfile/components/TopBar/styles.js.map +1 -0
  149. package/lib/module/social/features/user/CreateProfile/components/index.js +3 -0
  150. package/lib/module/social/features/user/CreateProfile/components/index.js.map +1 -0
  151. package/lib/module/social/features/user/CreateProfile/hooks/index.js +2 -0
  152. package/lib/module/social/features/user/CreateProfile/hooks/index.js.map +1 -0
  153. package/lib/module/social/features/user/CreateProfile/hooks/useCreateProfile.js +187 -0
  154. package/lib/module/social/features/user/CreateProfile/hooks/useCreateProfile.js.map +1 -0
  155. package/lib/module/social/features/user/CreateProfile/index.js +2 -0
  156. package/lib/module/social/features/user/CreateProfile/index.js.map +1 -0
  157. package/lib/module/social/features/user/CreateProfile/styles.js +33 -0
  158. package/lib/module/social/features/user/CreateProfile/styles.js.map +1 -0
  159. package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js +7 -2
  160. package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
  161. package/lib/module/social/hooks/index.js +1 -0
  162. package/lib/module/social/hooks/index.js.map +1 -1
  163. package/lib/module/social/hooks/useGlobalBehavior.js +45 -0
  164. package/lib/module/social/hooks/useGlobalBehavior.js.map +1 -0
  165. package/lib/module/social/hooks/usePostPermission.js +4 -2
  166. package/lib/module/social/hooks/usePostPermission.js.map +1 -1
  167. package/lib/module/social/hooks/useStoryPermission.js +3 -2
  168. package/lib/module/social/hooks/useStoryPermission.js.map +1 -1
  169. package/lib/module/social/index.js +2 -1
  170. package/lib/module/social/index.js.map +1 -1
  171. package/lib/module/social/providers/BehaviourProvider.js +1 -0
  172. package/lib/module/social/providers/BehaviourProvider.js.map +1 -1
  173. package/lib/module/social/screens/CreateUserProfile/CreateUserProfile.js +14 -0
  174. package/lib/module/social/screens/CreateUserProfile/CreateUserProfile.js.map +1 -0
  175. package/lib/module/social/screens/CreateUserProfile/index.js +2 -0
  176. package/lib/module/social/screens/CreateUserProfile/index.js.map +1 -0
  177. package/lib/module/social/screens/SocialHomePage/index.js +23 -8
  178. package/lib/module/social/screens/SocialHomePage/index.js.map +1 -1
  179. package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +72 -0
  180. package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +1 -0
  181. package/lib/module/social/screens/VisitorUsageLimit/index.js +2 -0
  182. package/lib/module/social/screens/VisitorUsageLimit/index.js.map +1 -0
  183. package/lib/module/social/screens/VisitorUsageLimit/styles.js +43 -0
  184. package/lib/module/social/screens/VisitorUsageLimit/styles.js.map +1 -0
  185. package/lib/module/social/screens/index.js +1 -0
  186. package/lib/module/social/screens/index.js.map +1 -1
  187. package/lib/typescript/core/assets/icons/index.d.ts +1 -0
  188. package/lib/typescript/core/assets/icons/index.d.ts.map +1 -1
  189. package/lib/typescript/core/assets/icons/visitorLimit.d.ts +3 -0
  190. package/lib/typescript/core/assets/icons/visitorLimit.d.ts.map +1 -0
  191. package/lib/typescript/core/constants/index.d.ts +8 -0
  192. package/lib/typescript/core/constants/index.d.ts.map +1 -1
  193. package/lib/typescript/core/hooks/useAuth.d.ts.map +1 -1
  194. package/lib/typescript/core/providers/AmityUIKitProvider.d.ts +2 -1
  195. package/lib/typescript/core/providers/AmityUIKitProvider.d.ts.map +1 -1
  196. package/lib/typescript/core/providers/AuthProvider.d.ts.map +1 -1
  197. package/lib/typescript/core/routes/AmityPageRenderer.d.ts.map +1 -1
  198. package/lib/typescript/core/routes/AmityUIKitNavigator.d.ts.map +1 -1
  199. package/lib/typescript/core/routes/RouteParamList.d.ts +1 -0
  200. package/lib/typescript/core/routes/RouteParamList.d.ts.map +1 -1
  201. package/lib/typescript/core/types/auth.d.ts +2 -0
  202. package/lib/typescript/core/types/auth.d.ts.map +1 -1
  203. package/lib/typescript/core/types/behaviour.d.ts +18 -0
  204. package/lib/typescript/core/types/behaviour.d.ts.map +1 -1
  205. package/lib/typescript/index.d.ts +2 -2
  206. package/lib/typescript/index.d.ts.map +1 -1
  207. package/lib/typescript/social/components/Social/CommentList/CommentList.d.ts.map +1 -1
  208. package/lib/typescript/social/components/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
  209. package/lib/typescript/social/components/legacy/Social/ReplyCommentList/index.d.ts.map +1 -1
  210. package/lib/typescript/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.d.ts.map +1 -1
  211. package/lib/typescript/social/enums/enumUIKitID.d.ts +2 -0
  212. package/lib/typescript/social/enums/enumUIKitID.d.ts.map +1 -1
  213. package/lib/typescript/social/features/comment/components/PostComment/CommentListItem/CommentListItem.d.ts.map +1 -1
  214. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/index.d.ts.map +1 -1
  215. package/lib/typescript/social/features/feed/components/TopNavigation/TopNavigation.d.ts.map +1 -1
  216. package/lib/typescript/social/features/post/Detail/index.d.ts.map +1 -1
  217. package/lib/typescript/social/features/post/components/Content/Content.d.ts.map +1 -1
  218. package/lib/typescript/social/features/post/components/EngagementActions/Components/DetailStyle.d.ts.map +1 -1
  219. package/lib/typescript/social/features/post/components/EngagementActions/Components/FeedStyle.d.ts.map +1 -1
  220. package/lib/typescript/social/features/user/CreateProfile/CreateProfile.d.ts +28 -0
  221. package/lib/typescript/social/features/user/CreateProfile/CreateProfile.d.ts.map +1 -0
  222. package/lib/typescript/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.d.ts +9 -0
  223. package/lib/typescript/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.d.ts.map +1 -0
  224. package/lib/typescript/social/features/user/CreateProfile/components/ImageUpload/index.d.ts +2 -0
  225. package/lib/typescript/social/features/user/CreateProfile/components/ImageUpload/index.d.ts.map +1 -0
  226. package/lib/typescript/social/features/user/CreateProfile/components/ImageUpload/styles.d.ts +39 -0
  227. package/lib/typescript/social/features/user/CreateProfile/components/ImageUpload/styles.d.ts.map +1 -0
  228. package/lib/typescript/social/features/user/CreateProfile/components/TopBar/TopBar.d.ts +7 -0
  229. package/lib/typescript/social/features/user/CreateProfile/components/TopBar/TopBar.d.ts.map +1 -0
  230. package/lib/typescript/social/features/user/CreateProfile/components/TopBar/index.d.ts +2 -0
  231. package/lib/typescript/social/features/user/CreateProfile/components/TopBar/index.d.ts.map +1 -0
  232. package/lib/typescript/social/features/user/CreateProfile/components/TopBar/styles.d.ts +25 -0
  233. package/lib/typescript/social/features/user/CreateProfile/components/TopBar/styles.d.ts.map +1 -0
  234. package/lib/typescript/social/features/user/CreateProfile/components/index.d.ts +3 -0
  235. package/lib/typescript/social/features/user/CreateProfile/components/index.d.ts.map +1 -0
  236. package/lib/typescript/social/features/user/CreateProfile/hooks/index.d.ts +2 -0
  237. package/lib/typescript/social/features/user/CreateProfile/hooks/index.d.ts.map +1 -0
  238. package/lib/typescript/social/features/user/CreateProfile/hooks/useCreateProfile.d.ts +74 -0
  239. package/lib/typescript/social/features/user/CreateProfile/hooks/useCreateProfile.d.ts.map +1 -0
  240. package/lib/typescript/social/features/user/CreateProfile/index.d.ts +3 -0
  241. package/lib/typescript/social/features/user/CreateProfile/index.d.ts.map +1 -0
  242. package/lib/typescript/social/features/user/CreateProfile/styles.d.ts +28 -0
  243. package/lib/typescript/social/features/user/CreateProfile/styles.d.ts.map +1 -0
  244. package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts.map +1 -1
  245. package/lib/typescript/social/hooks/index.d.ts +1 -0
  246. package/lib/typescript/social/hooks/index.d.ts.map +1 -1
  247. package/lib/typescript/social/hooks/useGlobalBehavior.d.ts +23 -0
  248. package/lib/typescript/social/hooks/useGlobalBehavior.d.ts.map +1 -0
  249. package/lib/typescript/social/hooks/usePostPermission.d.ts.map +1 -1
  250. package/lib/typescript/social/hooks/useStoryPermission.d.ts.map +1 -1
  251. package/lib/typescript/social/index.d.ts +2 -1
  252. package/lib/typescript/social/index.d.ts.map +1 -1
  253. package/lib/typescript/social/providers/BehaviourProvider.d.ts.map +1 -1
  254. package/lib/typescript/social/screens/CreateUserProfile/CreateUserProfile.d.ts +7 -0
  255. package/lib/typescript/social/screens/CreateUserProfile/CreateUserProfile.d.ts.map +1 -0
  256. package/lib/typescript/social/screens/CreateUserProfile/index.d.ts +3 -0
  257. package/lib/typescript/social/screens/CreateUserProfile/index.d.ts.map +1 -0
  258. package/lib/typescript/social/screens/SocialHomePage/index.d.ts.map +1 -1
  259. package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts +2 -0
  260. package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts.map +1 -0
  261. package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts +2 -0
  262. package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts.map +1 -0
  263. package/lib/typescript/social/screens/VisitorUsageLimit/styles.d.ts +38 -0
  264. package/lib/typescript/social/screens/VisitorUsageLimit/styles.d.ts.map +1 -0
  265. package/lib/typescript/social/screens/index.d.ts +1 -0
  266. package/lib/typescript/social/screens/index.d.ts.map +1 -1
  267. package/package.json +3 -3
  268. package/src/core/assets/icons/index.ts +1 -0
  269. package/src/core/assets/icons/visitorLimit.tsx +23 -0
  270. package/src/core/constants/index.ts +12 -0
  271. package/src/core/hooks/useAuth.ts +4 -0
  272. package/src/core/providers/AmityUIKitProvider.tsx +2 -1
  273. package/src/core/providers/AuthProvider.tsx +41 -12
  274. package/src/core/routes/AmityPageRenderer.tsx +11 -0
  275. package/src/core/routes/AmityUIKitNavigator.tsx +38 -1
  276. package/src/core/routes/RouteParamList.tsx +4 -0
  277. package/src/core/types/auth.ts +2 -0
  278. package/src/core/types/behaviour.ts +18 -0
  279. package/src/index.tsx +4 -0
  280. package/src/social/components/Social/CommentList/CommentList.tsx +5 -1
  281. package/src/social/components/Social/CommentListItem/CommentListItem.tsx +19 -12
  282. package/src/social/components/legacy/Social/ReplyCommentList/index.tsx +17 -11
  283. package/src/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +10 -2
  284. package/src/social/enums/enumUIKitID.ts +2 -0
  285. package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx +22 -16
  286. package/src/social/features/comment/components/PostComment/ReplyCommentList/index.tsx +17 -11
  287. package/src/social/features/feed/components/TopNavigation/TopNavigation.tsx +3 -1
  288. package/src/social/features/post/Detail/index.tsx +6 -2
  289. package/src/social/features/post/components/Content/Content.tsx +7 -4
  290. package/src/social/features/post/components/EngagementActions/Components/DetailStyle.tsx +7 -2
  291. package/src/social/features/post/components/EngagementActions/Components/FeedStyle.tsx +7 -2
  292. package/src/social/features/user/CreateProfile/CreateProfile.tsx +121 -0
  293. package/src/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.tsx +85 -0
  294. package/src/social/features/user/CreateProfile/components/ImageUpload/index.ts +1 -0
  295. package/src/social/features/user/CreateProfile/components/ImageUpload/styles.ts +44 -0
  296. package/src/social/features/user/CreateProfile/components/TopBar/TopBar.tsx +30 -0
  297. package/src/social/features/user/CreateProfile/components/TopBar/index.ts +1 -0
  298. package/src/social/features/user/CreateProfile/components/TopBar/styles.ts +30 -0
  299. package/src/social/features/user/CreateProfile/components/index.ts +2 -0
  300. package/src/social/features/user/CreateProfile/hooks/index.ts +1 -0
  301. package/src/social/features/user/CreateProfile/hooks/useCreateProfile.ts +186 -0
  302. package/src/social/features/user/CreateProfile/index.ts +2 -0
  303. package/src/social/features/user/CreateProfile/styles.ts +33 -0
  304. package/src/social/features/user/Profile/components/Header/hooks/useHeader.ts +5 -2
  305. package/src/social/hooks/index.ts +1 -0
  306. package/src/social/hooks/useGlobalBehavior.ts +39 -0
  307. package/src/social/hooks/usePostPermission.ts +3 -1
  308. package/src/social/hooks/useStoryPermission.ts +8 -6
  309. package/src/social/index.tsx +2 -0
  310. package/src/social/providers/BehaviourProvider.tsx +1 -0
  311. package/src/social/screens/CreateUserProfile/CreateUserProfile.tsx +19 -0
  312. package/src/social/screens/CreateUserProfile/index.ts +2 -0
  313. package/src/social/screens/SocialHomePage/index.tsx +36 -13
  314. package/src/social/screens/VisitorUsageLimit/VisitorUsageLimit.tsx +78 -0
  315. package/src/social/screens/VisitorUsageLimit/index.ts +1 -0
  316. package/src/social/screens/VisitorUsageLimit/styles.ts +43 -0
  317. package/src/social/screens/index.ts +1 -0
  318. package/uikit.config.json +17 -0
@@ -43,7 +43,7 @@ import { useTheme } from 'react-native-paper';
43
43
  import type { MyMD3Theme } from '../../../../../../core/providers/AmityUIKitProvider';
44
44
  import ReplyCommentList from '../ReplyCommentList/index';
45
45
  import { CommentRepository } from '@amityco/ts-sdk-react-native';
46
- import { useTimeDifference } from '../../../../../hooks';
46
+ import { useGlobalBehavior, useTimeDifference } from '../../../../../hooks';
47
47
  import ModeratorBadgeElement from '../../../../../elements/ModeratorBadgeElement/ModeratorBadgeElement';
48
48
  import { BrandBadge } from '../../../../../elements/BrandBadge';
49
49
  import { ComponentID, PageID } from '../../../../../enums';
@@ -315,6 +315,13 @@ const CommentListItem = ({
315
315
  onClickReply && onClickReply(user, commentId);
316
316
  };
317
317
 
318
+ // Web parity: visitors see Like/Reply but taps show the sign-in toast
319
+ const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
320
+ const onPressLike = () =>
321
+ handleGlobalBehavior({ defaultBehavior: addReactionToComment });
322
+ const onPressReply = () =>
323
+ handleGlobalBehavior({ defaultBehavior: onHandleReply });
324
+
318
325
  const onPressCommentReaction = () => {
319
326
  onNavigate && onNavigate();
320
327
  setIsReactionListVisible(true);
@@ -399,27 +406,26 @@ const CommentListItem = ({
399
406
  )}
400
407
  </View>
401
408
 
402
- <TouchableOpacity
403
- onPress={() => addReactionToComment()}
404
- style={styles.likeBtn}
405
- >
409
+ <TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
406
410
  <Text style={isLike ? styles.likedText : styles.btnText}>
407
411
  {!isLike ? 'Like' : 'Liked'}
408
412
  </Text>
409
413
  </TouchableOpacity>
410
- <TouchableOpacity
411
- onPress={onHandleReply}
412
- style={styles.likeBtn}
413
- >
414
+ <TouchableOpacity onPress={onPressReply} style={styles.likeBtn}>
414
415
  <Text style={styles.btnText}>Reply</Text>
415
416
  </TouchableOpacity>
416
- <TouchableOpacity onPress={openModal} style={styles.threeDots}>
417
- <SvgXml
418
- xml={threeDots(theme.colors.base)}
419
- width="20"
420
- height="16"
421
- />
422
- </TouchableOpacity>
417
+ {!isVisitorOrBot && (
418
+ <TouchableOpacity
419
+ onPress={openModal}
420
+ style={styles.threeDots}
421
+ >
422
+ <SvgXml
423
+ xml={threeDots(theme.colors.base)}
424
+ width="20"
425
+ height="16"
426
+ />
427
+ </TouchableOpacity>
428
+ )}
423
429
  </View>
424
430
 
425
431
  {likeReaction > 0 && (
@@ -27,6 +27,7 @@ import {
27
27
  import { Pressable } from 'react-native';
28
28
  import useAuth from '../../../../../../core/hooks/useAuth';
29
29
  import { useTimeDifference } from '../../../../../hooks/useTimeDifference';
30
+ import { useGlobalBehavior } from '../../../../../hooks/useGlobalBehavior';
30
31
  import {
31
32
  isReportTarget,
32
33
  reportTargetById,
@@ -144,6 +145,12 @@ const ReplyCommentList = ({
144
145
  await addCommentReaction(commentId, 'like');
145
146
  }
146
147
  };
148
+
149
+ // Web parity: visitors see Like but taps show the sign-in toast
150
+ const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
151
+ const onPressLike = () =>
152
+ handleGlobalBehavior({ defaultBehavior: addReactionToComment });
153
+
147
154
  const deleteReplyComment = () => {
148
155
  Alert.alert('Delete reply', 'This reply will be permanently deleted.', [
149
156
  {
@@ -292,21 +299,20 @@ const ReplyCommentList = ({
292
299
  )}
293
300
  </View>
294
301
 
295
- <TouchableOpacity
296
- onPress={() => addReactionToComment()}
297
- style={styles.likeBtn}
298
- >
302
+ <TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
299
303
  <Text style={isLike ? styles.likedText : styles.btnText}>
300
304
  {!isLike ? 'Like' : 'Liked'}
301
305
  </Text>
302
306
  </TouchableOpacity>
303
- <TouchableOpacity onPress={openModal} style={styles.threeDots}>
304
- <SvgXml
305
- xml={threeDots(theme.colors.base)}
306
- width="20"
307
- height="16"
308
- />
309
- </TouchableOpacity>
307
+ {!isVisitorOrBot && (
308
+ <TouchableOpacity onPress={openModal} style={styles.threeDots}>
309
+ <SvgXml
310
+ xml={threeDots(theme.colors.base)}
311
+ width="20"
312
+ height="16"
313
+ />
314
+ </TouchableOpacity>
315
+ )}
310
316
  </View>
311
317
 
312
318
  {likeReaction > 0 && (
@@ -15,6 +15,7 @@ import AmityCreatePostMenuComponent from '../CreatePostMenu';
15
15
  import TextKeyElement from '../../../../elements/TextKeyElement/TextKeyElement';
16
16
  import { usePopup } from '../../../../hooks/usePopup';
17
17
  import Popup from '../../../../components/PopupMenu/PopupMenu';
18
+ import useAuth from '../../../../../core/hooks/useAuth';
18
19
 
19
20
  type AmitySocialHomeTopNavigationComponentType = {
20
21
  activeTab: string;
@@ -29,6 +30,7 @@ const AmitySocialHomeTopNavigationComponent: FC<
29
30
  const theme = componentConfig.themeStyles;
30
31
  const { AmitySocialHomeTopNavigationComponentBehaviour } = useBehaviour();
31
32
  const { isOpen, setIsOpen, toggle } = usePopup();
33
+ const { isVisitorOrBot } = useAuth();
32
34
 
33
35
  const [myCommunitiesTab] = useUiKitConfig({
34
36
  page: PageID.social_home_page,
@@ -169,7 +171,7 @@ const AmitySocialHomeTopNavigationComponent: FC<
169
171
  >
170
172
  <Image source={searchIcon} style={styles.icon} />
171
173
  </TouchableOpacity>
172
- {activeTab !== exploreTab && (
174
+ {!isVisitorOrBot && activeTab !== exploreTab && (
173
175
  <TouchableOpacity
174
176
  style={styles.iconBtn}
175
177
  onPress={onPressCreate}
@@ -43,6 +43,7 @@ import NetInfo from '@react-native-community/netinfo';
43
43
  import { useToast } from '../../../../core/stores/slices/toastSlice';
44
44
  import MyAvatar from '../../../components/MyAvatar/MyAvatar';
45
45
  import { MAX_MENTION_USERS } from '../../../../core/constants';
46
+ import useAuth from '../../../../core/hooks/useAuth';
46
47
 
47
48
  import { SafeAreaView } from 'react-native-safe-area-context';
48
49
  import ErrorComponent from '../../../components/ErrorComponent/ErrorComponent';
@@ -73,6 +74,9 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
73
74
  }) => {
74
75
  const pageId = PageID.post_detail_page;
75
76
  const componentId = ComponentID.WildCardComponent;
77
+ // Web parity (CommentTray.canShowComposer): visitors never see the
78
+ // composer; comment rows stay visible and their actions toast on tap.
79
+ const { isVisitorOrBot } = useAuth();
76
80
  const disabledInteraction = false;
77
81
  const navigation =
78
82
  useNavigation<NativeStackNavigationProp<RootStackParamList>>();
@@ -285,7 +289,7 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
285
289
  </TouchableOpacity>
286
290
  </View>
287
291
  )}
288
- {!disabledInteraction && (
292
+ {!disabledInteraction && !isVisitorOrBot && (
289
293
  <View style={styles.InputWrap}>
290
294
  <MyAvatar style={styles.myAvatar} />
291
295
  <View style={styles.inputContainer}>
@@ -398,7 +402,7 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
398
402
  postData?.targetType === 'community' && postData?.targetId
399
403
  }
400
404
  postType="post"
401
- disabledInteraction={false}
405
+ disabledInteraction={disabledInteraction}
402
406
  ListHeaderComponent={
403
407
  postData && (
404
408
  <AmityPostContentComponent
@@ -35,6 +35,7 @@ import { PostMenu } from '../../../../components/PostMenu';
35
35
  import PinBadge from '../../../../elements/PinBadge';
36
36
  import AnnouncementBadge from '../../../../elements/AnnouncementBadge';
37
37
  import { Typography } from '../../../../../core/components/Typography/Typography';
38
+ import useAuth from '../../../../../core/hooks/useAuth';
38
39
 
39
40
  type AmityPostContentComponentProps = {
40
41
  post: Amity.Post;
@@ -74,6 +75,7 @@ const AmityPostContentComponent: FC<AmityPostContentComponentProps> = ({
74
75
  componentId: componentId,
75
76
  });
76
77
  const styles = useStyles(themeStyles);
78
+ const { isVisitorOrBot } = useAuth();
77
79
  const [textPost, setTextPost] = useState<string>('');
78
80
  const [communityData, setCommunityData] = useState<Amity.Community>(null);
79
81
  const navigation =
@@ -292,10 +294,11 @@ const AmityPostContentComponent: FC<AmityPostContentComponentProps> = ({
292
294
  category === AmityPostCategory.PIN_AND_ANNOUNCEMENT) && (
293
295
  <PinBadge componentId={ComponentID.post_content} />
294
296
  )}
295
- {AmityPostContentComponentStyle ===
296
- AmityPostContentComponentStyleEnum.feed && (
297
- <PostMenu post={post} pageId={pageId} componentId={componentId} />
298
- )}
297
+ {!isVisitorOrBot &&
298
+ AmityPostContentComponentStyle ===
299
+ AmityPostContentComponentStyleEnum.feed && (
300
+ <PostMenu post={post} pageId={pageId} componentId={componentId} />
301
+ )}
299
302
  </Pressable>
300
303
  <View>
301
304
  <View style={styles.bodySection}>
@@ -8,7 +8,7 @@ import {
8
8
  } from '@amityco/ts-sdk-react-native';
9
9
  import { AmityPostEngagementActionsSubComponentType } from './type';
10
10
  import { useStyles } from './styles';
11
- import { useAmityComponent } from '../../../../../hooks';
11
+ import { useAmityComponent, useGlobalBehavior } from '../../../../../hooks';
12
12
  import { PageID, ComponentID } from '../../../../../enums';
13
13
  import { SvgXml } from 'react-native-svg';
14
14
  import { likeReaction } from '../../../../../../core/assets/icons/xml';
@@ -34,6 +34,7 @@ const DetailStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
34
34
  componentId: ComponentID.post_content,
35
35
  });
36
36
  const styles = useStyles(themeStyles);
37
+ const { handleGlobalBehavior } = useGlobalBehavior();
37
38
  const [postData, setPostData] = useState<Amity.Post>(null);
38
39
 
39
40
  const { shareLink, handleSharePress } = usePostShareAction({
@@ -95,6 +96,10 @@ const DetailStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
95
96
  }
96
97
  }, [isLike, postId]);
97
98
 
99
+ const onPressReaction = useCallback(() => {
100
+ handleGlobalBehavior({ defaultBehavior: addReactionToPost });
101
+ }, [addReactionToPost, handleGlobalBehavior]);
102
+
98
103
  const onClickReactions = useCallback(() => {
99
104
  setIsReactionListVisible(true);
100
105
  }, []);
@@ -136,7 +141,7 @@ const DetailStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
136
141
  </View>
137
142
  <View style={[styles.actionSection, styles.detailActionSection]}>
138
143
  <View style={styles.row}>
139
- <TouchableOpacity onPress={addReactionToPost} style={styles.likeBtn}>
144
+ <TouchableOpacity onPress={onPressReaction} style={styles.likeBtn}>
140
145
  {isLike ? (
141
146
  <SvgXml
142
147
  xml={likeReaction(themeStyles.colors.background)}
@@ -8,7 +8,7 @@ import {
8
8
  subscribeTopic,
9
9
  } from '@amityco/ts-sdk-react-native';
10
10
  import { useStyles } from './styles';
11
- import { useAmityComponent } from '../../../../../hooks';
11
+ import { useAmityComponent, useGlobalBehavior } from '../../../../../hooks';
12
12
  import { PageID, ComponentID } from '../../../../../enums';
13
13
  import { SvgXml } from 'react-native-svg';
14
14
  import { likeReaction } from '../../../../../../core/assets/icons/xml';
@@ -38,6 +38,7 @@ const FeedStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
38
38
  });
39
39
  const styles = useStyles(themeStyles);
40
40
  const { AmityGlobalFeedComponentBehavior } = useBehaviour();
41
+ const { handleGlobalBehavior } = useGlobalBehavior();
41
42
  const navigation =
42
43
  useNavigation<NativeStackNavigationProp<RootStackParamList>>();
43
44
  const [postData, setPostData] = useState<Amity.Post>(null);
@@ -81,6 +82,10 @@ const FeedStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
81
82
  }
82
83
  }, [isLike, postData, postId]);
83
84
 
85
+ const onPressReaction = useCallback(() => {
86
+ handleGlobalBehavior({ defaultBehavior: addReactionToPost });
87
+ }, [addReactionToPost, handleGlobalBehavior]);
88
+
84
89
  const onPressComment = useCallback(() => {
85
90
  if (AmityGlobalFeedComponentBehavior.goToPostDetailPage) {
86
91
  return AmityGlobalFeedComponentBehavior.goToPostDetailPage();
@@ -103,7 +108,7 @@ const FeedStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
103
108
  return (
104
109
  <Pressable onPress={onPressComment} style={styles.actionSection}>
105
110
  <View style={styles.row}>
106
- <TouchableOpacity onPress={addReactionToPost} style={styles.likeBtn}>
111
+ <TouchableOpacity onPress={onPressReaction} style={styles.likeBtn}>
107
112
  {isLike ? (
108
113
  <SvgXml
109
114
  xml={likeReaction(themeStyles.colors.background)}
@@ -0,0 +1,121 @@
1
+ import { SafeAreaView } from 'react-native-safe-area-context';
2
+ import { KeyboardAvoidingView, Platform, ScrollView, View } from 'react-native';
3
+ import { Controller } from 'react-hook-form';
4
+ import { TopBar, ImageUpload } from './components';
5
+ import { useCreateProfile } from './hooks';
6
+ import FormInput from '../../../components/FormInput';
7
+ import { CHARACTER_LIMIT } from '../../../../core/constants';
8
+ import { ElementID, PageID } from '../../../enums';
9
+ import ActionButton from '../../../elements/ActionButton';
10
+
11
+ export type CreateProfileProps = {
12
+ /**
13
+ * The userId to create / sign in as. The profile is created on the network
14
+ * the first time this user logs in. Required because the page performs the
15
+ * real (signed-in) login on save.
16
+ */
17
+ userId: string;
18
+ /**
19
+ * Optional auth token for the signed-in login when the network uses secure
20
+ * mode. Mirrors `authToken` on AmityUiKitProvider.
21
+ */
22
+ authToken?: string;
23
+ /**
24
+ * Fired after the profile is successfully created and the user is signed in.
25
+ * Receives the created userId and the chosen displayName. The host decides
26
+ * what to render next (e.g. swap to the main UIKit / redirect to newsfeed).
27
+ */
28
+ onCreated?: (user: { userId: string; displayName: string }) => void;
29
+ /**
30
+ * Fired when the user dismisses the create-profile flow without creating.
31
+ */
32
+ onCancel?: () => void;
33
+ };
34
+
35
+ export function CreateProfile({
36
+ userId,
37
+ authToken,
38
+ onCreated,
39
+ onCancel,
40
+ }: CreateProfileProps) {
41
+ const {
42
+ styles,
43
+ control,
44
+ onSubmit,
45
+ isValid,
46
+ isSubmitting,
47
+ handleSubmit,
48
+ accessibilityId,
49
+ } = useCreateProfile({ userId, authToken, onCreated });
50
+
51
+ return (
52
+ <SafeAreaView testID={accessibilityId} style={styles.container}>
53
+ <TopBar onCancel={onCancel} disabled={isSubmitting} />
54
+ <KeyboardAvoidingView
55
+ style={styles.keyboardAvoidingView}
56
+ behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
57
+ >
58
+ <ScrollView contentContainerStyle={styles.contentContainer}>
59
+ <Controller
60
+ name="image"
61
+ control={control}
62
+ render={({ field: { onChange, value } }) => (
63
+ <ImageUpload
64
+ value={value}
65
+ onChange={onChange}
66
+ disabled={isSubmitting}
67
+ />
68
+ )}
69
+ />
70
+ <View style={styles.inputContainer}>
71
+ <Controller
72
+ name="displayName"
73
+ control={control}
74
+ render={({ field: { onChange, onBlur, value } }) => (
75
+ <FormInput
76
+ value={value}
77
+ onBlur={onBlur}
78
+ multiline={false}
79
+ editable={!isSubmitting}
80
+ onChangeText={onChange}
81
+ placeholder="Username"
82
+ pageId={PageID.create_user_profile_page}
83
+ maxLength={CHARACTER_LIMIT.USER_DISPLAY_NAME}
84
+ elementId={ElementID.user_display_name_title}
85
+ />
86
+ )}
87
+ />
88
+ </View>
89
+ <View style={styles.inputContainer}>
90
+ <Controller
91
+ name="description"
92
+ control={control}
93
+ render={({ field: { onChange, onBlur, value } }) => (
94
+ <FormInput
95
+ optional
96
+ multiline
97
+ value={value}
98
+ onBlur={onBlur}
99
+ editable={!isSubmitting}
100
+ onChangeText={onChange}
101
+ placeholder="Write something about yourself"
102
+ pageId={PageID.create_user_profile_page}
103
+ elementId={ElementID.user_about_title}
104
+ maxLength={CHARACTER_LIMIT.USER_DESCRIPTION}
105
+ />
106
+ )}
107
+ />
108
+ </View>
109
+ </ScrollView>
110
+ <View style={styles.submitButtonContainer}>
111
+ <ActionButton
112
+ onPress={handleSubmit(onSubmit)}
113
+ pageId={PageID.create_user_profile_page}
114
+ elementId={ElementID.create_user_profile_button}
115
+ disabled={!isValid || isSubmitting}
116
+ />
117
+ </View>
118
+ </KeyboardAvoidingView>
119
+ </SafeAreaView>
120
+ );
121
+ }
@@ -0,0 +1,85 @@
1
+ import { Alert, TouchableOpacity, View } from 'react-native';
2
+ import { launchImageLibrary } from 'react-native-image-picker';
3
+ import { useStyles } from './styles';
4
+ import { SvgXml } from 'react-native-svg';
5
+ import { camera } from '../../../../../../core/assets/icons';
6
+ import { isValidImageType } from '../../../../../utils';
7
+ import { Avatar } from '../../../../../components';
8
+ import { Typography } from '../../../../../../core/components/Typography/Typography';
9
+ import type { LocalImage } from '../../hooks/useCreateProfile';
10
+
11
+ type ImageUploadProps = {
12
+ value?: LocalImage | null;
13
+ onChange: (image: LocalImage | null) => void;
14
+ disabled?: boolean;
15
+ };
16
+
17
+ // Pick-only: a visitor session is read-only, so the avatar can't be uploaded
18
+ // here. We hold the local image uri and the page uploads it after Client.login.
19
+ export function ImageUpload({ value, onChange, disabled }: ImageUploadProps) {
20
+ const { styles, theme } = useStyles();
21
+
22
+ const onPickImage = async () => {
23
+ const result = await launchImageLibrary({
24
+ mediaType: 'photo',
25
+ selectionLimit: 1,
26
+ includeBase64: false,
27
+ quality: 1,
28
+ });
29
+
30
+ if (result.didCancel || !result.assets || result.assets.length === 0) {
31
+ return;
32
+ }
33
+
34
+ const asset = result.assets[0];
35
+ if (!isValidImageType(asset?.type)) {
36
+ Alert.alert(
37
+ 'Unsupported image type',
38
+ 'Please upload a PNG or JPG image.',
39
+ [{ text: 'OK' }]
40
+ );
41
+ return;
42
+ }
43
+
44
+ if (asset?.uri) {
45
+ onChange({ uri: asset.uri });
46
+ }
47
+ };
48
+
49
+ return (
50
+ <View style={[styles.container, disabled && styles.disabled]}>
51
+ <TouchableOpacity
52
+ hitSlop={0.8}
53
+ activeOpacity={0.7}
54
+ disabled={disabled}
55
+ style={styles.imageContainer}
56
+ onPress={onPickImage}
57
+ >
58
+ <Avatar.User
59
+ uri={value?.uri}
60
+ viewable={false}
61
+ userId=""
62
+ imageStyle={styles.image}
63
+ shouldRedirectToUserProfile={false}
64
+ />
65
+ <View style={styles.iconContainer}>
66
+ <SvgXml
67
+ width={24}
68
+ height={24}
69
+ xml={camera()}
70
+ color={theme.colors.white}
71
+ />
72
+ </View>
73
+ </TouchableOpacity>
74
+ <TouchableOpacity
75
+ activeOpacity={0.7}
76
+ disabled={disabled}
77
+ onPress={onPickImage}
78
+ >
79
+ <Typography.BodyBold style={styles.choosePhotoLabel}>
80
+ Choose a photo
81
+ </Typography.BodyBold>
82
+ </TouchableOpacity>
83
+ </View>
84
+ );
85
+ }
@@ -0,0 +1 @@
1
+ export { ImageUpload } from './ImageUpload';
@@ -0,0 +1,44 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import { useTheme } from 'react-native-paper';
3
+ import { MyMD3Theme } from '../../../../../../core/providers/AmityUIKitProvider';
4
+
5
+ export const useStyles = () => {
6
+ const theme = useTheme<MyMD3Theme>();
7
+
8
+ const styles = StyleSheet.create({
9
+ container: {
10
+ gap: 8,
11
+ flexDirection: 'column',
12
+ alignItems: 'center',
13
+ justifyContent: 'center',
14
+ },
15
+ choosePhotoLabel: {
16
+ color: theme.colors.primary,
17
+ },
18
+ disabled: {
19
+ opacity: 0.5,
20
+ },
21
+ imageContainer: {
22
+ width: 64,
23
+ height: 64,
24
+ borderRadius: 100,
25
+ position: 'relative',
26
+ },
27
+ image: {
28
+ width: '100%',
29
+ height: '100%',
30
+ borderRadius: 100,
31
+ objectFit: 'cover',
32
+ },
33
+ iconContainer: {
34
+ inset: 0,
35
+ zIndex: 10,
36
+ padding: 20,
37
+ borderRadius: 100,
38
+ position: 'absolute',
39
+ backgroundColor: theme.colors.transparentBlack,
40
+ },
41
+ });
42
+
43
+ return { styles, theme };
44
+ };
@@ -0,0 +1,30 @@
1
+ import { View } from 'react-native';
2
+ import { useStyles } from './styles';
3
+ import BackButton from '../../../../../elements/BackButton';
4
+ import { Title } from '../../../../../elements';
5
+ import { ElementID, PageID } from '../../../../../enums';
6
+
7
+ type TopBarProps = {
8
+ onCancel?: () => void;
9
+ disabled?: boolean;
10
+ };
11
+
12
+ export function TopBar({ onCancel, disabled }: TopBarProps) {
13
+ const { styles } = useStyles();
14
+
15
+ return (
16
+ <View style={styles.container}>
17
+ <BackButton
18
+ disabled={disabled}
19
+ pageId={PageID.create_user_profile_page}
20
+ onPress={onCancel}
21
+ />
22
+ <Title
23
+ style={styles.title}
24
+ pageId={PageID.create_user_profile_page}
25
+ elementId={ElementID.title}
26
+ />
27
+ <View style={styles.dummy} />
28
+ </View>
29
+ );
30
+ }
@@ -0,0 +1 @@
1
+ export { TopBar } from './TopBar';
@@ -0,0 +1,30 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import type { MyMD3Theme } from '../../../../../../core/providers/AmityUIKitProvider';
3
+ import { useTheme } from 'react-native-paper';
4
+
5
+ export const useStyles = () => {
6
+ const theme = useTheme<MyMD3Theme>();
7
+
8
+ const styles = StyleSheet.create({
9
+ container: {
10
+ gap: 8,
11
+ paddingVertical: 16,
12
+ flexDirection: 'row',
13
+ alignItems: 'center',
14
+ paddingHorizontal: 12,
15
+ justifyContent: 'space-between',
16
+ backgroundColor: theme.colors.background,
17
+ },
18
+ title: {
19
+ flex: 1,
20
+ textAlign: 'center',
21
+ color: theme.colors.base,
22
+ },
23
+ dummy: {
24
+ width: 24,
25
+ height: 24,
26
+ },
27
+ });
28
+
29
+ return { styles, theme };
30
+ };
@@ -0,0 +1,2 @@
1
+ export * from './ImageUpload';
2
+ export * from './TopBar';
@@ -0,0 +1 @@
1
+ export * from './useCreateProfile';