@amityco/react-native-social-uikit 4.0.2-f1fd1fbd.0 → 4.1.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 (269) 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.map +1 -1
  10. package/lib/commonjs/core/providers/AuthProvider.js +44 -21
  11. package/lib/commonjs/core/providers/AuthProvider.js.map +1 -1
  12. package/lib/commonjs/core/routes/AmityUIKitNavigator.js +23 -1
  13. package/lib/commonjs/core/routes/AmityUIKitNavigator.js.map +1 -1
  14. package/lib/commonjs/social/components/PollContent/PollOption.js +12 -12
  15. package/lib/commonjs/social/components/PollContent/PollOption.js.map +1 -1
  16. package/lib/commonjs/social/components/PostMenu/index.js +9 -2
  17. package/lib/commonjs/social/components/PostMenu/index.js.map +1 -1
  18. package/lib/commonjs/social/components/Social/CommentList/CommentList.js +6 -1
  19. package/lib/commonjs/social/components/Social/CommentList/CommentList.js.map +1 -1
  20. package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js +24 -6
  21. package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
  22. package/lib/commonjs/social/components/Social/CommentListItem/styles.js +3 -2
  23. package/lib/commonjs/social/components/Social/CommentListItem/styles.js.map +1 -1
  24. package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js +14 -2
  25. package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
  26. package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +6 -1
  27. package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  28. package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +17 -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 +17 -3
  31. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
  32. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/styles.js +8 -0
  33. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/styles.js.map +1 -1
  34. package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js +5 -1
  35. package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
  36. package/lib/commonjs/social/features/livestream/Player/Player.js +9 -6
  37. package/lib/commonjs/social/features/livestream/Player/Player.js.map +1 -1
  38. package/lib/commonjs/social/features/post/Detail/index.js +6 -2
  39. package/lib/commonjs/social/features/post/Detail/index.js.map +1 -1
  40. package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js +16 -10
  41. package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
  42. package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js +17 -9
  43. package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
  44. package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js +19 -21
  45. package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
  46. package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js +28 -19
  47. package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
  48. package/lib/commonjs/social/features/user/Profile/components/Header/styles.js +2 -0
  49. package/lib/commonjs/social/features/user/Profile/components/Header/styles.js.map +1 -1
  50. package/lib/commonjs/social/features/user/Profile/elements/Menu/hooks/useMenu.js +15 -4
  51. package/lib/commonjs/social/features/user/Profile/elements/Menu/hooks/useMenu.js.map +1 -1
  52. package/lib/commonjs/social/features/visitor/UsageLimit/UsageLimit.js +46 -0
  53. package/lib/commonjs/social/features/visitor/UsageLimit/UsageLimit.js.map +1 -0
  54. package/lib/commonjs/social/features/visitor/UsageLimit/hooks/index.js +13 -0
  55. package/lib/commonjs/social/features/visitor/UsageLimit/hooks/index.js.map +1 -0
  56. package/lib/commonjs/social/features/visitor/UsageLimit/hooks/useUsageLimit.js +54 -0
  57. package/lib/commonjs/social/features/visitor/UsageLimit/hooks/useUsageLimit.js.map +1 -0
  58. package/lib/commonjs/social/features/visitor/UsageLimit/index.js +13 -0
  59. package/lib/commonjs/social/features/visitor/UsageLimit/index.js.map +1 -0
  60. package/lib/commonjs/social/features/visitor/UsageLimit/styles.js +52 -0
  61. package/lib/commonjs/social/features/visitor/UsageLimit/styles.js.map +1 -0
  62. package/lib/commonjs/social/hooks/index.js +22 -0
  63. package/lib/commonjs/social/hooks/index.js.map +1 -1
  64. package/lib/commonjs/social/hooks/useGlobalBehavior.js +44 -0
  65. package/lib/commonjs/social/hooks/useGlobalBehavior.js.map +1 -0
  66. package/lib/commonjs/social/hooks/useInteractionBehavior.js +50 -0
  67. package/lib/commonjs/social/hooks/useInteractionBehavior.js.map +1 -0
  68. package/lib/commonjs/social/hooks/usePostPermission.js +4 -2
  69. package/lib/commonjs/social/hooks/usePostPermission.js.map +1 -1
  70. package/lib/commonjs/social/hooks/useStoryPermission.js +3 -2
  71. package/lib/commonjs/social/hooks/useStoryPermission.js.map +1 -1
  72. package/lib/commonjs/social/providers/BehaviourProvider.js +1 -0
  73. package/lib/commonjs/social/providers/BehaviourProvider.js.map +1 -1
  74. package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js +9 -2
  75. package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
  76. package/lib/commonjs/social/screens/SocialHomePage/index.js +14 -6
  77. package/lib/commonjs/social/screens/SocialHomePage/index.js.map +1 -1
  78. package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +11 -0
  79. package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +1 -0
  80. package/lib/commonjs/social/screens/VisitorUsageLimit/index.js +13 -0
  81. package/lib/commonjs/social/screens/VisitorUsageLimit/index.js.map +1 -0
  82. package/lib/module/core/assets/icons/index.js +1 -0
  83. package/lib/module/core/assets/icons/index.js.map +1 -1
  84. package/lib/module/core/assets/icons/visitorLimit.js +19 -0
  85. package/lib/module/core/assets/icons/visitorLimit.js.map +1 -0
  86. package/lib/module/core/constants/index.js +10 -0
  87. package/lib/module/core/constants/index.js.map +1 -1
  88. package/lib/module/core/hooks/useAuth.js +6 -2
  89. package/lib/module/core/hooks/useAuth.js.map +1 -1
  90. package/lib/module/core/providers/AmityUIKitProvider.js.map +1 -1
  91. package/lib/module/core/providers/AuthProvider.js +44 -21
  92. package/lib/module/core/providers/AuthProvider.js.map +1 -1
  93. package/lib/module/core/routes/AmityUIKitNavigator.js +23 -1
  94. package/lib/module/core/routes/AmityUIKitNavigator.js.map +1 -1
  95. package/lib/module/social/components/PollContent/PollOption.js +12 -12
  96. package/lib/module/social/components/PollContent/PollOption.js.map +1 -1
  97. package/lib/module/social/components/PostMenu/index.js +10 -3
  98. package/lib/module/social/components/PostMenu/index.js.map +1 -1
  99. package/lib/module/social/components/Social/CommentList/CommentList.js +6 -1
  100. package/lib/module/social/components/Social/CommentList/CommentList.js.map +1 -1
  101. package/lib/module/social/components/Social/CommentListItem/CommentListItem.js +24 -6
  102. package/lib/module/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
  103. package/lib/module/social/components/Social/CommentListItem/styles.js +3 -2
  104. package/lib/module/social/components/Social/CommentListItem/styles.js.map +1 -1
  105. package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js +14 -2
  106. package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
  107. package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +7 -2
  108. package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  109. package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +18 -4
  110. package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
  111. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js +17 -3
  112. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
  113. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/styles.js +8 -0
  114. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/styles.js.map +1 -1
  115. package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js +5 -1
  116. package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
  117. package/lib/module/social/features/livestream/Player/Player.js +9 -6
  118. package/lib/module/social/features/livestream/Player/Player.js.map +1 -1
  119. package/lib/module/social/features/post/Detail/index.js +6 -2
  120. package/lib/module/social/features/post/Detail/index.js.map +1 -1
  121. package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js +17 -11
  122. package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
  123. package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js +18 -10
  124. package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
  125. package/lib/module/social/features/story/View/components/AmityViewStoryItem.js +20 -22
  126. package/lib/module/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
  127. package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js +29 -20
  128. package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
  129. package/lib/module/social/features/user/Profile/components/Header/styles.js +2 -0
  130. package/lib/module/social/features/user/Profile/components/Header/styles.js.map +1 -1
  131. package/lib/module/social/features/user/Profile/elements/Menu/hooks/useMenu.js +16 -4
  132. package/lib/module/social/features/user/Profile/elements/Menu/hooks/useMenu.js.map +1 -1
  133. package/lib/module/social/features/visitor/UsageLimit/UsageLimit.js +40 -0
  134. package/lib/module/social/features/visitor/UsageLimit/UsageLimit.js.map +1 -0
  135. package/lib/module/social/features/visitor/UsageLimit/hooks/index.js +2 -0
  136. package/lib/module/social/features/visitor/UsageLimit/hooks/index.js.map +1 -0
  137. package/lib/module/social/features/visitor/UsageLimit/hooks/useUsageLimit.js +47 -0
  138. package/lib/module/social/features/visitor/UsageLimit/hooks/useUsageLimit.js.map +1 -0
  139. package/lib/module/social/features/visitor/UsageLimit/index.js +2 -0
  140. package/lib/module/social/features/visitor/UsageLimit/index.js.map +1 -0
  141. package/lib/module/social/features/visitor/UsageLimit/styles.js +45 -0
  142. package/lib/module/social/features/visitor/UsageLimit/styles.js.map +1 -0
  143. package/lib/module/social/hooks/index.js +2 -0
  144. package/lib/module/social/hooks/index.js.map +1 -1
  145. package/lib/module/social/hooks/useGlobalBehavior.js +36 -0
  146. package/lib/module/social/hooks/useGlobalBehavior.js.map +1 -0
  147. package/lib/module/social/hooks/useInteractionBehavior.js +43 -0
  148. package/lib/module/social/hooks/useInteractionBehavior.js.map +1 -0
  149. package/lib/module/social/hooks/usePostPermission.js +4 -2
  150. package/lib/module/social/hooks/usePostPermission.js.map +1 -1
  151. package/lib/module/social/hooks/useStoryPermission.js +3 -2
  152. package/lib/module/social/hooks/useStoryPermission.js.map +1 -1
  153. package/lib/module/social/providers/BehaviourProvider.js +1 -0
  154. package/lib/module/social/providers/BehaviourProvider.js.map +1 -1
  155. package/lib/module/social/screens/CommunityProfile/components/Header/Header.js +10 -3
  156. package/lib/module/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
  157. package/lib/module/social/screens/SocialHomePage/index.js +15 -7
  158. package/lib/module/social/screens/SocialHomePage/index.js.map +1 -1
  159. package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +5 -0
  160. package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +1 -0
  161. package/lib/module/social/screens/VisitorUsageLimit/index.js +2 -0
  162. package/lib/module/social/screens/VisitorUsageLimit/index.js.map +1 -0
  163. package/lib/typescript/core/assets/icons/index.d.ts +1 -0
  164. package/lib/typescript/core/assets/icons/index.d.ts.map +1 -1
  165. package/lib/typescript/core/assets/icons/visitorLimit.d.ts +3 -0
  166. package/lib/typescript/core/assets/icons/visitorLimit.d.ts.map +1 -0
  167. package/lib/typescript/core/constants/index.d.ts +10 -0
  168. package/lib/typescript/core/constants/index.d.ts.map +1 -1
  169. package/lib/typescript/core/hooks/useAuth.d.ts.map +1 -1
  170. package/lib/typescript/core/providers/AmityUIKitProvider.d.ts +2 -1
  171. package/lib/typescript/core/providers/AmityUIKitProvider.d.ts.map +1 -1
  172. package/lib/typescript/core/providers/AuthProvider.d.ts.map +1 -1
  173. package/lib/typescript/core/routes/AmityUIKitNavigator.d.ts.map +1 -1
  174. package/lib/typescript/core/types/auth.d.ts +2 -0
  175. package/lib/typescript/core/types/auth.d.ts.map +1 -1
  176. package/lib/typescript/core/types/behaviour.d.ts +6 -0
  177. package/lib/typescript/core/types/behaviour.d.ts.map +1 -1
  178. package/lib/typescript/social/components/PollContent/PollOption.d.ts.map +1 -1
  179. package/lib/typescript/social/components/PostMenu/index.d.ts.map +1 -1
  180. package/lib/typescript/social/components/Social/CommentList/CommentList.d.ts.map +1 -1
  181. package/lib/typescript/social/components/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
  182. package/lib/typescript/social/components/Social/CommentListItem/styles.d.ts +2 -1
  183. package/lib/typescript/social/components/Social/CommentListItem/styles.d.ts.map +1 -1
  184. package/lib/typescript/social/components/legacy/Social/ReplyCommentList/index.d.ts.map +1 -1
  185. package/lib/typescript/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.d.ts.map +1 -1
  186. package/lib/typescript/social/features/comment/components/PostComment/CommentListItem/CommentListItem.d.ts.map +1 -1
  187. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/index.d.ts.map +1 -1
  188. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/styles.d.ts +8 -0
  189. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/styles.d.ts.map +1 -1
  190. package/lib/typescript/social/features/feed/components/TopNavigation/TopNavigation.d.ts.map +1 -1
  191. package/lib/typescript/social/features/livestream/Player/Player.d.ts.map +1 -1
  192. package/lib/typescript/social/features/post/Detail/index.d.ts.map +1 -1
  193. package/lib/typescript/social/features/post/components/EngagementActions/Components/DetailStyle.d.ts.map +1 -1
  194. package/lib/typescript/social/features/post/components/EngagementActions/Components/FeedStyle.d.ts.map +1 -1
  195. package/lib/typescript/social/features/story/View/components/AmityViewStoryItem.d.ts.map +1 -1
  196. package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts +2 -0
  197. package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts.map +1 -1
  198. package/lib/typescript/social/features/user/Profile/components/Header/styles.d.ts +2 -0
  199. package/lib/typescript/social/features/user/Profile/components/Header/styles.d.ts.map +1 -1
  200. package/lib/typescript/social/features/user/Profile/elements/Menu/hooks/useMenu.d.ts.map +1 -1
  201. package/lib/typescript/social/features/visitor/UsageLimit/UsageLimit.d.ts +2 -0
  202. package/lib/typescript/social/features/visitor/UsageLimit/UsageLimit.d.ts.map +1 -0
  203. package/lib/typescript/social/features/visitor/UsageLimit/hooks/index.d.ts +2 -0
  204. package/lib/typescript/social/features/visitor/UsageLimit/hooks/index.d.ts.map +1 -0
  205. package/lib/typescript/social/features/visitor/UsageLimit/hooks/useUsageLimit.d.ts +40 -0
  206. package/lib/typescript/social/features/visitor/UsageLimit/hooks/useUsageLimit.d.ts.map +1 -0
  207. package/lib/typescript/social/features/visitor/UsageLimit/index.d.ts +2 -0
  208. package/lib/typescript/social/features/visitor/UsageLimit/index.d.ts.map +1 -0
  209. package/lib/typescript/social/features/visitor/UsageLimit/styles.d.ts +40 -0
  210. package/lib/typescript/social/features/visitor/UsageLimit/styles.d.ts.map +1 -0
  211. package/lib/typescript/social/hooks/index.d.ts +2 -0
  212. package/lib/typescript/social/hooks/index.d.ts.map +1 -1
  213. package/lib/typescript/social/hooks/useGlobalBehavior.d.ts +16 -0
  214. package/lib/typescript/social/hooks/useGlobalBehavior.d.ts.map +1 -0
  215. package/lib/typescript/social/hooks/useInteractionBehavior.d.ts +11 -0
  216. package/lib/typescript/social/hooks/useInteractionBehavior.d.ts.map +1 -0
  217. package/lib/typescript/social/hooks/usePostPermission.d.ts.map +1 -1
  218. package/lib/typescript/social/hooks/useStoryPermission.d.ts.map +1 -1
  219. package/lib/typescript/social/providers/BehaviourProvider.d.ts.map +1 -1
  220. package/lib/typescript/social/screens/CommunityProfile/components/Header/Header.d.ts.map +1 -1
  221. package/lib/typescript/social/screens/SocialHomePage/index.d.ts.map +1 -1
  222. package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts +2 -0
  223. package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts.map +1 -0
  224. package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts +2 -0
  225. package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts.map +1 -0
  226. package/package.json +3 -3
  227. package/src/core/assets/icons/index.ts +1 -0
  228. package/src/core/assets/icons/visitorLimit.tsx +19 -0
  229. package/src/core/constants/index.ts +15 -0
  230. package/src/core/hooks/useAuth.ts +4 -0
  231. package/src/core/providers/AmityUIKitProvider.tsx +2 -1
  232. package/src/core/providers/AuthProvider.tsx +35 -11
  233. package/src/core/routes/AmityUIKitNavigator.tsx +26 -1
  234. package/src/core/types/auth.ts +2 -0
  235. package/src/core/types/behaviour.ts +6 -0
  236. package/src/social/components/PollContent/PollOption.tsx +13 -19
  237. package/src/social/components/PostMenu/index.tsx +6 -3
  238. package/src/social/components/Social/CommentList/CommentList.tsx +4 -1
  239. package/src/social/components/Social/CommentListItem/CommentListItem.tsx +69 -55
  240. package/src/social/components/Social/CommentListItem/styles.ts +2 -1
  241. package/src/social/components/legacy/Social/ReplyCommentList/index.tsx +15 -5
  242. package/src/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +10 -2
  243. package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx +17 -10
  244. package/src/social/features/comment/components/PostComment/ReplyCommentList/index.tsx +15 -5
  245. package/src/social/features/comment/components/PostComment/ReplyCommentList/styles.ts +8 -0
  246. package/src/social/features/feed/components/TopNavigation/TopNavigation.tsx +3 -1
  247. package/src/social/features/livestream/Player/Player.tsx +10 -7
  248. package/src/social/features/post/Detail/index.tsx +5 -2
  249. package/src/social/features/post/components/EngagementActions/Components/DetailStyle.tsx +19 -14
  250. package/src/social/features/post/components/EngagementActions/Components/FeedStyle.tsx +20 -12
  251. package/src/social/features/story/View/components/AmityViewStoryItem.tsx +21 -22
  252. package/src/social/features/user/Profile/components/Header/hooks/useHeader.ts +27 -20
  253. package/src/social/features/user/Profile/components/Header/styles.ts +2 -0
  254. package/src/social/features/user/Profile/elements/Menu/hooks/useMenu.ts +16 -4
  255. package/src/social/features/visitor/UsageLimit/UsageLimit.tsx +43 -0
  256. package/src/social/features/visitor/UsageLimit/hooks/index.ts +1 -0
  257. package/src/social/features/visitor/UsageLimit/hooks/useUsageLimit.ts +46 -0
  258. package/src/social/features/visitor/UsageLimit/index.ts +1 -0
  259. package/src/social/features/visitor/UsageLimit/styles.ts +45 -0
  260. package/src/social/hooks/index.ts +2 -0
  261. package/src/social/hooks/useGlobalBehavior.ts +33 -0
  262. package/src/social/hooks/useInteractionBehavior.ts +47 -0
  263. package/src/social/hooks/usePostPermission.ts +3 -1
  264. package/src/social/hooks/useStoryPermission.ts +8 -6
  265. package/src/social/providers/BehaviourProvider.tsx +1 -0
  266. package/src/social/screens/CommunityProfile/components/Header/Header.tsx +8 -2
  267. package/src/social/screens/SocialHomePage/index.tsx +33 -16
  268. package/src/social/screens/VisitorUsageLimit/VisitorUsageLimit.tsx +5 -0
  269. package/src/social/screens/VisitorUsageLimit/index.ts +1 -0
@@ -6,6 +6,7 @@ import {
6
6
  useCommunity,
7
7
  isModerator,
8
8
  useUser,
9
+ useGlobalBehavior,
9
10
  } from '../../../../hooks';
10
11
  import { useStyles } from './styles';
11
12
  import { CommunityCover } from '../../elements/CommunityCover/CommunityCover';
@@ -50,6 +51,7 @@ const AmityCommunityHeaderComponent: FC<AmityCommunityHeaderComponentProps> = ({
50
51
  const client = Client.getActiveClient();
51
52
  const navigation =
52
53
  useNavigation<NativeStackNavigationProp<RootStackParamList>>();
54
+ const { handleGlobalBehavior } = useGlobalBehavior();
53
55
  const componentId = ComponentID.community_header;
54
56
  const { community } = useCommunity(communityId);
55
57
  const { posts: pendingPosts } = usePosts({
@@ -153,8 +155,12 @@ const AmityCommunityHeaderComponent: FC<AmityCommunityHeaderComponentProps> = ({
153
155
  community={community}
154
156
  style={styles.infoWrap}
155
157
  onPress={() => {
156
- navigation.navigate('CommunityMembership', {
157
- community: community,
158
+ handleGlobalBehavior({
159
+ defaultBehavior: () => {
160
+ navigation.navigate('CommunityMembership', {
161
+ community: community,
162
+ });
163
+ },
158
164
  });
159
165
  }}
160
166
  />
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { useCallback, useRef, useState } from 'react';
2
+ import { useCallback, useEffect, useRef, useState } from 'react';
3
3
  import { StyleSheet, View } from 'react-native';
4
4
  import CustomSocialTab from '../../components/CustomSocialTab/CustomSocialTab';
5
5
  import { useAmityElement, useUiKitConfig } from '../../hooks';
@@ -20,7 +20,7 @@ const PROFILE_TAB = 'Profile';
20
20
 
21
21
  const AmitySocialHomePage = () => {
22
22
  const theme = useTheme() as MyMD3Theme;
23
- const { client } = useAuth();
23
+ const { client, isVisitorOrBot } = useAuth();
24
24
 
25
25
  const styles = StyleSheet.create({
26
26
  container: {
@@ -59,13 +59,22 @@ const AmitySocialHomePage = () => {
59
59
  });
60
60
 
61
61
  const allTabs = [newsFeedTab, exploreTab, myCommunitiesTab, PROFILE_TAB];
62
+
62
63
  const visibleTabs = isExploreExcluded
63
64
  ? allTabs.filter((t) => t !== exploreTab)
64
65
  : allTabs;
65
66
 
66
67
  const [activeTab, setActiveTab] = useState<string>(newsFeedTab);
68
+
67
69
  const visitedTabs = useRef<Set<string>>(new Set([newsFeedTab]));
68
70
 
71
+ useEffect(() => {
72
+ if (isVisitorOrBot) {
73
+ visitedTabs.current.add(exploreTab);
74
+ setActiveTab(exploreTab);
75
+ }
76
+ }, [isVisitorOrBot, exploreTab]);
77
+
69
78
  const onTabChange = useCallback(
70
79
  (tabName: string) => {
71
80
  if (AmitySocialHomePageBehaviour?.onChooseTab)
@@ -85,6 +94,8 @@ const AmitySocialHomePage = () => {
85
94
  display: activeTab === tab ? ('flex' as const) : ('none' as const),
86
95
  });
87
96
 
97
+ const tabNames = isVisitorOrBot ? [exploreTab] : visibleTabs;
98
+
88
99
  return (
89
100
  <SafeAreaView
90
101
  testID="social_home_page"
@@ -93,24 +104,30 @@ const AmitySocialHomePage = () => {
93
104
  style={styles.container}
94
105
  >
95
106
  <AmitySocialHomeTopNavigationComponent activeTab={activeTab} />
96
- <CustomSocialTab
97
- activeTab={activeTab}
98
- onTabChange={onTabChange}
99
- tabNames={visibleTabs}
100
- />
101
- <Divider />
102
- <View style={tabStyle(newsFeedTab)}>
103
- <AmityNewsFeedComponent
104
- pageId={PageID.social_home_page}
105
- onPressExploreCommunity={onPressExploreCommunity}
106
- />
107
- </View>
107
+ {tabNames.length > 1 && (
108
+ <>
109
+ <CustomSocialTab
110
+ activeTab={activeTab}
111
+ onTabChange={onTabChange}
112
+ tabNames={tabNames}
113
+ />
114
+ <Divider />
115
+ </>
116
+ )}
117
+ {!isVisitorOrBot && (
118
+ <View style={tabStyle(newsFeedTab)}>
119
+ <AmityNewsFeedComponent
120
+ pageId={PageID.social_home_page}
121
+ onPressExploreCommunity={onPressExploreCommunity}
122
+ />
123
+ </View>
124
+ )}
108
125
  {visitedTabs.current.has(exploreTab) && (
109
126
  <View style={tabStyle(exploreTab)}>
110
127
  <AmityExploreComponent pageId={PageID.social_home_page} />
111
128
  </View>
112
129
  )}
113
- {visitedTabs.current.has(myCommunitiesTab) && (
130
+ {!isVisitorOrBot && visitedTabs.current.has(myCommunitiesTab) && (
114
131
  <View style={tabStyle(myCommunitiesTab)}>
115
132
  <AmityMyCommunitiesComponent
116
133
  pageId={PageID.social_home_page}
@@ -118,7 +135,7 @@ const AmitySocialHomePage = () => {
118
135
  />
119
136
  </View>
120
137
  )}
121
- {visitedTabs.current.has(PROFILE_TAB) && (
138
+ {!isVisitorOrBot && visitedTabs.current.has(PROFILE_TAB) && (
122
139
  <View style={tabStyle(PROFILE_TAB)}>
123
140
  <UserProfile inline stickyTab={false} userId={client?.userId ?? ''} />
124
141
  </View>
@@ -0,0 +1,5 @@
1
+ import { UsageLimit } from '../../features/visitor/UsageLimit';
2
+
3
+ export function VisitorUsageLimit() {
4
+ return <UsageLimit />;
5
+ }
@@ -0,0 +1 @@
1
+ export { VisitorUsageLimit } from './VisitorUsageLimit';