@amityco/react-native-social-uikit 4.0.2-8e4d4f3a.0 → 4.0.2-a91dab2.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 (277) 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 +26 -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 +10 -3
  10. package/lib/commonjs/core/providers/AmityUIKitProvider.js.map +1 -1
  11. package/lib/commonjs/core/providers/AuthProvider.js +44 -16
  12. package/lib/commonjs/core/providers/AuthProvider.js.map +1 -1
  13. package/lib/commonjs/core/routes/AmityUIKitNavigator.js +23 -1
  14. package/lib/commonjs/core/routes/AmityUIKitNavigator.js.map +1 -1
  15. package/lib/commonjs/social/components/PollContent/PollOption.js +12 -12
  16. package/lib/commonjs/social/components/PollContent/PollOption.js.map +1 -1
  17. package/lib/commonjs/social/components/PostMenu/index.js +9 -2
  18. package/lib/commonjs/social/components/PostMenu/index.js.map +1 -1
  19. package/lib/commonjs/social/components/Social/CommentList/CommentList.js +6 -1
  20. package/lib/commonjs/social/components/Social/CommentList/CommentList.js.map +1 -1
  21. package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js +24 -6
  22. package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
  23. package/lib/commonjs/social/components/Social/CommentListItem/styles.js +3 -2
  24. package/lib/commonjs/social/components/Social/CommentListItem/styles.js.map +1 -1
  25. package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js +14 -2
  26. package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
  27. package/lib/commonjs/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js +3 -1
  28. package/lib/commonjs/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js.map +1 -1
  29. package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +6 -1
  30. package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  31. package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +17 -3
  32. package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
  33. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js +17 -3
  34. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
  35. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/styles.js +8 -0
  36. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/styles.js.map +1 -1
  37. package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js +5 -1
  38. package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
  39. package/lib/commonjs/social/features/livestream/Player/Player.js +9 -6
  40. package/lib/commonjs/social/features/livestream/Player/Player.js.map +1 -1
  41. package/lib/commonjs/social/features/post/Detail/index.js +6 -2
  42. package/lib/commonjs/social/features/post/Detail/index.js.map +1 -1
  43. package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js +16 -10
  44. package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
  45. package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js +17 -9
  46. package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
  47. package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js +19 -21
  48. package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
  49. package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js +28 -19
  50. package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
  51. package/lib/commonjs/social/features/user/Profile/components/Header/styles.js +2 -0
  52. package/lib/commonjs/social/features/user/Profile/components/Header/styles.js.map +1 -1
  53. package/lib/commonjs/social/features/user/Profile/elements/Menu/hooks/useMenu.js +15 -4
  54. package/lib/commonjs/social/features/user/Profile/elements/Menu/hooks/useMenu.js.map +1 -1
  55. package/lib/commonjs/social/features/visitor/UsageLimit/UsageLimit.js +46 -0
  56. package/lib/commonjs/social/features/visitor/UsageLimit/UsageLimit.js.map +1 -0
  57. package/lib/commonjs/social/features/visitor/UsageLimit/hooks/index.js +13 -0
  58. package/lib/commonjs/social/features/visitor/UsageLimit/hooks/index.js.map +1 -0
  59. package/lib/commonjs/social/features/visitor/UsageLimit/hooks/useUsageLimit.js +54 -0
  60. package/lib/commonjs/social/features/visitor/UsageLimit/hooks/useUsageLimit.js.map +1 -0
  61. package/lib/commonjs/social/features/visitor/UsageLimit/index.js +13 -0
  62. package/lib/commonjs/social/features/visitor/UsageLimit/index.js.map +1 -0
  63. package/lib/commonjs/social/features/visitor/UsageLimit/styles.js +52 -0
  64. package/lib/commonjs/social/features/visitor/UsageLimit/styles.js.map +1 -0
  65. package/lib/commonjs/social/hooks/index.js +22 -0
  66. package/lib/commonjs/social/hooks/index.js.map +1 -1
  67. package/lib/commonjs/social/hooks/useGlobalBehavior.js +44 -0
  68. package/lib/commonjs/social/hooks/useGlobalBehavior.js.map +1 -0
  69. package/lib/commonjs/social/hooks/useInteractionBehavior.js +50 -0
  70. package/lib/commonjs/social/hooks/useInteractionBehavior.js.map +1 -0
  71. package/lib/commonjs/social/hooks/usePostPermission.js +4 -2
  72. package/lib/commonjs/social/hooks/usePostPermission.js.map +1 -1
  73. package/lib/commonjs/social/hooks/useStoryPermission.js +3 -2
  74. package/lib/commonjs/social/hooks/useStoryPermission.js.map +1 -1
  75. package/lib/commonjs/social/providers/BehaviourProvider.js +1 -0
  76. package/lib/commonjs/social/providers/BehaviourProvider.js.map +1 -1
  77. package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js +9 -2
  78. package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
  79. package/lib/commonjs/social/screens/SocialHomePage/index.js +23 -6
  80. package/lib/commonjs/social/screens/SocialHomePage/index.js.map +1 -1
  81. package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +11 -0
  82. package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +1 -0
  83. package/lib/commonjs/social/screens/VisitorUsageLimit/index.js +13 -0
  84. package/lib/commonjs/social/screens/VisitorUsageLimit/index.js.map +1 -0
  85. package/lib/module/core/assets/icons/index.js +1 -0
  86. package/lib/module/core/assets/icons/index.js.map +1 -1
  87. package/lib/module/core/assets/icons/visitorLimit.js +19 -0
  88. package/lib/module/core/assets/icons/visitorLimit.js.map +1 -0
  89. package/lib/module/core/constants/index.js +10 -0
  90. package/lib/module/core/constants/index.js.map +1 -1
  91. package/lib/module/core/hooks/useAuth.js +6 -2
  92. package/lib/module/core/hooks/useAuth.js.map +1 -1
  93. package/lib/module/core/providers/AmityUIKitProvider.js +10 -3
  94. package/lib/module/core/providers/AmityUIKitProvider.js.map +1 -1
  95. package/lib/module/core/providers/AuthProvider.js +44 -16
  96. package/lib/module/core/providers/AuthProvider.js.map +1 -1
  97. package/lib/module/core/routes/AmityUIKitNavigator.js +23 -1
  98. package/lib/module/core/routes/AmityUIKitNavigator.js.map +1 -1
  99. package/lib/module/social/components/PollContent/PollOption.js +12 -12
  100. package/lib/module/social/components/PollContent/PollOption.js.map +1 -1
  101. package/lib/module/social/components/PostMenu/index.js +10 -3
  102. package/lib/module/social/components/PostMenu/index.js.map +1 -1
  103. package/lib/module/social/components/Social/CommentList/CommentList.js +6 -1
  104. package/lib/module/social/components/Social/CommentList/CommentList.js.map +1 -1
  105. package/lib/module/social/components/Social/CommentListItem/CommentListItem.js +24 -6
  106. package/lib/module/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
  107. package/lib/module/social/components/Social/CommentListItem/styles.js +3 -2
  108. package/lib/module/social/components/Social/CommentListItem/styles.js.map +1 -1
  109. package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js +14 -2
  110. package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
  111. package/lib/module/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js +3 -1
  112. package/lib/module/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js.map +1 -1
  113. package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +7 -2
  114. package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  115. package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +18 -4
  116. package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
  117. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js +17 -3
  118. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
  119. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/styles.js +8 -0
  120. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/styles.js.map +1 -1
  121. package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js +5 -1
  122. package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
  123. package/lib/module/social/features/livestream/Player/Player.js +9 -6
  124. package/lib/module/social/features/livestream/Player/Player.js.map +1 -1
  125. package/lib/module/social/features/post/Detail/index.js +6 -2
  126. package/lib/module/social/features/post/Detail/index.js.map +1 -1
  127. package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js +17 -11
  128. package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
  129. package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js +18 -10
  130. package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
  131. package/lib/module/social/features/story/View/components/AmityViewStoryItem.js +20 -22
  132. package/lib/module/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
  133. package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js +29 -20
  134. package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
  135. package/lib/module/social/features/user/Profile/components/Header/styles.js +2 -0
  136. package/lib/module/social/features/user/Profile/components/Header/styles.js.map +1 -1
  137. package/lib/module/social/features/user/Profile/elements/Menu/hooks/useMenu.js +16 -4
  138. package/lib/module/social/features/user/Profile/elements/Menu/hooks/useMenu.js.map +1 -1
  139. package/lib/module/social/features/visitor/UsageLimit/UsageLimit.js +40 -0
  140. package/lib/module/social/features/visitor/UsageLimit/UsageLimit.js.map +1 -0
  141. package/lib/module/social/features/visitor/UsageLimit/hooks/index.js +2 -0
  142. package/lib/module/social/features/visitor/UsageLimit/hooks/index.js.map +1 -0
  143. package/lib/module/social/features/visitor/UsageLimit/hooks/useUsageLimit.js +47 -0
  144. package/lib/module/social/features/visitor/UsageLimit/hooks/useUsageLimit.js.map +1 -0
  145. package/lib/module/social/features/visitor/UsageLimit/index.js +2 -0
  146. package/lib/module/social/features/visitor/UsageLimit/index.js.map +1 -0
  147. package/lib/module/social/features/visitor/UsageLimit/styles.js +45 -0
  148. package/lib/module/social/features/visitor/UsageLimit/styles.js.map +1 -0
  149. package/lib/module/social/hooks/index.js +2 -0
  150. package/lib/module/social/hooks/index.js.map +1 -1
  151. package/lib/module/social/hooks/useGlobalBehavior.js +36 -0
  152. package/lib/module/social/hooks/useGlobalBehavior.js.map +1 -0
  153. package/lib/module/social/hooks/useInteractionBehavior.js +43 -0
  154. package/lib/module/social/hooks/useInteractionBehavior.js.map +1 -0
  155. package/lib/module/social/hooks/usePostPermission.js +4 -2
  156. package/lib/module/social/hooks/usePostPermission.js.map +1 -1
  157. package/lib/module/social/hooks/useStoryPermission.js +3 -2
  158. package/lib/module/social/hooks/useStoryPermission.js.map +1 -1
  159. package/lib/module/social/providers/BehaviourProvider.js +1 -0
  160. package/lib/module/social/providers/BehaviourProvider.js.map +1 -1
  161. package/lib/module/social/screens/CommunityProfile/components/Header/Header.js +10 -3
  162. package/lib/module/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
  163. package/lib/module/social/screens/SocialHomePage/index.js +25 -8
  164. package/lib/module/social/screens/SocialHomePage/index.js.map +1 -1
  165. package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +5 -0
  166. package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +1 -0
  167. package/lib/module/social/screens/VisitorUsageLimit/index.js +2 -0
  168. package/lib/module/social/screens/VisitorUsageLimit/index.js.map +1 -0
  169. package/lib/typescript/core/assets/icons/index.d.ts +1 -0
  170. package/lib/typescript/core/assets/icons/index.d.ts.map +1 -1
  171. package/lib/typescript/core/assets/icons/visitorLimit.d.ts +3 -0
  172. package/lib/typescript/core/assets/icons/visitorLimit.d.ts.map +1 -0
  173. package/lib/typescript/core/constants/index.d.ts +10 -0
  174. package/lib/typescript/core/constants/index.d.ts.map +1 -1
  175. package/lib/typescript/core/hooks/useAuth.d.ts.map +1 -1
  176. package/lib/typescript/core/providers/AmityUIKitProvider.d.ts +7 -2
  177. package/lib/typescript/core/providers/AmityUIKitProvider.d.ts.map +1 -1
  178. package/lib/typescript/core/providers/AuthProvider.d.ts.map +1 -1
  179. package/lib/typescript/core/routes/AmityUIKitNavigator.d.ts.map +1 -1
  180. package/lib/typescript/core/types/auth.d.ts +2 -0
  181. package/lib/typescript/core/types/auth.d.ts.map +1 -1
  182. package/lib/typescript/core/types/behaviour.d.ts +6 -0
  183. package/lib/typescript/core/types/behaviour.d.ts.map +1 -1
  184. package/lib/typescript/social/components/PollContent/PollOption.d.ts.map +1 -1
  185. package/lib/typescript/social/components/PostMenu/index.d.ts.map +1 -1
  186. package/lib/typescript/social/components/Social/CommentList/CommentList.d.ts.map +1 -1
  187. package/lib/typescript/social/components/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
  188. package/lib/typescript/social/components/Social/CommentListItem/styles.d.ts +2 -1
  189. package/lib/typescript/social/components/Social/CommentListItem/styles.d.ts.map +1 -1
  190. package/lib/typescript/social/components/legacy/Social/ReplyCommentList/index.d.ts.map +1 -1
  191. package/lib/typescript/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.d.ts.map +1 -1
  192. package/lib/typescript/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.d.ts.map +1 -1
  193. package/lib/typescript/social/features/comment/components/PostComment/CommentListItem/CommentListItem.d.ts.map +1 -1
  194. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/index.d.ts.map +1 -1
  195. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/styles.d.ts +8 -0
  196. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/styles.d.ts.map +1 -1
  197. package/lib/typescript/social/features/feed/components/TopNavigation/TopNavigation.d.ts.map +1 -1
  198. package/lib/typescript/social/features/livestream/Player/Player.d.ts.map +1 -1
  199. package/lib/typescript/social/features/post/Detail/index.d.ts.map +1 -1
  200. package/lib/typescript/social/features/post/components/EngagementActions/Components/DetailStyle.d.ts.map +1 -1
  201. package/lib/typescript/social/features/post/components/EngagementActions/Components/FeedStyle.d.ts.map +1 -1
  202. package/lib/typescript/social/features/story/View/components/AmityViewStoryItem.d.ts.map +1 -1
  203. package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts +2 -0
  204. package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts.map +1 -1
  205. package/lib/typescript/social/features/user/Profile/components/Header/styles.d.ts +2 -0
  206. package/lib/typescript/social/features/user/Profile/components/Header/styles.d.ts.map +1 -1
  207. package/lib/typescript/social/features/user/Profile/elements/Menu/hooks/useMenu.d.ts.map +1 -1
  208. package/lib/typescript/social/features/visitor/UsageLimit/UsageLimit.d.ts +2 -0
  209. package/lib/typescript/social/features/visitor/UsageLimit/UsageLimit.d.ts.map +1 -0
  210. package/lib/typescript/social/features/visitor/UsageLimit/hooks/index.d.ts +2 -0
  211. package/lib/typescript/social/features/visitor/UsageLimit/hooks/index.d.ts.map +1 -0
  212. package/lib/typescript/social/features/visitor/UsageLimit/hooks/useUsageLimit.d.ts +40 -0
  213. package/lib/typescript/social/features/visitor/UsageLimit/hooks/useUsageLimit.d.ts.map +1 -0
  214. package/lib/typescript/social/features/visitor/UsageLimit/index.d.ts +2 -0
  215. package/lib/typescript/social/features/visitor/UsageLimit/index.d.ts.map +1 -0
  216. package/lib/typescript/social/features/visitor/UsageLimit/styles.d.ts +40 -0
  217. package/lib/typescript/social/features/visitor/UsageLimit/styles.d.ts.map +1 -0
  218. package/lib/typescript/social/hooks/index.d.ts +2 -0
  219. package/lib/typescript/social/hooks/index.d.ts.map +1 -1
  220. package/lib/typescript/social/hooks/useGlobalBehavior.d.ts +16 -0
  221. package/lib/typescript/social/hooks/useGlobalBehavior.d.ts.map +1 -0
  222. package/lib/typescript/social/hooks/useInteractionBehavior.d.ts +11 -0
  223. package/lib/typescript/social/hooks/useInteractionBehavior.d.ts.map +1 -0
  224. package/lib/typescript/social/hooks/usePostPermission.d.ts.map +1 -1
  225. package/lib/typescript/social/hooks/useStoryPermission.d.ts.map +1 -1
  226. package/lib/typescript/social/providers/BehaviourProvider.d.ts.map +1 -1
  227. package/lib/typescript/social/screens/CommunityProfile/components/Header/Header.d.ts.map +1 -1
  228. package/lib/typescript/social/screens/SocialHomePage/index.d.ts.map +1 -1
  229. package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts +2 -0
  230. package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts.map +1 -0
  231. package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts +2 -0
  232. package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts.map +1 -0
  233. package/package.json +3 -3
  234. package/src/core/assets/icons/index.ts +1 -0
  235. package/src/core/assets/icons/visitorLimit.tsx +19 -0
  236. package/src/core/constants/index.ts +15 -0
  237. package/src/core/hooks/useAuth.ts +4 -0
  238. package/src/core/providers/AmityUIKitProvider.tsx +28 -3
  239. package/src/core/providers/AuthProvider.tsx +34 -11
  240. package/src/core/routes/AmityUIKitNavigator.tsx +26 -1
  241. package/src/core/types/auth.ts +2 -0
  242. package/src/core/types/behaviour.ts +6 -0
  243. package/src/social/components/PollContent/PollOption.tsx +13 -19
  244. package/src/social/components/PostMenu/index.tsx +6 -3
  245. package/src/social/components/Social/CommentList/CommentList.tsx +4 -1
  246. package/src/social/components/Social/CommentListItem/CommentListItem.tsx +69 -55
  247. package/src/social/components/Social/CommentListItem/styles.ts +2 -1
  248. package/src/social/components/legacy/Social/ReplyCommentList/index.tsx +15 -5
  249. package/src/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.tsx +7 -1
  250. package/src/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +10 -2
  251. package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx +17 -10
  252. package/src/social/features/comment/components/PostComment/ReplyCommentList/index.tsx +15 -5
  253. package/src/social/features/comment/components/PostComment/ReplyCommentList/styles.ts +8 -0
  254. package/src/social/features/feed/components/TopNavigation/TopNavigation.tsx +3 -1
  255. package/src/social/features/livestream/Player/Player.tsx +10 -7
  256. package/src/social/features/post/Detail/index.tsx +5 -2
  257. package/src/social/features/post/components/EngagementActions/Components/DetailStyle.tsx +19 -14
  258. package/src/social/features/post/components/EngagementActions/Components/FeedStyle.tsx +20 -12
  259. package/src/social/features/story/View/components/AmityViewStoryItem.tsx +21 -22
  260. package/src/social/features/user/Profile/components/Header/hooks/useHeader.ts +27 -20
  261. package/src/social/features/user/Profile/components/Header/styles.ts +2 -0
  262. package/src/social/features/user/Profile/elements/Menu/hooks/useMenu.ts +16 -4
  263. package/src/social/features/visitor/UsageLimit/UsageLimit.tsx +43 -0
  264. package/src/social/features/visitor/UsageLimit/hooks/index.ts +1 -0
  265. package/src/social/features/visitor/UsageLimit/hooks/useUsageLimit.ts +46 -0
  266. package/src/social/features/visitor/UsageLimit/index.ts +1 -0
  267. package/src/social/features/visitor/UsageLimit/styles.ts +45 -0
  268. package/src/social/hooks/index.ts +2 -0
  269. package/src/social/hooks/useGlobalBehavior.ts +33 -0
  270. package/src/social/hooks/useInteractionBehavior.ts +47 -0
  271. package/src/social/hooks/usePostPermission.ts +3 -1
  272. package/src/social/hooks/useStoryPermission.ts +8 -6
  273. package/src/social/providers/BehaviourProvider.tsx +1 -0
  274. package/src/social/screens/CommunityProfile/components/Header/Header.tsx +8 -2
  275. package/src/social/screens/SocialHomePage/index.tsx +45 -17
  276. package/src/social/screens/VisitorUsageLimit/VisitorUsageLimit.tsx +5 -0
  277. package/src/social/screens/VisitorUsageLimit/index.ts +1 -0
@@ -24,6 +24,8 @@ export const AuthContext = createContext<AuthContextInterface>({
24
24
  authToken: '',
25
25
  fcmToken: undefined,
26
26
  isGlobalBan: false,
27
+ isVisitorUsageLimitReached: false,
28
+ isVisitorOrBot: false,
27
29
  });
28
30
 
29
31
  export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
@@ -44,6 +46,9 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
44
46
  apiEndpoint: { http: apiEndpoint },
45
47
  });
46
48
  const [isGlobalBan, setIsGlobalBan] = useState(false);
49
+ const [isVisitorUsageLimitReached, setIsVisitorUsageLimitReached] =
50
+ useState(false);
51
+ const [isVisitorOrBot, setIsVisitorOrBot] = useState(false);
47
52
 
48
53
  const sessionHandler: Amity.SessionHandler = {
49
54
  sessionWillRenewAccessToken(renewal) {
@@ -64,29 +69,43 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
64
69
  if (sessionState === 'established') {
65
70
  setIsConnected(true);
66
71
  onSdkReady();
72
+ setIsVisitorOrBot(Client.getCurrentUserType() !== 'signed-in');
67
73
  }
68
74
  }, [sessionState]);
69
75
 
70
- const handleConnect = useCallback(async () => {
71
- let loginParam;
76
+ useEffect(() => {
77
+ const unsubscribe = Client.onVisitorUsageLimitReached(() => {
78
+ setIsVisitorUsageLimitReached(true);
79
+ });
72
80
 
73
- loginParam = {
74
- userId: userId,
75
- displayName: displayName,
81
+ return () => {
82
+ unsubscribe();
76
83
  };
77
- if (authToken?.length > 0) {
78
- loginParam = { ...loginParam, authToken: authToken };
79
- }
84
+ }, []);
85
+
86
+ const handleConnect = useCallback(async () => {
80
87
  try {
81
- const response = await Client.login(loginParam, sessionHandler);
82
- if (!response) return;
88
+ if (userId) {
89
+ // Spec: omit displayName entirely when blank — do not substitute userId
90
+ let loginParam: Amity.ConnectClientParams = { userId: userId };
91
+ if (displayName) loginParam = { ...loginParam, displayName };
92
+ if (authToken?.length > 0) {
93
+ loginParam = { ...loginParam, authToken: authToken };
94
+ }
95
+ const response = await Client.login(loginParam, sessionHandler);
96
+ if (!response) return;
97
+ } else {
98
+ const response = await Client.loginAsVisitor({ sessionHandler });
99
+ if (!response) return;
100
+ }
83
101
  } catch (err) {
84
102
  if (err?.message?.includes(ERROR_CODE.GLOBAL_BAN)) {
85
103
  setIsGlobalBan(true);
86
104
  }
87
105
  }
88
106
 
89
- if (fcmToken) {
107
+ // Visitors/bots are GET-only with no MQTT — skip push registration for them.
108
+ if (fcmToken && userId) {
90
109
  try {
91
110
  await Client.registerPushNotification(fcmToken);
92
111
  } catch (err) {
@@ -110,7 +129,9 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
110
129
  setLoading(false);
111
130
  }
112
131
  };
132
+
113
133
  useEffect(() => {
134
+ setIsVisitorUsageLimitReached(false);
114
135
  login();
115
136
  }, [userId]);
116
137
 
@@ -138,6 +159,8 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
138
159
  sessionState,
139
160
  apiRegion: apiRegion.toLowerCase(),
140
161
  isGlobalBan,
162
+ isVisitorUsageLimitReached,
163
+ isVisitorOrBot,
141
164
  }}
142
165
  >
143
166
  {children}
@@ -1,3 +1,4 @@
1
+ import { useEffect, useRef } from 'react';
1
2
  import {
2
3
  NavigationContainer,
3
4
  NavigationIndependentTree,
@@ -43,6 +44,8 @@ import { CommunityStoriesNotificationSettingScreen } from '../../social/screens/
43
44
  import { CommunityLivestreamsNotificationSettingScreen } from '../../social/screens/CommunityLivestreamsNotificationSetting';
44
45
  import CommunityPendingRequest from '../../social/screens/CommunityPendingRequest';
45
46
  import { GlobalBan } from '../../social/screens/GlobalBan';
47
+ import { VisitorUsageLimit } from '../../social/screens/VisitorUsageLimit';
48
+ import { useBehaviour } from '../../social/providers/BehaviourProvider';
46
49
  import {
47
50
  ImageViewerScreen,
48
51
  VideoPlayerScreen,
@@ -60,10 +63,32 @@ const Stack = createNativeStackNavigator<
60
63
 
61
64
  export default function AmitySocialUIKitV4Navigator() {
62
65
  const theme = useTheme<MyMD3Theme>();
63
- const { isGlobalBan } = useAuth();
66
+ const { isGlobalBan, isVisitorUsageLimitReached } = useAuth();
67
+ const { AmityGlobalBehaviour } = useBehaviour();
68
+
69
+ const handleVisitorUsageLimitReached =
70
+ AmityGlobalBehaviour?.handleVisitorUsageLimitReached;
71
+
72
+ const hasHandledUsageLimit = useRef(false);
73
+
74
+ useEffect(() => {
75
+ if (!isVisitorUsageLimitReached) {
76
+ hasHandledUsageLimit.current = false;
77
+ return;
78
+ }
79
+
80
+ if (handleVisitorUsageLimitReached && !hasHandledUsageLimit.current) {
81
+ hasHandledUsageLimit.current = true;
82
+ handleVisitorUsageLimitReached();
83
+ }
84
+ }, [isVisitorUsageLimitReached, handleVisitorUsageLimitReached]);
64
85
 
65
86
  if (isGlobalBan) return <GlobalBan />;
66
87
 
88
+ if (isVisitorUsageLimitReached && !handleVisitorUsageLimitReached) {
89
+ return <VisitorUsageLimit />;
90
+ }
91
+
67
92
  return (
68
93
  <NavigationIndependentTree>
69
94
  <NavigationContainer ref={navigationRef} onReady={onNavigationReady}>
@@ -10,4 +10,6 @@ export type AuthContextInterface = {
10
10
  authToken?: string;
11
11
  fcmToken?: string;
12
12
  isGlobalBan: boolean;
13
+ isVisitorUsageLimitReached: boolean;
14
+ isVisitorOrBot: boolean;
13
15
  };
@@ -17,6 +17,12 @@ export type CommunitySettingPageContext = {
17
17
  };
18
18
 
19
19
  export interface IBehaviour {
20
+ AmityGlobalBehaviour?: {
21
+ handleVisitorUserAction?: () => void;
22
+ handleNonMemberAction?: () => void;
23
+ handleVisitorUsageLimitReached?: () => void;
24
+ handleVisitorUsageLimitSignIn?: () => void;
25
+ };
20
26
  AmitySocialHomePageBehaviour?: {
21
27
  onChooseTab?: (arg?: string) => void;
22
28
  };
@@ -9,6 +9,7 @@ import Button, { BUTTON_SIZE } from '../Button/Button';
9
9
  import { useNavigation } from '@react-navigation/native';
10
10
  import { NativeStackNavigationProp } from '@react-navigation/native-stack';
11
11
  import { RootStackParamList } from '../../../core/routes/RouteParamList';
12
+ import { useInteractionBehavior } from '../../hooks/useInteractionBehavior';
12
13
 
13
14
  type PollOptionsProps = {
14
15
  post?: Amity.Post<any>;
@@ -42,10 +43,10 @@ export function PollOptions({
42
43
  useNavigation<NativeStackNavigationProp<RootStackParamList>>();
43
44
 
44
45
  const { styles } = useStyles();
46
+ const { handleInteraction } = useInteractionBehavior();
45
47
  const [selectedOption, setSelectedOption] = useState<Amity.PollAnswer[]>([]);
46
48
 
47
49
  const btnDisabled = selectedOption.length === 0;
48
- const optionDisabled = !!disabledPoll;
49
50
 
50
51
  return (
51
52
  <View>
@@ -60,7 +61,6 @@ export function PollOptions({
60
61
  <Radio.Group<Amity.PollAnswer>
61
62
  value={selectedOption[0]}
62
63
  style={styles.optionGroup}
63
- disabled={optionDisabled}
64
64
  onChange={(value) => setSelectedOption([value])}
65
65
  select={(value, option) => value.id === option.id}
66
66
  >
@@ -79,11 +79,7 @@ export function PollOptions({
79
79
  ]}
80
80
  >
81
81
  <Radio.Label style={styles.optionLabel}>
82
- <Typography.BodyBold
83
- style={[optionDisabled && styles.optionLabelDisabled]}
84
- >
85
- {option.data}
86
- </Typography.BodyBold>
82
+ <Typography.BodyBold>{option.data}</Typography.BodyBold>
87
83
  </Radio.Label>
88
84
  <Radio.Icon />
89
85
  </Radio.Option>
@@ -93,7 +89,6 @@ export function PollOptions({
93
89
  <CheckBox.Group<Amity.PollAnswer>
94
90
  value={selectedOption}
95
91
  style={styles.optionGroup}
96
- disabled={optionDisabled}
97
92
  onChange={(value) => setSelectedOption(value)}
98
93
  select={(value, option) =>
99
94
  !!value.find((item) => item.id === option.id)
@@ -115,11 +110,7 @@ export function PollOptions({
115
110
  ]}
116
111
  >
117
112
  <CheckBox.Label style={styles.optionLabel}>
118
- <Typography.BodyBold
119
- style={[optionDisabled && styles.optionLabelDisabled]}
120
- >
121
- {option.data}
122
- </Typography.BodyBold>
113
+ <Typography.BodyBold>{option.data}</Typography.BodyBold>
123
114
  </CheckBox.Label>
124
115
  <CheckBox.Icon />
125
116
  </CheckBox.Option>
@@ -144,12 +135,15 @@ export function PollOptions({
144
135
  )}
145
136
  {!isPollClosed && !isAlreadyVoted && (
146
137
  <TouchableOpacity
147
- disabled={btnDisabled || optionDisabled}
148
- style={[
149
- styles.voteBtn,
150
- (btnDisabled || optionDisabled) && styles.voteBtnDisabled,
151
- ]}
152
- onPress={() => votePoll(selectedOption.map((option) => option.id))}
138
+ disabled={btnDisabled}
139
+ style={[styles.voteBtn, btnDisabled && styles.voteBtnDisabled]}
140
+ onPress={() =>
141
+ handleInteraction({
142
+ defaultBehavior: () =>
143
+ votePoll(selectedOption.map((option) => option.id)),
144
+ isJoined: !disabledPoll,
145
+ })
146
+ }
153
147
  >
154
148
  <Typography.BodyBold style={styles.voteBtnLabel}>
155
149
  Vote
@@ -3,7 +3,7 @@ import { Alert, View } from 'react-native';
3
3
  import { getCommunityById } from '../../../core/legacy/community';
4
4
  import { useNavigation } from '@react-navigation/native';
5
5
  import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
6
- import { useFlagPost, isModerator } from '../../hooks';
6
+ import { useFlagPost, isModerator, useGlobalBehavior } from '../../hooks';
7
7
  import { deletePostById } from '../../../core/legacy/feed';
8
8
  import useAuth from '../../../core/hooks/useAuth';
9
9
  import globalFeedSlice from '../../../core/stores/slices/globalfeedSlice';
@@ -30,6 +30,7 @@ type PostMenuProps = {
30
30
 
31
31
  export function PostMenu({ pageId, componentId, post }: PostMenuProps) {
32
32
  const { showToast } = useToast();
33
+ const { handleGlobalBehavior } = useGlobalBehavior();
33
34
  const { closePoll } = useClosePoll();
34
35
  const { client } = useAuth();
35
36
  const [communityData, setCommunityData] = useState<Amity.Community>(null);
@@ -121,7 +122,7 @@ export function PostMenu({ pageId, componentId, post }: PostMenuProps) {
121
122
  iconProps={{ xml: report() }}
122
123
  onPress={() => {
123
124
  closeBottomSheet();
124
- reportPost(postId);
125
+ handleGlobalBehavior({ defaultBehavior: () => reportPost(postId) });
125
126
  }}
126
127
  />
127
128
  ),
@@ -136,7 +137,9 @@ export function PostMenu({ pageId, componentId, post }: PostMenuProps) {
136
137
  label={'Unreport post'}
137
138
  onPress={() => {
138
139
  closeBottomSheet();
139
- unreportPost(postId);
140
+ handleGlobalBehavior({
141
+ defaultBehavior: () => unreportPost(postId),
142
+ });
140
143
  }}
141
144
  />
142
145
  ),
@@ -31,6 +31,7 @@ import { useToast } from '../../../../core/stores/slices/toastSlice';
31
31
  import { lock } from '../../../../core/assets/icons';
32
32
  import { Typography } from '../../../../core/components/Typography/Typography';
33
33
  import { MAX_MENTION_USERS } from '../../../../core/constants';
34
+ import useAuth from '../../../../core/hooks/useAuth';
34
35
 
35
36
  interface ICommentListProp {
36
37
  postId: string;
@@ -68,6 +69,8 @@ const CommentList: FC<ICommentListProp> = ({
68
69
  withAvatar,
69
70
  disabledComment,
70
71
  }) => {
72
+ const { isVisitorOrBot } = useAuth();
73
+ const hideComposer = disabledInteraction || isVisitorOrBot;
71
74
  const styles = useStyles();
72
75
  const theme = useTheme() as MyMD3Theme;
73
76
  const onNextPageRef = useRef<() => void | null>(null);
@@ -284,7 +287,7 @@ const CommentList: FC<ICommentListProp> = ({
284
287
  </TouchableOpacity>
285
288
  </View>
286
289
  )}
287
- {!disabledInteraction &&
290
+ {!hideComposer &&
288
291
  (disabledComment ? (
289
292
  <View style={styles.disabledCommentWrap}>
290
293
  <SvgXml
@@ -44,6 +44,7 @@ import ReplyCommentList from '../../legacy/Social/ReplyCommentList';
44
44
  import AmityReactionListComponent from '../../../features/reaction/components/List';
45
45
  import { CommentRepository } from '@amityco/ts-sdk-react-native';
46
46
  import { useTimeDifference } from '../../../hooks/useTimeDifference';
47
+ import { useInteractionBehavior } from '../../../hooks/useInteractionBehavior';
47
48
  import { LinkPreview } from '../../PreviewLink';
48
49
  import { Typography } from '../../../../core/components/Typography/Typography';
49
50
  import { pen, report, trash, unreport } from '../../../../core/assets/icons';
@@ -290,6 +291,20 @@ const CommentListItem = ({
290
291
  onClickReply && onClickReply(user, commentId);
291
292
  };
292
293
 
294
+ const { handleInteraction } = useInteractionBehavior();
295
+
296
+ const onPressLike = () =>
297
+ handleInteraction({
298
+ defaultBehavior: addReactionToComment,
299
+ isJoined: !disabledInteraction,
300
+ });
301
+
302
+ const onPressReply = () =>
303
+ handleInteraction({
304
+ defaultBehavior: onHandleReply,
305
+ isJoined: !disabledInteraction,
306
+ });
307
+
293
308
  const onPressCommentReaction = () => {
294
309
  setIsReactionListVisible(true);
295
310
  };
@@ -334,60 +349,55 @@ const CommentListItem = ({
334
349
  />
335
350
  )}
336
351
  </View>
337
- {!disabledInteraction && (
338
- <View style={styles.actionSection}>
339
- <View style={styles.rowContainer}>
340
- <View style={styles.timeRow}>
352
+ <View style={styles.actionSection}>
353
+ <View style={styles.rowContainer}>
354
+ <View style={styles.timeRow}>
355
+ <Typography.Caption style={styles.headerTextTime}>
356
+ {timeDifference}
357
+ </Typography.Caption>
358
+ {(editedAt !== createdAt || isEditComment) && (
341
359
  <Typography.Caption style={styles.headerTextTime}>
342
- {timeDifference}
360
+ {' '}
361
+ (edited)
343
362
  </Typography.Caption>
344
- {(editedAt !== createdAt || isEditComment) && (
345
- <Typography.Caption style={styles.headerTextTime}>
346
- {' '}
347
- (edited)
348
- </Typography.Caption>
349
- )}
350
- </View>
351
- <TouchableOpacity
352
- onPress={() => addReactionToComment()}
353
- style={styles.likeBtn}
354
- >
355
- <Typography.CaptionBold
356
- style={isLike ? styles.likedText : styles.btnText}
357
- >
358
- Like
359
- </Typography.CaptionBold>
360
- </TouchableOpacity>
361
- <TouchableOpacity
362
- onPress={disabledComment ? undefined : onHandleReply}
363
- style={styles.likeBtn}
364
- >
365
- <Typography.CaptionBold style={styles.btnText}>
366
- Reply
367
- </Typography.CaptionBold>
368
- </TouchableOpacity>
369
- <TouchableOpacity onPress={openModal}>
370
- <SvgXml
371
- xml={threeDots(theme.colors.baseShade2)}
372
- width="20"
373
- height="20"
374
- />
375
- </TouchableOpacity>
363
+ )}
376
364
  </View>
377
-
378
- {likeReaction > 0 && (
379
- <TouchableOpacity
380
- onPress={onPressCommentReaction}
381
- style={styles.likeBtn}
365
+ <TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
366
+ <Typography.CaptionBold
367
+ style={isLike ? styles.likedText : styles.btnText}
382
368
  >
383
- <Typography.Caption style={styles.btnText}>
384
- {likeReaction}
385
- </Typography.Caption>
386
- <SvgXml xml={likeCircle} width="20" height="20" />
387
- </TouchableOpacity>
388
- )}
369
+ Like
370
+ </Typography.CaptionBold>
371
+ </TouchableOpacity>
372
+ <TouchableOpacity
373
+ onPress={disabledComment ? undefined : onPressReply}
374
+ style={styles.likeBtn}
375
+ >
376
+ <Typography.CaptionBold style={styles.btnText}>
377
+ Reply
378
+ </Typography.CaptionBold>
379
+ </TouchableOpacity>
380
+ <TouchableOpacity onPress={openModal}>
381
+ <SvgXml
382
+ xml={threeDots(theme.colors.baseShade2)}
383
+ width="20"
384
+ height="20"
385
+ />
386
+ </TouchableOpacity>
389
387
  </View>
390
- )}
388
+
389
+ {likeReaction > 0 && (
390
+ <TouchableOpacity
391
+ onPress={onPressCommentReaction}
392
+ style={styles.likeBtn}
393
+ >
394
+ <Typography.Caption style={styles.btnText}>
395
+ {likeReaction}
396
+ </Typography.Caption>
397
+ <SvgXml xml={likeCircle} width="20" height="20" />
398
+ </TouchableOpacity>
399
+ )}
400
+ </View>
391
401
 
392
402
  {previewReplyCommentList.length > 0 && !isOpenReply && (
393
403
  <ReplyCommentList
@@ -423,10 +433,10 @@ const CommentListItem = ({
423
433
  style={styles.viewMoreReplyBtn}
424
434
  >
425
435
  <SvgXml xml={expandIcon} />
426
- <Typography.CaptionBold style={styles.viewMoreText}>
436
+ <Text style={styles.viewMoreText}>
427
437
  View {childrenNumber}{' '}
428
438
  {childrenNumber === 1 ? 'reply' : 'replies'}
429
- </Typography.CaptionBold>
439
+ </Text>
430
440
  </TouchableOpacity>
431
441
  )}
432
442
 
@@ -436,9 +446,7 @@ const CommentListItem = ({
436
446
  style={styles.viewMoreReplyBtn}
437
447
  >
438
448
  <SvgXml xml={expandIcon} />
439
- <Typography.CaptionBold style={styles.viewMoreText}>
440
- View more replies
441
- </Typography.CaptionBold>
449
+ <Text style={styles.viewMoreText}>View more replies</Text>
442
450
  </TouchableOpacity>
443
451
  )}
444
452
  </View>
@@ -492,7 +500,13 @@ const CommentListItem = ({
492
500
  </View>
493
501
  ) : (
494
502
  <TouchableOpacity
495
- onPress={reportCommentObject}
503
+ onPress={() => {
504
+ closeModal();
505
+ handleInteraction({
506
+ defaultBehavior: reportCommentObject,
507
+ allowNonMember: true,
508
+ });
509
+ }}
496
510
  style={styles.modalRow}
497
511
  >
498
512
  <SvgXml
@@ -71,12 +71,13 @@ export const useStyles = () => {
71
71
  paddingHorizontal: 8,
72
72
  marginTop: 12,
73
73
  flexDirection: 'row',
74
- justifyContent: 'center',
75
74
  alignItems: 'center',
76
75
  alignSelf: 'flex-start',
77
76
  },
78
77
  viewMoreText: {
78
+ fontWeight: '600',
79
79
  color: theme.colors.secondaryShade1,
80
+ paddingHorizontal: 4,
80
81
  },
81
82
  commentText: {
82
83
  fontSize: 15,
@@ -44,6 +44,7 @@ import { useNavigation } from '@react-navigation/native';
44
44
  import { NativeStackNavigationProp } from '@react-navigation/native-stack';
45
45
  import { RootStackParamList } from '../../../../../core/routes/RouteParamList';
46
46
  import { useTimeDifference } from '../../../../hooks';
47
+ import { useGlobalBehavior } from '../../../../hooks/useGlobalBehavior';
47
48
  import { useToast } from '../../../../../core/stores/slices/toastSlice';
48
49
  import AmityReactionListComponent from '../../../../features/reaction/components/List';
49
50
 
@@ -155,6 +156,12 @@ export default function ReplyCommentList({
155
156
  await addCommentReaction(commentId, 'like');
156
157
  }
157
158
  };
159
+
160
+ const { handleGlobalBehavior } = useGlobalBehavior();
161
+
162
+ const onPressLike = () =>
163
+ handleGlobalBehavior({ defaultBehavior: addReactionToComment });
164
+
158
165
  const deletePostObject = () => {
159
166
  Alert.alert('Delete reply', `This reply will be permanently deleted.`, [
160
167
  {
@@ -169,6 +176,7 @@ export default function ReplyCommentList({
169
176
  ]);
170
177
  setIsVisible(false);
171
178
  };
179
+
172
180
  const reportCommentObject = async () => {
173
181
  if (isReportByMe) {
174
182
  const unReportPost = await unReportTargetById('comment', commentId);
@@ -267,10 +275,7 @@ export default function ReplyCommentList({
267
275
  </Typography.Caption>
268
276
  )}
269
277
  </View>
270
- <TouchableOpacity
271
- onPress={() => addReactionToComment()}
272
- style={styles.likeBtn}
273
- >
278
+ <TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
274
279
  <Typography.CaptionBold
275
280
  style={isLike ? styles.likedText : styles.btnText}
276
281
  >
@@ -359,7 +364,12 @@ export default function ReplyCommentList({
359
364
  </View>
360
365
  ) : (
361
366
  <TouchableOpacity
362
- onPress={reportCommentObject}
367
+ onPress={() => {
368
+ closeModal();
369
+ handleGlobalBehavior({
370
+ defaultBehavior: reportCommentObject,
371
+ });
372
+ }}
363
373
  style={styles.modalRow}
364
374
  >
365
375
  <SvgXml
@@ -16,9 +16,15 @@ function CommunityCreatePostButton({
16
16
  ...props
17
17
  }: CommunityCreatePostButtonProps) {
18
18
  const elementId = ElementID.community_create_post_button;
19
- const { themeStyles } = useAmityElement({ pageId, componentId, elementId });
19
+ const { themeStyles, isExcluded } = useAmityElement({
20
+ pageId,
21
+ componentId,
22
+ elementId,
23
+ });
20
24
  const styles = useStyles(themeStyles);
21
25
 
26
+ if (isExcluded) return null;
27
+
22
28
  return (
23
29
  <TouchableOpacity
24
30
  hitSlop={0.8}
@@ -1,7 +1,11 @@
1
1
  import { FC, memo } from 'react';
2
2
  import { TouchableOpacityProps } from 'react-native';
3
3
  import { ComponentID, ElementID, PageID } from '../../enums/enumUIKitID';
4
- import { useAmityElement, useJoinCommunity } from '../../hooks';
4
+ import {
5
+ useAmityElement,
6
+ useGlobalBehavior,
7
+ useJoinCommunity,
8
+ } from '../../hooks';
5
9
  import { Button, BUTTON_SIZE } from '../../components/Button/Button';
6
10
  import { plus } from '../../../core/assets/icons';
7
11
  import { useCustomRankingGlobalFeed } from '../../hooks/useCustomRankingGlobalFeed';
@@ -36,9 +40,13 @@ const CommunityJoinButton: FC<CommunityJoinButtonType> = ({
36
40
  },
37
41
  });
38
42
 
43
+ const { handleGlobalBehavior } = useGlobalBehavior();
44
+
39
45
  const handleJoinCommunity = () => {
40
46
  if (!communityId) return;
41
- joinCommunity(communityId);
47
+ handleGlobalBehavior({
48
+ defaultBehavior: () => joinCommunity(communityId),
49
+ });
42
50
  };
43
51
 
44
52
  if (isExcluded) return null;
@@ -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,14 @@ const CommentListItem = ({
315
315
  onClickReply && onClickReply(user, commentId);
316
316
  };
317
317
 
318
+ const { handleGlobalBehavior } = useGlobalBehavior();
319
+
320
+ const onPressLike = () =>
321
+ handleGlobalBehavior({ defaultBehavior: addReactionToComment });
322
+
323
+ const onPressReply = () =>
324
+ handleGlobalBehavior({ defaultBehavior: onHandleReply });
325
+
318
326
  const onPressCommentReaction = () => {
319
327
  onNavigate && onNavigate();
320
328
  setIsReactionListVisible(true);
@@ -399,18 +407,12 @@ const CommentListItem = ({
399
407
  )}
400
408
  </View>
401
409
 
402
- <TouchableOpacity
403
- onPress={() => addReactionToComment()}
404
- style={styles.likeBtn}
405
- >
410
+ <TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
406
411
  <Text style={isLike ? styles.likedText : styles.btnText}>
407
412
  {!isLike ? 'Like' : 'Liked'}
408
413
  </Text>
409
414
  </TouchableOpacity>
410
- <TouchableOpacity
411
- onPress={onHandleReply}
412
- style={styles.likeBtn}
413
- >
415
+ <TouchableOpacity onPress={onPressReply} style={styles.likeBtn}>
414
416
  <Text style={styles.btnText}>Reply</Text>
415
417
  </TouchableOpacity>
416
418
  <TouchableOpacity onPress={openModal} style={styles.threeDots}>
@@ -532,7 +534,12 @@ const CommentListItem = ({
532
534
  </View>
533
535
  ) : (
534
536
  <TouchableOpacity
535
- onPress={reportCommentObject}
537
+ onPress={() => {
538
+ closeModal();
539
+ handleGlobalBehavior({
540
+ defaultBehavior: reportCommentObject,
541
+ });
542
+ }}
536
543
  style={styles.modalRow}
537
544
  >
538
545
  <SvgXml