@amityco/react-native-social-uikit 4.0.0-e24bae8.0 → 4.0.0-e3111902.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 (275) hide show
  1. package/lib/commonjs/snippet/AmityGlobalFeedComponent.js +6 -1
  2. package/lib/commonjs/snippet/AmityGlobalFeedComponent.js.map +1 -1
  3. package/lib/commonjs/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.js +3 -3
  4. package/lib/commonjs/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.js.map +1 -1
  5. package/lib/commonjs/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.js +5 -7
  6. package/lib/commonjs/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.js.map +1 -1
  7. package/lib/commonjs/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.js +23 -3
  8. package/lib/commonjs/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.js.map +1 -1
  9. package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js +11 -17
  10. package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js.map +1 -1
  11. package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js +1 -1
  12. package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js.map +1 -1
  13. package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js +1 -1
  14. package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js.map +1 -1
  15. package/lib/commonjs/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.js +8 -23
  16. package/lib/commonjs/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.js.map +1 -1
  17. package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +13 -3
  18. package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
  19. package/lib/commonjs/v4/PublicApi/Pages/AmityDraftStoryPage/AmityDraftStoryPage.js +4 -0
  20. package/lib/commonjs/v4/PublicApi/Pages/AmityDraftStoryPage/AmityDraftStoryPage.js.map +1 -1
  21. package/lib/commonjs/v4/PublicApi/Pages/AmityDraftStoryPage/styles.js +15 -8
  22. package/lib/commonjs/v4/PublicApi/Pages/AmityDraftStoryPage/styles.js.map +1 -1
  23. package/lib/commonjs/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js +21 -29
  24. package/lib/commonjs/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js.map +1 -1
  25. package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +1 -0
  26. package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
  27. package/lib/commonjs/v4/assets/icons/lock.js +6 -4
  28. package/lib/commonjs/v4/assets/icons/lock.js.map +1 -1
  29. package/lib/commonjs/v4/component/Avatar/Avatar.js +5 -3
  30. package/lib/commonjs/v4/component/Avatar/Avatar.js.map +1 -1
  31. package/lib/commonjs/v4/component/CommunityRowItem/CommunityRowItem.js +5 -4
  32. package/lib/commonjs/v4/component/CommunityRowItem/CommunityRowItem.js.map +1 -1
  33. package/lib/commonjs/v4/component/Social/CommentList/CommentList.js +24 -15
  34. package/lib/commonjs/v4/component/Social/CommentList/CommentList.js.map +1 -1
  35. package/lib/commonjs/v4/component/Social/CommentList/styles.js +12 -0
  36. package/lib/commonjs/v4/component/Social/CommentList/styles.js.map +1 -1
  37. package/lib/commonjs/v4/component/Social/CommentListItem/CommentListItem.js +3 -2
  38. package/lib/commonjs/v4/component/Social/CommentListItem/CommentListItem.js.map +1 -1
  39. package/lib/commonjs/v4/component/TargetSelectionPage/TargetItem/TargetItem.js +4 -2
  40. package/lib/commonjs/v4/component/TargetSelectionPage/TargetItem/TargetItem.js.map +1 -1
  41. package/lib/commonjs/v4/component/TargetSelectionPage/TargetSelectionPage.js +22 -2
  42. package/lib/commonjs/v4/component/TargetSelectionPage/TargetSelectionPage.js.map +1 -1
  43. package/lib/commonjs/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +8 -3
  44. package/lib/commonjs/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  45. package/lib/commonjs/v4/elements/CommunityRowImage/CommunityRowImage.js +4 -32
  46. package/lib/commonjs/v4/elements/CommunityRowImage/CommunityRowImage.js.map +1 -1
  47. package/lib/commonjs/v4/enum/roomStatus.js +2 -1
  48. package/lib/commonjs/v4/enum/roomStatus.js.map +1 -1
  49. package/lib/commonjs/v4/features/community/Membership/components/MemberItem/MemberItem.js +2 -1
  50. package/lib/commonjs/v4/features/community/Membership/components/MemberItem/MemberItem.js.map +1 -1
  51. package/lib/commonjs/v4/features/community/Setting/hooks/useCommunitySetting.js +6 -3
  52. package/lib/commonjs/v4/features/community/Setting/hooks/useCommunitySetting.js.map +1 -1
  53. package/lib/commonjs/v4/{component/CommunityCategoryChips/CommunityCategoryChips.js → features/feed/components/CommunityCategories/CommunityCategories.js} +19 -21
  54. package/lib/commonjs/v4/features/feed/components/CommunityCategories/CommunityCategories.js.map +1 -0
  55. package/lib/commonjs/v4/features/feed/components/CommunityCategories/index.js +13 -0
  56. package/lib/commonjs/v4/features/feed/components/CommunityCategories/index.js.map +1 -0
  57. package/lib/commonjs/v4/{component/CommunityCategoryChips → features/feed/components/CommunityCategories}/styles.js +7 -2
  58. package/lib/commonjs/v4/features/feed/components/CommunityCategories/styles.js.map +1 -0
  59. package/lib/commonjs/v4/features/feed/components/index.js +17 -0
  60. package/lib/commonjs/v4/features/feed/components/index.js.map +1 -0
  61. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/CommunityCategory.js +42 -0
  62. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/CommunityCategory.js.map +1 -0
  63. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/index.js +13 -0
  64. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/index.js.map +1 -0
  65. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/styles.js +29 -0
  66. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/styles.js.map +1 -0
  67. package/lib/commonjs/v4/features/feed/elements/index.js +17 -0
  68. package/lib/commonjs/v4/features/feed/elements/index.js.map +1 -0
  69. package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js +33 -38
  70. package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
  71. package/lib/commonjs/v4/hook/usePaginator.js +11 -16
  72. package/lib/commonjs/v4/hook/usePaginator.js.map +1 -1
  73. package/lib/commonjs/v4/hook/usePostPermission.js +38 -0
  74. package/lib/commonjs/v4/hook/usePostPermission.js.map +1 -0
  75. package/lib/commonjs/v4/routes/AmitySocialUIKitV4Navigator.js +1 -0
  76. package/lib/commonjs/v4/routes/AmitySocialUIKitV4Navigator.js.map +1 -1
  77. package/lib/commonjs/v4/screen/FollowerList/Components/FollowerListItem.js +1 -1
  78. package/lib/commonjs/v4/screen/FollowerList/Components/FollowerListItem.js.map +1 -1
  79. package/lib/module/snippet/AmityGlobalFeedComponent.js +6 -1
  80. package/lib/module/snippet/AmityGlobalFeedComponent.js.map +1 -1
  81. package/lib/module/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.js +3 -3
  82. package/lib/module/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.js.map +1 -1
  83. package/lib/module/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.js +6 -8
  84. package/lib/module/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.js.map +1 -1
  85. package/lib/module/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.js +23 -3
  86. package/lib/module/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.js.map +1 -1
  87. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js +11 -17
  88. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js.map +1 -1
  89. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js +1 -1
  90. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js.map +1 -1
  91. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js +1 -1
  92. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js.map +1 -1
  93. package/lib/module/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.js +9 -23
  94. package/lib/module/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.js.map +1 -1
  95. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +13 -3
  96. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
  97. package/lib/module/v4/PublicApi/Pages/AmityDraftStoryPage/AmityDraftStoryPage.js +4 -0
  98. package/lib/module/v4/PublicApi/Pages/AmityDraftStoryPage/AmityDraftStoryPage.js.map +1 -1
  99. package/lib/module/v4/PublicApi/Pages/AmityDraftStoryPage/styles.js +15 -8
  100. package/lib/module/v4/PublicApi/Pages/AmityDraftStoryPage/styles.js.map +1 -1
  101. package/lib/module/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js +23 -31
  102. package/lib/module/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js.map +1 -1
  103. package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +1 -0
  104. package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
  105. package/lib/module/v4/assets/icons/lock.js +6 -4
  106. package/lib/module/v4/assets/icons/lock.js.map +1 -1
  107. package/lib/module/v4/component/Avatar/Avatar.js +5 -3
  108. package/lib/module/v4/component/Avatar/Avatar.js.map +1 -1
  109. package/lib/module/v4/component/CommunityRowItem/CommunityRowItem.js +5 -4
  110. package/lib/module/v4/component/CommunityRowItem/CommunityRowItem.js.map +1 -1
  111. package/lib/module/v4/component/Social/CommentList/CommentList.js +24 -15
  112. package/lib/module/v4/component/Social/CommentList/CommentList.js.map +1 -1
  113. package/lib/module/v4/component/Social/CommentList/styles.js +12 -0
  114. package/lib/module/v4/component/Social/CommentList/styles.js.map +1 -1
  115. package/lib/module/v4/component/Social/CommentListItem/CommentListItem.js +3 -2
  116. package/lib/module/v4/component/Social/CommentListItem/CommentListItem.js.map +1 -1
  117. package/lib/module/v4/component/TargetSelectionPage/TargetItem/TargetItem.js +4 -2
  118. package/lib/module/v4/component/TargetSelectionPage/TargetItem/TargetItem.js.map +1 -1
  119. package/lib/module/v4/component/TargetSelectionPage/TargetSelectionPage.js +22 -2
  120. package/lib/module/v4/component/TargetSelectionPage/TargetSelectionPage.js.map +1 -1
  121. package/lib/module/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +8 -3
  122. package/lib/module/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  123. package/lib/module/v4/elements/CommunityRowImage/CommunityRowImage.js +6 -34
  124. package/lib/module/v4/elements/CommunityRowImage/CommunityRowImage.js.map +1 -1
  125. package/lib/module/v4/enum/roomStatus.js +2 -1
  126. package/lib/module/v4/enum/roomStatus.js.map +1 -1
  127. package/lib/module/v4/features/community/Membership/components/MemberItem/MemberItem.js +2 -1
  128. package/lib/module/v4/features/community/Membership/components/MemberItem/MemberItem.js.map +1 -1
  129. package/lib/module/v4/features/community/Setting/hooks/useCommunitySetting.js +6 -3
  130. package/lib/module/v4/features/community/Setting/hooks/useCommunitySetting.js.map +1 -1
  131. package/lib/module/v4/{component/CommunityCategoryChips/CommunityCategoryChips.js → features/feed/components/CommunityCategories/CommunityCategories.js} +18 -19
  132. package/lib/module/v4/features/feed/components/CommunityCategories/CommunityCategories.js.map +1 -0
  133. package/lib/module/v4/features/feed/components/CommunityCategories/index.js +2 -0
  134. package/lib/module/v4/features/feed/components/CommunityCategories/index.js.map +1 -0
  135. package/lib/module/v4/{component/CommunityCategoryChips → features/feed/components/CommunityCategories}/styles.js +7 -2
  136. package/lib/module/v4/features/feed/components/CommunityCategories/styles.js.map +1 -0
  137. package/lib/module/v4/features/feed/components/index.js +2 -0
  138. package/lib/module/v4/features/feed/components/index.js.map +1 -0
  139. package/lib/module/v4/features/feed/elements/CommunityCategory/CommunityCategory.js +35 -0
  140. package/lib/module/v4/features/feed/elements/CommunityCategory/CommunityCategory.js.map +1 -0
  141. package/lib/module/v4/features/feed/elements/CommunityCategory/index.js +2 -0
  142. package/lib/module/v4/features/feed/elements/CommunityCategory/index.js.map +1 -0
  143. package/lib/module/v4/features/feed/elements/CommunityCategory/styles.js +22 -0
  144. package/lib/module/v4/features/feed/elements/CommunityCategory/styles.js.map +1 -0
  145. package/lib/module/v4/features/feed/elements/index.js +2 -0
  146. package/lib/module/v4/features/feed/elements/index.js.map +1 -0
  147. package/lib/module/v4/hook/useCustomRankingGlobalFeed.js +34 -39
  148. package/lib/module/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
  149. package/lib/module/v4/hook/usePaginator.js +12 -17
  150. package/lib/module/v4/hook/usePaginator.js.map +1 -1
  151. package/lib/module/v4/hook/usePostPermission.js +31 -0
  152. package/lib/module/v4/hook/usePostPermission.js.map +1 -0
  153. package/lib/module/v4/routes/AmitySocialUIKitV4Navigator.js +1 -0
  154. package/lib/module/v4/routes/AmitySocialUIKitV4Navigator.js.map +1 -1
  155. package/lib/module/v4/screen/FollowerList/Components/FollowerListItem.js +1 -1
  156. package/lib/module/v4/screen/FollowerList/Components/FollowerListItem.js.map +1 -1
  157. package/lib/typescript/src/components/PollSection/usePoll.d.ts +1 -1
  158. package/lib/typescript/src/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.d.ts +4 -0
  159. package/lib/typescript/src/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.d.ts.map +1 -1
  160. package/lib/typescript/src/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.d.ts +1 -0
  161. package/lib/typescript/src/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.d.ts.map +1 -1
  162. package/lib/typescript/src/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.d.ts.map +1 -1
  163. package/lib/typescript/src/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.d.ts.map +1 -1
  164. package/lib/typescript/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.d.ts.map +1 -1
  165. package/lib/typescript/src/v4/PublicApi/Pages/AmityDraftStoryPage/AmityDraftStoryPage.d.ts.map +1 -1
  166. package/lib/typescript/src/v4/PublicApi/Pages/AmityDraftStoryPage/styles.d.ts +14 -7
  167. package/lib/typescript/src/v4/PublicApi/Pages/AmityDraftStoryPage/styles.d.ts.map +1 -1
  168. package/lib/typescript/src/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.d.ts.map +1 -1
  169. package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.d.ts.map +1 -1
  170. package/lib/typescript/src/v4/assets/icons/lock.d.ts +1 -1
  171. package/lib/typescript/src/v4/assets/icons/lock.d.ts.map +1 -1
  172. package/lib/typescript/src/v4/component/Avatar/Avatar.d.ts.map +1 -1
  173. package/lib/typescript/src/v4/component/Social/CommentList/CommentList.d.ts +1 -0
  174. package/lib/typescript/src/v4/component/Social/CommentList/CommentList.d.ts.map +1 -1
  175. package/lib/typescript/src/v4/component/Social/CommentList/styles.d.ts +12 -0
  176. package/lib/typescript/src/v4/component/Social/CommentList/styles.d.ts.map +1 -1
  177. package/lib/typescript/src/v4/component/Social/CommentListItem/CommentListItem.d.ts +2 -1
  178. package/lib/typescript/src/v4/component/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
  179. package/lib/typescript/src/v4/component/TargetSelectionPage/TargetItem/TargetItem.d.ts +2 -1
  180. package/lib/typescript/src/v4/component/TargetSelectionPage/TargetItem/TargetItem.d.ts.map +1 -1
  181. package/lib/typescript/src/v4/component/TargetSelectionPage/TargetSelectionPage.d.ts.map +1 -1
  182. package/lib/typescript/src/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.d.ts.map +1 -1
  183. package/lib/typescript/src/v4/elements/CommunityRowImage/CommunityRowImage.d.ts +1 -1
  184. package/lib/typescript/src/v4/elements/CommunityRowImage/CommunityRowImage.d.ts.map +1 -1
  185. package/lib/typescript/src/v4/enum/roomStatus.d.ts +1 -0
  186. package/lib/typescript/src/v4/enum/roomStatus.d.ts.map +1 -1
  187. package/lib/typescript/src/v4/features/community/Membership/components/MemberItem/MemberItem.d.ts.map +1 -1
  188. package/lib/typescript/src/v4/features/community/Setting/hooks/useCommunitySetting.d.ts.map +1 -1
  189. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/CommunityCategories.d.ts +12 -0
  190. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/CommunityCategories.d.ts.map +1 -0
  191. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/index.d.ts +2 -0
  192. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/index.d.ts.map +1 -0
  193. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/styles.d.ts +30 -0
  194. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/styles.d.ts.map +1 -0
  195. package/lib/typescript/src/v4/features/feed/components/index.d.ts +2 -0
  196. package/lib/typescript/src/v4/features/feed/components/index.d.ts.map +1 -0
  197. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/CommunityCategory.d.ts +12 -0
  198. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/CommunityCategory.d.ts.map +1 -0
  199. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/index.d.ts +2 -0
  200. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/index.d.ts.map +1 -0
  201. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/styles.d.ts +17 -0
  202. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/styles.d.ts.map +1 -0
  203. package/lib/typescript/src/v4/features/feed/elements/index.d.ts +2 -0
  204. package/lib/typescript/src/v4/features/feed/elements/index.d.ts.map +1 -0
  205. package/lib/typescript/src/v4/hook/useCustomRankingGlobalFeed.d.ts +6 -1
  206. package/lib/typescript/src/v4/hook/useCustomRankingGlobalFeed.d.ts.map +1 -1
  207. package/lib/typescript/src/v4/hook/usePaginator.d.ts.map +1 -1
  208. package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts +1 -39
  209. package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts.map +1 -1
  210. package/lib/typescript/src/v4/hook/usePoll.d.ts +1 -1
  211. package/lib/typescript/src/v4/hook/usePostPermission.d.ts +6 -0
  212. package/lib/typescript/src/v4/hook/usePostPermission.d.ts.map +1 -0
  213. package/lib/typescript/src/v4/routes/AmitySocialUIKitV4Navigator.d.ts.map +1 -1
  214. package/package.json +3 -3
  215. package/src/snippet/AmityGlobalFeedComponent.tsx +6 -1
  216. package/src/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.tsx +3 -3
  217. package/src/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.tsx +9 -6
  218. package/src/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.tsx +27 -2
  219. package/src/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.tsx +29 -36
  220. package/src/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.tsx +2 -2
  221. package/src/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.tsx +1 -1
  222. package/src/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.tsx +8 -24
  223. package/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.tsx +13 -3
  224. package/src/v4/PublicApi/Pages/AmityDraftStoryPage/AmityDraftStoryPage.tsx +5 -0
  225. package/src/v4/PublicApi/Pages/AmityDraftStoryPage/styles.ts +14 -7
  226. package/src/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.tsx +27 -33
  227. package/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.tsx +1 -0
  228. package/src/v4/assets/icons/lock.tsx +7 -6
  229. package/src/v4/component/Avatar/Avatar.tsx +5 -2
  230. package/src/v4/component/CommunityRowItem/CommunityRowItem.tsx +4 -4
  231. package/src/v4/component/Social/CommentList/CommentList.tsx +69 -56
  232. package/src/v4/component/Social/CommentList/styles.ts +12 -0
  233. package/src/v4/component/Social/CommentListItem/CommentListItem.tsx +3 -1
  234. package/src/v4/component/TargetSelectionPage/TargetItem/TargetItem.tsx +3 -0
  235. package/src/v4/component/TargetSelectionPage/TargetSelectionPage.tsx +23 -1
  236. package/src/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +6 -2
  237. package/src/v4/elements/CommunityRowImage/CommunityRowImage.tsx +7 -34
  238. package/src/v4/enum/roomStatus.ts +1 -0
  239. package/src/v4/features/community/Membership/components/MemberItem/MemberItem.tsx +1 -0
  240. package/src/v4/features/community/Setting/hooks/useCommunitySetting.ts +4 -2
  241. package/src/v4/{component/CommunityCategoryChips/CommunityCategoryChips.tsx → features/feed/components/CommunityCategories/CommunityCategories.tsx} +20 -22
  242. package/src/v4/features/feed/components/CommunityCategories/index.ts +1 -0
  243. package/src/v4/{component/CommunityCategoryChips → features/feed/components/CommunityCategories}/styles.ts +4 -2
  244. package/src/v4/features/feed/components/index.ts +1 -0
  245. package/src/v4/features/feed/elements/CommunityCategory/CommunityCategory.tsx +45 -0
  246. package/src/v4/features/feed/elements/CommunityCategory/index.ts +1 -0
  247. package/src/v4/features/feed/elements/CommunityCategory/styles.ts +20 -0
  248. package/src/v4/features/feed/elements/index.ts +1 -0
  249. package/src/v4/hook/useCustomRankingGlobalFeed.ts +47 -47
  250. package/src/v4/hook/usePaginator.ts +20 -23
  251. package/src/v4/hook/usePostPermission.ts +46 -0
  252. package/src/v4/routes/AmitySocialUIKitV4Navigator.tsx +1 -0
  253. package/src/v4/screen/FollowerList/Components/FollowerListItem.tsx +1 -1
  254. package/lib/commonjs/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js +0 -38
  255. package/lib/commonjs/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js.map +0 -1
  256. package/lib/commonjs/v4/component/CommunityCategoryChips/CommunityCategoryChips.js.map +0 -1
  257. package/lib/commonjs/v4/component/CommunityCategoryChips/styles.js.map +0 -1
  258. package/lib/commonjs/v4/elements/CommunityCatetory/CommunityCategory.js +0 -38
  259. package/lib/commonjs/v4/elements/CommunityCatetory/CommunityCategory.js.map +0 -1
  260. package/lib/module/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js +0 -30
  261. package/lib/module/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js.map +0 -1
  262. package/lib/module/v4/component/CommunityCategoryChips/CommunityCategoryChips.js.map +0 -1
  263. package/lib/module/v4/component/CommunityCategoryChips/styles.js.map +0 -1
  264. package/lib/module/v4/elements/CommunityCatetory/CommunityCategory.js +0 -31
  265. package/lib/module/v4/elements/CommunityCatetory/CommunityCategory.js.map +0 -1
  266. package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.d.ts +0 -11
  267. package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.d.ts.map +0 -1
  268. package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChips.d.ts +0 -11
  269. package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChips.d.ts.map +0 -1
  270. package/lib/typescript/src/v4/component/CommunityCategoryChips/styles.d.ts +0 -27
  271. package/lib/typescript/src/v4/component/CommunityCategoryChips/styles.d.ts.map +0 -1
  272. package/lib/typescript/src/v4/elements/CommunityCatetory/CommunityCategory.d.ts +0 -12
  273. package/lib/typescript/src/v4/elements/CommunityCatetory/CommunityCategory.d.ts.map +0 -1
  274. package/src/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.tsx +0 -47
  275. package/src/v4/elements/CommunityCatetory/CommunityCategory.tsx +0 -41
@@ -6,11 +6,11 @@ import { View } from 'react-native';
6
6
  import CommunityJoinedButtonElement from '../../elements/CommunityJoinedButtonElement/CommunityJoinedButtonElement';
7
7
  import CommunityJoinButtonElement from '../../elements/CommunityJoinButtonElement/CommunityJoinButtonElement';
8
8
  import CommunityDisplayname from '../../elements/CommunityDisplayname/CommunityDisplayname';
9
- import CommunityCategory from '../../elements/CommunityCatetory/CommunityCategory';
10
9
  import CommunityMemeberCount from '../../elements/CommunityMemeberCount/CommunityMemeberCount';
11
10
  import { useStyles } from './styles';
12
11
  import CommunityPrivateBadge from '../../elements/CommunityPrivateBadge/CommunityPrivateBadge';
13
12
  import CommunityOfficialBadge from '../../elements/CommunityOfficialBadge/CommunityOfficialBadge';
13
+ import { CommunityCategories } from '../../../v4/features/feed/components';
14
14
 
15
15
  type CommunityRowItemProps = {
16
16
  pageId?: PageID;
@@ -34,7 +34,7 @@ const CommunityRowItem: FC<CommunityRowItemProps> = ({
34
34
  <CommunityRowImage
35
35
  pageId={pageId}
36
36
  componentId={componentId}
37
- fileId={community.avatarFileId}
37
+ fileUrl={community.avatar?.fileUrl}
38
38
  label={label}
39
39
  />
40
40
  <View style={styles.detailWrap}>
@@ -54,8 +54,8 @@ const CommunityRowItem: FC<CommunityRowItemProps> = ({
54
54
  </View>
55
55
  <View style={styles.detailBottomWrap}>
56
56
  <View style={styles.detailBottomWrapLeft}>
57
- <CommunityCategory
58
- categoryIds={community.categoryIds}
57
+ <CommunityCategories
58
+ categories={community.categories}
59
59
  pageId={pageId}
60
60
  componentId={componentId}
61
61
  />
@@ -9,7 +9,6 @@ import {
9
9
  } from 'react-native';
10
10
  import React, { FC, useEffect, useState, useRef, memo } from 'react';
11
11
  import { UserInterface, IMentionPosition } from '../../../../types';
12
- import { getAmityUser } from '../../../../providers/user-provider';
13
12
  import { CommentRepository } from '@amityco/ts-sdk-react-native';
14
13
  import CommentListItem from '../CommentListItem/CommentListItem';
15
14
  import {
@@ -30,6 +29,8 @@ import useMention from '../../../hook/useMention';
30
29
  import { replaceTriggerValues } from 'react-native-controlled-mentions';
31
30
  import MyAvatar from '../../MyAvatar/MyAvatar';
32
31
  import { useToast } from '../../../../v4/stores/slices/toast';
32
+ import { Typography } from '../../Typography/Typography';
33
+ import { lock } from '../../../../v4/assets/icons';
33
34
 
34
35
  interface ICommentListProp {
35
36
  postId: string;
@@ -37,6 +38,7 @@ interface ICommentListProp {
37
38
  disabledInteraction?: boolean;
38
39
  onNavigate?: () => void;
39
40
  withAvatar?: boolean;
41
+ disabledComment?: boolean;
40
42
  }
41
43
 
42
44
  interface IComment {
@@ -64,6 +66,7 @@ const CommentList: FC<ICommentListProp> = ({
64
66
  disabledInteraction,
65
67
  onNavigate,
66
68
  withAvatar,
69
+ disabledComment,
67
70
  }) => {
68
71
  const styles = useStyles();
69
72
  const theme = useTheme() as MyMD3Theme;
@@ -103,10 +106,10 @@ const CommentList: FC<ICommentListProp> = ({
103
106
  referenceType: postType,
104
107
  limit: commentListLimit,
105
108
  },
106
- async ({ error, loading, data, hasNextPage, onNextPage }) => {
109
+ ({ error, loading, data, hasNextPage, onNextPage }) => {
107
110
  if (error) return;
108
111
  if (!loading) {
109
- data && data.length > 0 && (await queryComment(data));
112
+ data && data.length > 0 && queryComment(data);
110
113
  onNextPageRef.current = hasNextPage ? onNextPage : null;
111
114
  }
112
115
  }
@@ -129,34 +132,31 @@ const CommentList: FC<ICommentListProp> = ({
129
132
  }, [inputMessage]);
130
133
 
131
134
  const queryComment = async (comments: Amity.InternalComment[]) => {
132
- const formattedCommentList = await Promise.all(
133
- comments.map(async (item: Amity.Comment) => {
134
- const { userObject } = await getAmityUser(item.userId);
135
- let formattedUserObject: UserInterface;
135
+ const formattedCommentList = comments.map((item: Amity.Comment) => {
136
+ let formattedUserObject: UserInterface;
136
137
 
137
- formattedUserObject = {
138
- userId: userObject.data.userId,
139
- displayName: userObject.data.displayName,
140
- avatarFileId: userObject.data.avatarFileId,
141
- };
138
+ formattedUserObject = {
139
+ userId: item?.creator?.userId,
140
+ displayName: item?.creator?.displayName,
141
+ avatarFileId: item?.creator?.avatarFileId,
142
+ };
142
143
 
143
- return {
144
- commentId: item.commentId,
145
- data: item.data as Record<string, any>,
146
- dataType: item.dataType || 'text',
147
- myReactions: item.myReactions as string[],
148
- reactions: item.reactions as Record<string, number>,
149
- user: formattedUserObject as UserInterface,
150
- updatedAt: item.updatedAt,
151
- editedAt: item.editedAt,
152
- createdAt: item.createdAt,
153
- childrenComment: item.children,
154
- childrenNumber: item.childrenNumber,
155
- referenceId: item.referenceId,
156
- mentionPosition: item?.metadata?.mentioned ?? [],
157
- };
158
- })
159
- );
144
+ return {
145
+ commentId: item.commentId,
146
+ data: item.data as Record<string, any>,
147
+ dataType: item.dataType || 'text',
148
+ myReactions: item.myReactions as string[],
149
+ reactions: item.reactions as Record<string, number>,
150
+ user: formattedUserObject as UserInterface,
151
+ updatedAt: item.updatedAt,
152
+ editedAt: item.editedAt,
153
+ createdAt: item.createdAt,
154
+ childrenComment: item.children,
155
+ childrenNumber: item.childrenNumber,
156
+ referenceId: item.referenceId,
157
+ mentionPosition: item?.metadata?.mentioned ?? [],
158
+ };
159
+ });
160
160
  setCommentList([...formattedCommentList]);
161
161
  };
162
162
 
@@ -251,35 +251,47 @@ const CommentList: FC<ICommentListProp> = ({
251
251
  </TouchableOpacity>
252
252
  </View>
253
253
  )}
254
- {!disabledInteraction && (
255
- <View style={styles.inputWrap}>
256
- {withAvatar && <MyAvatar />}
257
- <View style={styles.inputContainer}>
258
- {renderInput({
259
- multiline: true,
260
- style: styles.textInput,
261
- placeholder: 'Say something nice...',
262
- placeholderTextColor: theme.colors.baseShade3,
263
- })}
254
+ {!disabledInteraction &&
255
+ (disabledComment ? (
256
+ <View style={styles.disabledCommentWrap}>
257
+ <SvgXml
258
+ width={20}
259
+ height={20}
260
+ xml={lock()}
261
+ color={theme.colors.baseShade2}
262
+ />
263
+ <Typography.Body style={styles.disabledCommentText}>
264
+ Comments are disabled for this story
265
+ </Typography.Body>
264
266
  </View>
265
-
266
- <TouchableOpacity
267
- disabled={inputMessage.length > 0 ? false : true}
268
- onPress={handleSend}
269
- style={styles.postBtn}
270
- >
271
- <Text
272
- style={
273
- inputMessage.length > 0
274
- ? styles.postBtnText
275
- : styles.postDisabledBtn
276
- }
267
+ ) : (
268
+ <View style={styles.inputWrap}>
269
+ {withAvatar && <MyAvatar />}
270
+ <View style={styles.inputContainer}>
271
+ {renderInput({
272
+ multiline: true,
273
+ style: styles.textInput,
274
+ placeholder: 'Say something nice...',
275
+ placeholderTextColor: theme.colors.baseShade3,
276
+ })}
277
+ </View>
278
+ <TouchableOpacity
279
+ disabled={inputMessage.length > 0 ? false : true}
280
+ onPress={handleSend}
281
+ style={styles.postBtn}
277
282
  >
278
- Post
279
- </Text>
280
- </TouchableOpacity>
281
- </View>
282
- )}
283
+ <Text
284
+ style={
285
+ inputMessage.length > 0
286
+ ? styles.postBtnText
287
+ : styles.postDisabledBtn
288
+ }
289
+ >
290
+ Post
291
+ </Text>
292
+ </TouchableOpacity>
293
+ </View>
294
+ ))}
283
295
  </KeyboardAvoidingView>
284
296
  );
285
297
  };
@@ -299,6 +311,7 @@ const CommentList: FC<ICommentListProp> = ({
299
311
  commentDetail={item}
300
312
  onClickReply={handleClickReply}
301
313
  postType={postType}
314
+ disabledComment={disabledComment}
302
315
  disabledInteraction={disabledInteraction}
303
316
  onNavigate={onNavigate}
304
317
  />
@@ -123,6 +123,18 @@ export const useStyles = () => {
123
123
  commentListFooter: {
124
124
  width: width,
125
125
  },
126
+ disabledCommentWrap: {
127
+ flexDirection: 'row',
128
+ alignItems: 'center',
129
+ justifyContent: 'center',
130
+ padding: 16,
131
+ gap: 8,
132
+ borderTopWidth: 1,
133
+ borderTopColor: theme.colors.baseShade4,
134
+ },
135
+ disabledCommentText: {
136
+ color: theme.colors.baseShade2,
137
+ },
126
138
  });
127
139
 
128
140
  return styles;
@@ -69,6 +69,7 @@ export interface ICommentList {
69
69
  onClickReply: (user: UserInterface, commentId: string) => void;
70
70
  postType: Amity.CommentReferenceType;
71
71
  disabledInteraction?: boolean;
72
+ disabledComment?: boolean;
72
73
  onNavigate?: () => void;
73
74
  }
74
75
 
@@ -79,6 +80,7 @@ const CommentListItem = ({
79
80
  postType,
80
81
  disabledInteraction,
81
82
  onNavigate,
83
+ disabledComment,
82
84
  }: ICommentList) => {
83
85
  const theme = useTheme() as MyMD3Theme;
84
86
  const styles = useStyles();
@@ -345,7 +347,7 @@ const CommentListItem = ({
345
347
  </Typography.CaptionBold>
346
348
  </TouchableOpacity>
347
349
  <TouchableOpacity
348
- onPress={onHandleReply}
350
+ onPress={disabledComment ? undefined : onHandleReply}
349
351
  style={styles.likeBtn}
350
352
  >
351
353
  <Typography.CaptionBold style={styles.btnText}>
@@ -18,6 +18,7 @@ interface ITargetItem {
18
18
  isBadgeShow?: boolean;
19
19
  isPrivate?: boolean;
20
20
  onSelect: () => void;
21
+ avatarCustomUrl?: string;
21
22
  }
22
23
 
23
24
  const TargetItem = ({
@@ -30,6 +31,7 @@ const TargetItem = ({
30
31
  isBadgeShow,
31
32
  isPrivate,
32
33
  onSelect,
34
+ avatarCustomUrl,
33
35
  }: ITargetItem) => {
34
36
  const theme = useTheme() as MyMD3Theme;
35
37
 
@@ -72,6 +74,7 @@ const TargetItem = ({
72
74
  elementID={avatarElementId}
73
75
  avatarId={avatarFileId}
74
76
  targetType="community"
77
+ avatarCustomUrl={avatarCustomUrl}
75
78
  />
76
79
  {isPrivate && (
77
80
  <ImageElement
@@ -19,6 +19,8 @@ import { useStyles } from './styles';
19
19
  import { Illustration } from '../../../v4/PublicApi/Components/AmityEmptyNewsFeedComponent/Elements';
20
20
  import { useNavigation } from '@react-navigation/native';
21
21
  import { NativeStackNavigationProp } from '@react-navigation/native-stack';
22
+ import { CommunityPostSettings } from '@amityco/ts-sdk-react-native';
23
+ import { usePostPermission } from '../../../v4/hook/usePostPermission';
22
24
 
23
25
  export type FeedParams = {
24
26
  targetId: string;
@@ -76,7 +78,7 @@ const TargetSelectionPage = ({
76
78
  });
77
79
 
78
80
  const renderItem = ({ item }: { item: Amity.Community }) => {
79
- return (
81
+ const target = (
80
82
  <TargetItem
81
83
  key={item.communityId}
82
84
  displayName={item.displayName}
@@ -88,12 +90,20 @@ const TargetSelectionPage = ({
88
90
  targetName: item.displayName,
89
91
  targetType: 'community',
90
92
  community: item,
93
+ postSetting: item.postSetting,
94
+ isPublic: item.isPublic,
91
95
  })
92
96
  }
93
97
  avatarElementId={ElementID.community_avatar}
94
98
  avatarFileId={item.avatarFileId}
95
99
  />
96
100
  );
101
+
102
+ if (item?.postSetting === CommunityPostSettings.ONLY_ADMIN_CAN_POST) {
103
+ return <AdminOnlyCommunity community={item}>{target}</AdminOnlyCommunity>;
104
+ }
105
+
106
+ return target;
97
107
  };
98
108
 
99
109
  return (
@@ -135,6 +145,7 @@ const TargetSelectionPage = ({
135
145
  targetType: 'user',
136
146
  })
137
147
  }
148
+ avatarCustomUrl={user?.avatarCustomUrl}
138
149
  avatarFileId={user?.avatarFileId}
139
150
  />
140
151
  <View style={styles.divider}>
@@ -166,3 +177,14 @@ const TargetSelectionPage = ({
166
177
  };
167
178
 
168
179
  export default React.memo(TargetSelectionPage);
180
+
181
+ type AdminOnlyCommunityProps = {
182
+ community: Amity.Community;
183
+ children: React.ReactNode;
184
+ };
185
+
186
+ function AdminOnlyCommunity({ community, children }: AdminOnlyCommunityProps) {
187
+ const hasPostPermission = usePostPermission({ community });
188
+
189
+ return hasPostPermission ? children : null;
190
+ }
@@ -27,9 +27,13 @@ const CommunityJoinButton: FC<CommunityJoinButtonType> = ({
27
27
  elementId: ElementID.community_join_button,
28
28
  });
29
29
 
30
- const { refresh } = useCustomRankingGlobalFeed();
30
+ const { refresh, globalFeedPosts } = useCustomRankingGlobalFeed({
31
+ enabled: false,
32
+ });
31
33
  const { joinCommunity, isPending } = useJoinCommunity({
32
- onSuccess: () => setTimeout(() => refresh(), 3000),
34
+ onSuccess: () => {
35
+ globalFeedPosts.length === 0 && refresh();
36
+ },
33
37
  });
34
38
 
35
39
  const handleJoinCommunity = () => {
@@ -1,67 +1,40 @@
1
- import React, { FC, memo, useEffect, useState } from 'react';
1
+ import React, { FC, memo } from 'react';
2
2
  import LinearGradient from 'react-native-linear-gradient';
3
3
  import { ComponentID, ElementID, PageID } from '../../enum';
4
- import { useAmityElement, useConfigImageUri, useFile } from '../../hook';
4
+ import { useAmityElement } from '../../hook';
5
5
  import { Image, View } from 'react-native';
6
6
  import { useStyles } from './styles';
7
7
  import { Typography } from '../../component/Typography/Typography';
8
8
  import { SvgXml } from 'react-native-svg';
9
9
  import { community as communityIcon } from '../../assets/icons';
10
+ import { getFileUrlWithSize } from '../../../v4/utils';
10
11
 
11
12
  type CommunityRowImageyProps = {
12
- fileId?: string;
13
+ fileUrl?: string;
13
14
  pageId?: PageID;
14
15
  componentId?: ComponentID;
15
16
  label?: string;
16
17
  };
17
18
 
18
19
  const CommunityRowImagey: FC<CommunityRowImageyProps> = ({
19
- fileId,
20
+ fileUrl,
20
21
  pageId = PageID.WildCardPage,
21
22
  componentId = ComponentID.WildCardComponent,
22
23
  label,
23
24
  }) => {
24
- // TODO: add state loading and loading skeleton
25
25
  const elementId = ElementID.community_row_image;
26
26
  const styles = useStyles();
27
- const [image, setImage] = useState<string | undefined>(undefined);
28
27
  const { accessibilityId } = useAmityElement({
29
28
  pageId,
30
29
  componentId,
31
30
  elementId,
32
31
  });
33
32
 
34
- const { uri } = useConfigImageUri({
35
- configPath: {
36
- page: pageId,
37
- component: componentId,
38
- element: elementId,
39
- },
40
- configKey: 'image',
41
- });
42
-
43
- const { getImage } = useFile();
44
-
45
- useEffect(() => {
46
- const getImageUrl = async () => {
47
- if (!fileId) return;
48
-
49
- if (!fileId && uri) {
50
- setImage(uri);
51
- } else if (fileId) {
52
- const url = await getImage({ fileId });
53
- setImage(url);
54
- }
55
- };
56
-
57
- getImageUrl();
58
- }, [uri, fileId, getImage]);
59
-
60
33
  return (
61
34
  <View testID={accessibilityId} style={styles.container}>
62
- {image ? (
35
+ {fileUrl ? (
63
36
  <Image
64
- source={{ uri: image as string }}
37
+ source={{ uri: getFileUrlWithSize(fileUrl) }}
65
38
  style={styles.image}
66
39
  resizeMode="cover"
67
40
  />
@@ -5,4 +5,5 @@ export const RoomStatus = {
5
5
  ended: 'ended',
6
6
  waitingReconnect: 'waitingReconnect',
7
7
  terminated: 'terminated',
8
+ error: 'error',
8
9
  } as const satisfies Record<Amity.RoomStatus, Amity.RoomStatus>;
@@ -221,6 +221,7 @@ function MemberItem({ member, communityId, refreshMembers }: MemberItemProps) {
221
221
  uri={member.user?.avatarCustomUrl}
222
222
  roles={member.roles}
223
223
  userName={member.user?.displayName ?? member.user?.userId}
224
+ userId={member.userId}
224
225
  />
225
226
  <Typography.BodyBold
226
227
  style={styles.userName}
@@ -18,7 +18,9 @@ export function useCommunitySetting(community: Amity.Community) {
18
18
  >();
19
19
  const { AmityCommunitySettingPageBehavior } = useBehaviour();
20
20
  const { showToast } = useToast();
21
- const { refresh } = useCustomRankingGlobalFeed();
21
+ const { refresh, globalFeedPosts } = useCustomRankingGlobalFeed({
22
+ enabled: false,
23
+ });
22
24
 
23
25
  const { mutate: leaveCommunity } = useMutation({
24
26
  mutationFn: async () =>
@@ -26,7 +28,7 @@ export function useCommunitySetting(community: Amity.Community) {
26
28
  onSuccess: () => {
27
29
  navigation.goBack();
28
30
  showToast({ message: 'Successfully left the group', type: 'success' });
29
- setTimeout(() => refresh(), 3000);
31
+ globalFeedPosts.length === 0 && setTimeout(() => refresh(), 3000);
30
32
  },
31
33
  onError: (error) => {
32
34
  if (error.message.includes(ERROR_CODE.ONLY_ONE_MODERATOR)) {
@@ -1,26 +1,26 @@
1
1
  import React from 'react';
2
2
  import { Text, View, ViewProps, ScrollView } from 'react-native';
3
- import { CommunityCategoryChip } from './CommunityCategoryChip/CommunityCategoryChip';
4
- import type { MyMD3Theme } from 'src/providers/amity-ui-kit-provider';
3
+ import { CommunityCategory } from '../../elements/CommunityCategory/CommunityCategory';
5
4
  import { useStyles } from './styles';
5
+ import { ComponentID, PageID } from '../../../../enum';
6
6
 
7
- type CommunityCategoryChipsProps = ViewProps & {
8
- themeStyles: MyMD3Theme;
9
- categoryIds: string[];
7
+ type CommunityCategoriesProps = ViewProps & {
8
+ categories: Amity.Category[];
9
+ pageId?: PageID;
10
+ componentId?: ComponentID;
10
11
  allVisible?: boolean;
11
12
  };
12
13
 
13
14
  const MAX_VISIBLE_CATEGORIES = 2;
14
15
 
15
- export const CommunityCategoryChips: React.FC<CommunityCategoryChipsProps> = ({
16
- categoryIds,
17
- themeStyles,
16
+ export function CommunityCategories({
17
+ categories,
18
18
  allVisible,
19
19
  ...props
20
- }) => {
21
- const styles = useStyles(themeStyles);
22
- const visibleCategories = categoryIds.slice(0, MAX_VISIBLE_CATEGORIES);
23
- const hiddenCategoriesCount = categoryIds.length - MAX_VISIBLE_CATEGORIES;
20
+ }: CommunityCategoriesProps) {
21
+ const { styles } = useStyles();
22
+ const visibleCategories = categories.slice(0, MAX_VISIBLE_CATEGORIES);
23
+ const hiddenCategoriesCount = categories.length - MAX_VISIBLE_CATEGORIES;
24
24
  const showMoreText =
25
25
  hiddenCategoriesCount > 0 ? `+${hiddenCategoriesCount}` : '';
26
26
  const showMore = hiddenCategoriesCount > 0;
@@ -51,7 +51,7 @@ export const CommunityCategoryChips: React.FC<CommunityCategoryChipsProps> = ({
51
51
  };
52
52
 
53
53
  // Choose all categories or just the visible ones based on allVisible
54
- const displayCategories = allVisible ? categoryIds : visibleCategories;
54
+ const displayCategories = allVisible ? categories : visibleCategories;
55
55
  // Only show more indicator if not showing all categories
56
56
  const displayShowMore = !allVisible && showMore;
57
57
 
@@ -63,23 +63,21 @@ export const CommunityCategoryChips: React.FC<CommunityCategoryChipsProps> = ({
63
63
  showsHorizontalScrollIndicator={false}
64
64
  contentContainerStyle={styles.scrollableContainer}
65
65
  >
66
- {displayCategories.map((id, index) => (
67
- <CommunityCategoryChip
66
+ {displayCategories.map((category, index) => (
67
+ <CommunityCategory
68
68
  key={index}
69
- categoryId={id}
69
+ categoryName={category.name}
70
70
  maxWidth={getMaxWidthForItem(displayCategories.length)}
71
- themeStyles={themeStyles}
72
71
  />
73
72
  ))}
74
73
  </ScrollView>
75
74
  ) : (
76
75
  <>
77
- {displayCategories.map((id, index) => (
78
- <CommunityCategoryChip
76
+ {displayCategories.map((category, index) => (
77
+ <CommunityCategory
79
78
  key={index}
80
- categoryId={id}
79
+ categoryName={category.name}
81
80
  maxWidth={getMaxWidthForItem(displayCategories.length)}
82
- themeStyles={themeStyles}
83
81
  />
84
82
  ))}
85
83
  {displayShowMore && (
@@ -91,4 +89,4 @@ export const CommunityCategoryChips: React.FC<CommunityCategoryChipsProps> = ({
91
89
  )}
92
90
  </View>
93
91
  );
94
- };
92
+ }
@@ -0,0 +1 @@
1
+ export { CommunityCategories } from './CommunityCategories';
@@ -1,7 +1,9 @@
1
1
  import { StyleSheet } from 'react-native';
2
+ import { useTheme } from 'react-native-paper';
2
3
  import { MyMD3Theme } from 'src/providers/amity-ui-kit-provider';
3
4
 
4
- export const useStyles = (theme: MyMD3Theme) => {
5
+ export const useStyles = () => {
6
+ const theme = useTheme<MyMD3Theme>();
5
7
  const styles = StyleSheet.create({
6
8
  container: {
7
9
  flexDirection: 'row',
@@ -27,5 +29,5 @@ export const useStyles = (theme: MyMD3Theme) => {
27
29
  color: theme.colors.base,
28
30
  },
29
31
  });
30
- return styles;
32
+ return { styles, theme };
31
33
  };
@@ -0,0 +1 @@
1
+ export * from './CommunityCategories';
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import { DimensionValue, Text, View } from 'react-native';
3
+ import { useStyles } from './styles';
4
+ import { useAmityElement } from '../../../../hook';
5
+ import { ComponentID, ElementID, PageID } from '../../../../enum';
6
+
7
+ type CommunityCategoryProps = {
8
+ categoryName: string;
9
+ style?: object;
10
+ maxWidth?: number | string;
11
+ pageId?: PageID;
12
+ componentId?: ComponentID;
13
+ };
14
+
15
+ export function CommunityCategory({
16
+ categoryName,
17
+ style,
18
+ maxWidth,
19
+ pageId,
20
+ componentId,
21
+ }: CommunityCategoryProps) {
22
+ const { styles } = useStyles();
23
+ const { accessibilityId, isExcluded } = useAmityElement({
24
+ pageId,
25
+ componentId,
26
+ elementId: ElementID.community_category,
27
+ });
28
+
29
+ if (isExcluded) return null;
30
+
31
+ return (
32
+ <View
33
+ testID={accessibilityId}
34
+ style={[
35
+ styles.chipContainer,
36
+ maxWidth ? { maxWidth: maxWidth as DimensionValue } : null,
37
+ style,
38
+ ]}
39
+ >
40
+ <Text style={styles.chipText} numberOfLines={1}>
41
+ {categoryName}
42
+ </Text>
43
+ </View>
44
+ );
45
+ }
@@ -0,0 +1 @@
1
+ export { CommunityCategory } from './CommunityCategory';
@@ -0,0 +1,20 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import { useTheme } from 'react-native-paper';
3
+ import { MyMD3Theme } from 'src/providers/amity-ui-kit-provider';
4
+
5
+ export const useStyles = () => {
6
+ const theme = useTheme<MyMD3Theme>();
7
+ const styles = StyleSheet.create({
8
+ chipContainer: {
9
+ backgroundColor: theme.colors.baseShade4,
10
+ paddingHorizontal: 6,
11
+ borderRadius: 20,
12
+ },
13
+ chipText: {
14
+ fontSize: 13,
15
+ lineHeight: 18,
16
+ color: theme.colors.base,
17
+ },
18
+ });
19
+ return { styles, theme };
20
+ };
@@ -0,0 +1 @@
1
+ export * from './CommunityCategory';