@amityco/react-native-social-uikit 4.0.0-RC18 → 4.0.0-RC20

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 (243) 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 +8 -2
  18. package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
  19. package/lib/commonjs/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js +21 -29
  20. package/lib/commonjs/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js.map +1 -1
  21. package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +1 -0
  22. package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
  23. package/lib/commonjs/v4/assets/icons/lock.js +6 -4
  24. package/lib/commonjs/v4/assets/icons/lock.js.map +1 -1
  25. package/lib/commonjs/v4/component/CommunityRowItem/CommunityRowItem.js +5 -4
  26. package/lib/commonjs/v4/component/CommunityRowItem/CommunityRowItem.js.map +1 -1
  27. package/lib/commonjs/v4/component/Social/CommentList/CommentList.js +24 -15
  28. package/lib/commonjs/v4/component/Social/CommentList/CommentList.js.map +1 -1
  29. package/lib/commonjs/v4/component/Social/CommentList/styles.js +12 -0
  30. package/lib/commonjs/v4/component/Social/CommentList/styles.js.map +1 -1
  31. package/lib/commonjs/v4/component/Social/CommentListItem/CommentListItem.js +3 -2
  32. package/lib/commonjs/v4/component/Social/CommentListItem/CommentListItem.js.map +1 -1
  33. package/lib/commonjs/v4/component/TargetSelectionPage/TargetItem/TargetItem.js +4 -2
  34. package/lib/commonjs/v4/component/TargetSelectionPage/TargetItem/TargetItem.js.map +1 -1
  35. package/lib/commonjs/v4/component/TargetSelectionPage/TargetSelectionPage.js +1 -0
  36. package/lib/commonjs/v4/component/TargetSelectionPage/TargetSelectionPage.js.map +1 -1
  37. package/lib/commonjs/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +8 -3
  38. package/lib/commonjs/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  39. package/lib/commonjs/v4/elements/CommunityRowImage/CommunityRowImage.js +4 -32
  40. package/lib/commonjs/v4/elements/CommunityRowImage/CommunityRowImage.js.map +1 -1
  41. package/lib/commonjs/v4/enum/roomStatus.js +2 -1
  42. package/lib/commonjs/v4/enum/roomStatus.js.map +1 -1
  43. package/lib/commonjs/v4/features/community/Setting/hooks/useCommunitySetting.js +6 -3
  44. package/lib/commonjs/v4/features/community/Setting/hooks/useCommunitySetting.js.map +1 -1
  45. package/lib/commonjs/v4/{component/CommunityCategoryChips/CommunityCategoryChips.js → features/feed/components/CommunityCategories/CommunityCategories.js} +19 -21
  46. package/lib/commonjs/v4/features/feed/components/CommunityCategories/CommunityCategories.js.map +1 -0
  47. package/lib/commonjs/v4/features/feed/components/CommunityCategories/index.js +13 -0
  48. package/lib/commonjs/v4/features/feed/components/CommunityCategories/index.js.map +1 -0
  49. package/lib/commonjs/v4/{component/CommunityCategoryChips → features/feed/components/CommunityCategories}/styles.js +7 -2
  50. package/lib/commonjs/v4/features/feed/components/CommunityCategories/styles.js.map +1 -0
  51. package/lib/commonjs/v4/features/feed/components/index.js +17 -0
  52. package/lib/commonjs/v4/features/feed/components/index.js.map +1 -0
  53. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/CommunityCategory.js +42 -0
  54. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/CommunityCategory.js.map +1 -0
  55. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/index.js +13 -0
  56. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/index.js.map +1 -0
  57. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/styles.js +29 -0
  58. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/styles.js.map +1 -0
  59. package/lib/commonjs/v4/features/feed/elements/index.js +17 -0
  60. package/lib/commonjs/v4/features/feed/elements/index.js.map +1 -0
  61. package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js +33 -38
  62. package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
  63. package/lib/commonjs/v4/hook/usePaginator.js +11 -16
  64. package/lib/commonjs/v4/hook/usePaginator.js.map +1 -1
  65. package/lib/commonjs/v4/routes/AmitySocialUIKitV4Navigator.js +1 -0
  66. package/lib/commonjs/v4/routes/AmitySocialUIKitV4Navigator.js.map +1 -1
  67. package/lib/commonjs/v4/screen/FollowerList/Components/FollowerListItem.js +1 -1
  68. package/lib/commonjs/v4/screen/FollowerList/Components/FollowerListItem.js.map +1 -1
  69. package/lib/module/snippet/AmityGlobalFeedComponent.js +6 -1
  70. package/lib/module/snippet/AmityGlobalFeedComponent.js.map +1 -1
  71. package/lib/module/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.js +3 -3
  72. package/lib/module/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.js.map +1 -1
  73. package/lib/module/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.js +6 -8
  74. package/lib/module/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.js.map +1 -1
  75. package/lib/module/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.js +23 -3
  76. package/lib/module/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.js.map +1 -1
  77. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js +11 -17
  78. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js.map +1 -1
  79. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js +1 -1
  80. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js.map +1 -1
  81. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js +1 -1
  82. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js.map +1 -1
  83. package/lib/module/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.js +9 -23
  84. package/lib/module/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.js.map +1 -1
  85. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +8 -2
  86. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
  87. package/lib/module/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js +23 -31
  88. package/lib/module/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js.map +1 -1
  89. package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +1 -0
  90. package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
  91. package/lib/module/v4/assets/icons/lock.js +6 -4
  92. package/lib/module/v4/assets/icons/lock.js.map +1 -1
  93. package/lib/module/v4/component/CommunityRowItem/CommunityRowItem.js +5 -4
  94. package/lib/module/v4/component/CommunityRowItem/CommunityRowItem.js.map +1 -1
  95. package/lib/module/v4/component/Social/CommentList/CommentList.js +24 -15
  96. package/lib/module/v4/component/Social/CommentList/CommentList.js.map +1 -1
  97. package/lib/module/v4/component/Social/CommentList/styles.js +12 -0
  98. package/lib/module/v4/component/Social/CommentList/styles.js.map +1 -1
  99. package/lib/module/v4/component/Social/CommentListItem/CommentListItem.js +3 -2
  100. package/lib/module/v4/component/Social/CommentListItem/CommentListItem.js.map +1 -1
  101. package/lib/module/v4/component/TargetSelectionPage/TargetItem/TargetItem.js +4 -2
  102. package/lib/module/v4/component/TargetSelectionPage/TargetItem/TargetItem.js.map +1 -1
  103. package/lib/module/v4/component/TargetSelectionPage/TargetSelectionPage.js +1 -0
  104. package/lib/module/v4/component/TargetSelectionPage/TargetSelectionPage.js.map +1 -1
  105. package/lib/module/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +8 -3
  106. package/lib/module/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  107. package/lib/module/v4/elements/CommunityRowImage/CommunityRowImage.js +6 -34
  108. package/lib/module/v4/elements/CommunityRowImage/CommunityRowImage.js.map +1 -1
  109. package/lib/module/v4/enum/roomStatus.js +2 -1
  110. package/lib/module/v4/enum/roomStatus.js.map +1 -1
  111. package/lib/module/v4/features/community/Setting/hooks/useCommunitySetting.js +6 -3
  112. package/lib/module/v4/features/community/Setting/hooks/useCommunitySetting.js.map +1 -1
  113. package/lib/module/v4/{component/CommunityCategoryChips/CommunityCategoryChips.js → features/feed/components/CommunityCategories/CommunityCategories.js} +18 -19
  114. package/lib/module/v4/features/feed/components/CommunityCategories/CommunityCategories.js.map +1 -0
  115. package/lib/module/v4/features/feed/components/CommunityCategories/index.js +2 -0
  116. package/lib/module/v4/features/feed/components/CommunityCategories/index.js.map +1 -0
  117. package/lib/module/v4/{component/CommunityCategoryChips → features/feed/components/CommunityCategories}/styles.js +7 -2
  118. package/lib/module/v4/features/feed/components/CommunityCategories/styles.js.map +1 -0
  119. package/lib/module/v4/features/feed/components/index.js +2 -0
  120. package/lib/module/v4/features/feed/components/index.js.map +1 -0
  121. package/lib/module/v4/features/feed/elements/CommunityCategory/CommunityCategory.js +35 -0
  122. package/lib/module/v4/features/feed/elements/CommunityCategory/CommunityCategory.js.map +1 -0
  123. package/lib/module/v4/features/feed/elements/CommunityCategory/index.js +2 -0
  124. package/lib/module/v4/features/feed/elements/CommunityCategory/index.js.map +1 -0
  125. package/lib/module/v4/features/feed/elements/CommunityCategory/styles.js +22 -0
  126. package/lib/module/v4/features/feed/elements/CommunityCategory/styles.js.map +1 -0
  127. package/lib/module/v4/features/feed/elements/index.js +2 -0
  128. package/lib/module/v4/features/feed/elements/index.js.map +1 -0
  129. package/lib/module/v4/hook/useCustomRankingGlobalFeed.js +34 -39
  130. package/lib/module/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
  131. package/lib/module/v4/hook/usePaginator.js +12 -17
  132. package/lib/module/v4/hook/usePaginator.js.map +1 -1
  133. package/lib/module/v4/routes/AmitySocialUIKitV4Navigator.js +1 -0
  134. package/lib/module/v4/routes/AmitySocialUIKitV4Navigator.js.map +1 -1
  135. package/lib/module/v4/screen/FollowerList/Components/FollowerListItem.js +1 -1
  136. package/lib/module/v4/screen/FollowerList/Components/FollowerListItem.js.map +1 -1
  137. package/lib/typescript/src/components/PollSection/usePoll.d.ts +1 -1
  138. package/lib/typescript/src/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.d.ts +4 -0
  139. package/lib/typescript/src/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.d.ts.map +1 -1
  140. package/lib/typescript/src/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.d.ts +1 -0
  141. package/lib/typescript/src/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.d.ts.map +1 -1
  142. package/lib/typescript/src/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.d.ts.map +1 -1
  143. package/lib/typescript/src/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.d.ts.map +1 -1
  144. package/lib/typescript/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.d.ts.map +1 -1
  145. package/lib/typescript/src/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.d.ts.map +1 -1
  146. package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.d.ts.map +1 -1
  147. package/lib/typescript/src/v4/assets/icons/lock.d.ts +1 -1
  148. package/lib/typescript/src/v4/assets/icons/lock.d.ts.map +1 -1
  149. package/lib/typescript/src/v4/component/Social/CommentList/CommentList.d.ts +1 -0
  150. package/lib/typescript/src/v4/component/Social/CommentList/CommentList.d.ts.map +1 -1
  151. package/lib/typescript/src/v4/component/Social/CommentList/styles.d.ts +12 -0
  152. package/lib/typescript/src/v4/component/Social/CommentList/styles.d.ts.map +1 -1
  153. package/lib/typescript/src/v4/component/Social/CommentListItem/CommentListItem.d.ts +2 -1
  154. package/lib/typescript/src/v4/component/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
  155. package/lib/typescript/src/v4/component/TargetSelectionPage/TargetItem/TargetItem.d.ts +2 -1
  156. package/lib/typescript/src/v4/component/TargetSelectionPage/TargetItem/TargetItem.d.ts.map +1 -1
  157. package/lib/typescript/src/v4/component/TargetSelectionPage/TargetSelectionPage.d.ts.map +1 -1
  158. package/lib/typescript/src/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.d.ts.map +1 -1
  159. package/lib/typescript/src/v4/elements/CommunityRowImage/CommunityRowImage.d.ts +1 -1
  160. package/lib/typescript/src/v4/elements/CommunityRowImage/CommunityRowImage.d.ts.map +1 -1
  161. package/lib/typescript/src/v4/enum/roomStatus.d.ts +1 -0
  162. package/lib/typescript/src/v4/enum/roomStatus.d.ts.map +1 -1
  163. package/lib/typescript/src/v4/features/community/Setting/hooks/useCommunitySetting.d.ts.map +1 -1
  164. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/CommunityCategories.d.ts +12 -0
  165. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/CommunityCategories.d.ts.map +1 -0
  166. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/index.d.ts +2 -0
  167. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/index.d.ts.map +1 -0
  168. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/styles.d.ts +30 -0
  169. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/styles.d.ts.map +1 -0
  170. package/lib/typescript/src/v4/features/feed/components/index.d.ts +2 -0
  171. package/lib/typescript/src/v4/features/feed/components/index.d.ts.map +1 -0
  172. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/CommunityCategory.d.ts +12 -0
  173. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/CommunityCategory.d.ts.map +1 -0
  174. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/index.d.ts +2 -0
  175. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/index.d.ts.map +1 -0
  176. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/styles.d.ts +17 -0
  177. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/styles.d.ts.map +1 -0
  178. package/lib/typescript/src/v4/features/feed/elements/index.d.ts +2 -0
  179. package/lib/typescript/src/v4/features/feed/elements/index.d.ts.map +1 -0
  180. package/lib/typescript/src/v4/hook/useCustomRankingGlobalFeed.d.ts +6 -1
  181. package/lib/typescript/src/v4/hook/useCustomRankingGlobalFeed.d.ts.map +1 -1
  182. package/lib/typescript/src/v4/hook/usePaginator.d.ts.map +1 -1
  183. package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts +1 -39
  184. package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts.map +1 -1
  185. package/lib/typescript/src/v4/hook/usePoll.d.ts +1 -1
  186. package/lib/typescript/src/v4/routes/AmitySocialUIKitV4Navigator.d.ts.map +1 -1
  187. package/package.json +3 -3
  188. package/src/snippet/AmityGlobalFeedComponent.tsx +6 -1
  189. package/src/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.tsx +3 -3
  190. package/src/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.tsx +9 -6
  191. package/src/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.tsx +27 -2
  192. package/src/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.tsx +29 -36
  193. package/src/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.tsx +2 -2
  194. package/src/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.tsx +1 -1
  195. package/src/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.tsx +8 -24
  196. package/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.tsx +9 -2
  197. package/src/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.tsx +27 -33
  198. package/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.tsx +1 -0
  199. package/src/v4/assets/icons/lock.tsx +7 -6
  200. package/src/v4/component/CommunityRowItem/CommunityRowItem.tsx +4 -4
  201. package/src/v4/component/Social/CommentList/CommentList.tsx +69 -56
  202. package/src/v4/component/Social/CommentList/styles.ts +12 -0
  203. package/src/v4/component/Social/CommentListItem/CommentListItem.tsx +3 -1
  204. package/src/v4/component/TargetSelectionPage/TargetItem/TargetItem.tsx +3 -0
  205. package/src/v4/component/TargetSelectionPage/TargetSelectionPage.tsx +1 -0
  206. package/src/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +6 -2
  207. package/src/v4/elements/CommunityRowImage/CommunityRowImage.tsx +7 -34
  208. package/src/v4/enum/roomStatus.ts +1 -0
  209. package/src/v4/features/community/Setting/hooks/useCommunitySetting.ts +4 -2
  210. package/src/v4/{component/CommunityCategoryChips/CommunityCategoryChips.tsx → features/feed/components/CommunityCategories/CommunityCategories.tsx} +20 -22
  211. package/src/v4/features/feed/components/CommunityCategories/index.ts +1 -0
  212. package/src/v4/{component/CommunityCategoryChips → features/feed/components/CommunityCategories}/styles.ts +4 -2
  213. package/src/v4/features/feed/components/index.ts +1 -0
  214. package/src/v4/features/feed/elements/CommunityCategory/CommunityCategory.tsx +45 -0
  215. package/src/v4/features/feed/elements/CommunityCategory/index.ts +1 -0
  216. package/src/v4/features/feed/elements/CommunityCategory/styles.ts +20 -0
  217. package/src/v4/features/feed/elements/index.ts +1 -0
  218. package/src/v4/hook/useCustomRankingGlobalFeed.ts +47 -47
  219. package/src/v4/hook/usePaginator.ts +20 -23
  220. package/src/v4/routes/AmitySocialUIKitV4Navigator.tsx +1 -0
  221. package/src/v4/screen/FollowerList/Components/FollowerListItem.tsx +1 -1
  222. package/lib/commonjs/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js +0 -38
  223. package/lib/commonjs/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js.map +0 -1
  224. package/lib/commonjs/v4/component/CommunityCategoryChips/CommunityCategoryChips.js.map +0 -1
  225. package/lib/commonjs/v4/component/CommunityCategoryChips/styles.js.map +0 -1
  226. package/lib/commonjs/v4/elements/CommunityCatetory/CommunityCategory.js +0 -38
  227. package/lib/commonjs/v4/elements/CommunityCatetory/CommunityCategory.js.map +0 -1
  228. package/lib/module/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js +0 -30
  229. package/lib/module/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js.map +0 -1
  230. package/lib/module/v4/component/CommunityCategoryChips/CommunityCategoryChips.js.map +0 -1
  231. package/lib/module/v4/component/CommunityCategoryChips/styles.js.map +0 -1
  232. package/lib/module/v4/elements/CommunityCatetory/CommunityCategory.js +0 -31
  233. package/lib/module/v4/elements/CommunityCatetory/CommunityCategory.js.map +0 -1
  234. package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.d.ts +0 -11
  235. package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.d.ts.map +0 -1
  236. package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChips.d.ts +0 -11
  237. package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChips.d.ts.map +0 -1
  238. package/lib/typescript/src/v4/component/CommunityCategoryChips/styles.d.ts +0 -27
  239. package/lib/typescript/src/v4/component/CommunityCategoryChips/styles.d.ts.map +0 -1
  240. package/lib/typescript/src/v4/elements/CommunityCatetory/CommunityCategory.d.ts +0 -12
  241. package/lib/typescript/src/v4/elements/CommunityCatetory/CommunityCategory.d.ts.map +0 -1
  242. package/src/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.tsx +0 -47
  243. package/src/v4/elements/CommunityCatetory/CommunityCategory.tsx +0 -41
@@ -5,23 +5,42 @@ import AmityGlobalFeedComponent from '../AmityGlobalFeedComponent/AmityGlobalFee
5
5
  import { useStyles } from './styles';
6
6
  import Divider from '../../../component/Divider';
7
7
  import { useAmityComponent } from '../../../hook';
8
+ import { useCustomRankingGlobalFeed } from '../../../hook/useCustomRankingGlobalFeed';
9
+ import NewsFeedLoadingComponent from '../../../component/NewsFeedLoadingComponent/NewsFeedLoadingComponent';
10
+ import AmityEmptyNewsFeedComponent from '../AmityEmptyNewsFeedComponent/AmityEmptyNewsFeedComponent';
8
11
 
9
12
  type AmityNewsFeedComponentType = {
10
13
  pageId?: PageID;
14
+ onPressExploreCommunity?: () => void;
11
15
  };
12
16
 
13
17
  const AmityNewsFeedComponent: FC<AmityNewsFeedComponentType> = ({
14
18
  pageId = PageID.WildCardPage,
19
+ onPressExploreCommunity,
15
20
  }) => {
21
+ const styles = useStyles();
16
22
  const componentId = ComponentID.newsfeed_component;
17
23
  const { themeStyles, accessibilityId, isExcluded } = useAmityComponent({
18
24
  pageId,
19
25
  componentId,
20
26
  });
21
27
 
22
- const styles = useStyles();
28
+ const { itemWithAds, refresh, globalFeedPosts, loading, onNextPage } =
29
+ useCustomRankingGlobalFeed();
30
+
23
31
  if (isExcluded) return null;
24
32
 
33
+ if (loading || (globalFeedPosts?.length > 0 && !itemWithAds?.length))
34
+ return <NewsFeedLoadingComponent />;
35
+
36
+ if (!loading && !globalFeedPosts?.length)
37
+ return (
38
+ <AmityEmptyNewsFeedComponent
39
+ pageId={pageId}
40
+ onPressExploreCommunity={onPressExploreCommunity}
41
+ />
42
+ );
43
+
25
44
  return (
26
45
  <View
27
46
  style={styles.container}
@@ -29,7 +48,13 @@ const AmityNewsFeedComponent: FC<AmityNewsFeedComponentType> = ({
29
48
  accessibilityLabel={accessibilityId}
30
49
  >
31
50
  <Divider themeStyles={themeStyles} />
32
- <AmityGlobalFeedComponent pageId={pageId} />
51
+ <AmityGlobalFeedComponent
52
+ pageId={pageId}
53
+ itemWithAds={itemWithAds}
54
+ refresh={refresh}
55
+ loading={loading}
56
+ onNextPage={onNextPage}
57
+ />
33
58
  </View>
34
59
  );
35
60
  };
@@ -8,7 +8,6 @@ import React, {
8
8
  useCallback,
9
9
  } from 'react';
10
10
  import { UserInterface, IMentionPosition } from '../../../../types';
11
- import { getAmityUser } from '../../../../providers/user-provider';
12
11
  import { CommentRepository } from '@amityco/ts-sdk-react-native';
13
12
  import CommentListItem from './CommentListItem/CommentListItem';
14
13
  import { deleteCommentById } from '../../../../providers/Social/comment-sdk';
@@ -91,9 +90,9 @@ const AmityPostCommentComponent: FC<AmityPostCommentComponentType> = ({
91
90
  referenceType: postType,
92
91
  limit: commentListLimit,
93
92
  },
94
- async ({ loading, data, hasNextPage, onNextPage }) => {
93
+ ({ loading, data, hasNextPage, onNextPage }) => {
95
94
  if (!loading) {
96
- data && data.length > 0 && (await queryComment(data));
95
+ queryComment(data);
97
96
  onNextPageRef.current = hasNextPage ? onNextPage : null;
98
97
  setTimeout(() => {
99
98
  setIsLoading(false);
@@ -102,43 +101,37 @@ const AmityPostCommentComponent: FC<AmityPostCommentComponentType> = ({
102
101
  }
103
102
  );
104
103
  return () => {
105
- setCommentList([]);
106
104
  unsubComment();
107
105
  };
108
106
  }, [postId, postType]);
109
107
 
110
- const queryComment = async (comments: Amity.InternalComment[]) => {
111
- const formattedCommentList = await Promise.all(
112
- comments.map(async (item: Amity.Comment) => {
113
- const { userObject } = await getAmityUser(item.userId);
114
- let formattedUserObject: UserInterface;
115
-
116
- formattedUserObject = {
117
- userId: userObject.data.userId,
118
- displayName: userObject.data.displayName,
119
- avatarFileId: userObject.data?.avatarFileId,
120
- avatarCustomUrl: userObject.data?.avatarCustomUrl,
121
- };
122
-
123
- return {
124
- targetType: item.targetType,
125
- targetId: item.targetId,
126
- commentId: item.commentId,
127
- data: item.data as Record<string, any>,
128
- dataType: item?.dataType || 'text',
129
- myReactions: item.myReactions as string[],
130
- reactions: item.reactions as Record<string, number>,
131
- user: formattedUserObject as UserInterface,
132
- updatedAt: item.updatedAt,
133
- editedAt: item.editedAt,
134
- createdAt: item.createdAt,
135
- childrenComment: item.children,
136
- childrenNumber: item.childrenNumber,
137
- referenceId: item.referenceId,
138
- mentionPosition: item?.metadata?.mentioned ?? [],
139
- };
140
- })
141
- );
108
+ const queryComment = (comments: Amity.InternalComment[]) => {
109
+ const formattedCommentList = comments.map((item: Amity.Comment) => {
110
+ const formattedUserObject = {
111
+ userId: item.creator?.userId,
112
+ displayName: item.creator?.displayName,
113
+ avatarFileId: item.creator?.avatarFileId,
114
+ avatarCustomUrl: item.creator?.avatarCustomUrl,
115
+ };
116
+
117
+ return {
118
+ targetType: item.targetType,
119
+ targetId: item.targetId,
120
+ commentId: item.commentId,
121
+ data: item.data as Record<string, any>,
122
+ dataType: item?.dataType || 'text',
123
+ myReactions: item.myReactions as string[],
124
+ reactions: item.reactions as Record<string, number>,
125
+ user: formattedUserObject as UserInterface,
126
+ updatedAt: item.updatedAt,
127
+ editedAt: item.editedAt,
128
+ createdAt: item.createdAt,
129
+ childrenComment: item.children,
130
+ childrenNumber: item.childrenNumber,
131
+ referenceId: item.referenceId,
132
+ mentionPosition: item?.metadata?.mentioned ?? [],
133
+ };
134
+ });
142
135
  setCommentList([...formattedCommentList]);
143
136
  };
144
137
 
@@ -121,8 +121,8 @@ const DetailStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
121
121
  </Text>
122
122
  )}
123
123
  <Text style={styles.commentCountText}>
124
- {formatNumber(postData?.commentsCount)}{' '}
125
- {renderCommentText(postData?.commentsCount)}
124
+ {formatNumber(postData?.localCommentCount)}{' '}
125
+ {renderCommentText(postData?.localCommentCount)}
126
126
  </Text>
127
127
  </View>
128
128
  <View style={[styles.actionSection, styles.detailActionSection]}>
@@ -129,7 +129,7 @@ const FeedStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
129
129
  height={20}
130
130
  resizeMode="contain"
131
131
  />
132
- <Text style={styles.btnText}>{postData?.commentsCount}</Text>
132
+ <Text style={styles.btnText}>{postData?.localCommentCount}</Text>
133
133
  </TouchableOpacity>
134
134
  </View>
135
135
  <View style={styles.commentBtn} />
@@ -1,7 +1,6 @@
1
- import React, { useEffect } from 'react';
1
+ import React from 'react';
2
2
  import { Image, View } from 'react-native';
3
- import { ComponentID, ImageSizeState, PageID } from '../../../../enum';
4
- import { useFile } from '../../../../hook';
3
+ import { ComponentID, PageID } from '../../../../enum';
5
4
  import { useStyles } from './styles';
6
5
 
7
6
  import CommunityJoinedButton from '../../../../elements/CommunityJoinedButtonElement/CommunityJoinedButtonElement';
@@ -10,9 +9,10 @@ import { SvgXml } from 'react-native-svg';
10
9
  import { community as communityIcon } from '../../../../assets/icons';
11
10
  import CommunityPrivateBadge from '../../../../elements/CommunityPrivateBadge/CommunityPrivateBadge';
12
11
  import CommunityOfficialBadge from '../../../../elements/CommunityOfficialBadge/CommunityOfficialBadge';
13
- import CommunityCategory from '../../../../elements/CommunityCatetory/CommunityCategory';
14
12
  import CommunityMemeberCount from '../../../../elements/CommunityMemeberCount/CommunityMemeberCount';
15
13
  import CommunityDisplayname from '../../../../elements/CommunityDisplayname/CommunityDisplayname';
14
+ import { getFileUrlWithSize } from '../../../../utils';
15
+ import { CommunityCategories } from '../../../../../v4/features/feed/components';
16
16
 
17
17
  type RecommendedCommunityItemProps = {
18
18
  pageId?: PageID;
@@ -22,31 +22,15 @@ type RecommendedCommunityItemProps = {
22
22
  export const RecommendedCommunityItem: React.FC<
23
23
  RecommendedCommunityItemProps
24
24
  > = ({ community, pageId = PageID.WildCardPage }) => {
25
- const { getImage } = useFile();
26
25
  const componentId = ComponentID.recommended_communities;
27
26
  const styles = useStyles();
28
- const [imageUrl, setImageUrl] = React.useState<string | undefined>(undefined);
29
-
30
- useEffect(() => {
31
- const fetchImage = async () => {
32
- if (!community.avatarFileId) return;
33
-
34
- const url = await getImage({
35
- fileId: community.avatarFileId,
36
- imageSize: ImageSizeState.large,
37
- });
38
-
39
- setImageUrl(url);
40
- };
41
- fetchImage();
42
- }, [community.avatarFileId, getImage]);
43
27
 
44
28
  return (
45
29
  <View style={styles.container}>
46
- {community.avatarFileId && imageUrl ? (
30
+ {community.avatar?.fileUrl ? (
47
31
  <Image
48
32
  style={styles.image}
49
- source={{ uri: imageUrl }}
33
+ source={{ uri: getFileUrlWithSize(community.avatar?.fileUrl) }}
50
34
  resizeMode="cover"
51
35
  />
52
36
  ) : (
@@ -72,8 +56,8 @@ export const RecommendedCommunityItem: React.FC<
72
56
  </View>
73
57
  <View style={styles.detailBottomWrap}>
74
58
  <View style={styles.detailBottomWrapLeft}>
75
- <CommunityCategory
76
- categoryIds={community.categoryIds}
59
+ <CommunityCategories
60
+ categories={community.categories}
77
61
  pageId={pageId}
78
62
  componentId={componentId}
79
63
  />
@@ -69,6 +69,9 @@ const AmityCommunityProfilePage: React.FC<ICommunityProfilePage> = ({
69
69
 
70
70
  const animatedOpacity = useRef(new Animated.Value(0)).current;
71
71
  const animatedTranslateY = useRef(new Animated.Value(15)).current;
72
+ const stickyHeaderAnimation = useRef<Animated.CompositeAnimation | null>(
73
+ null
74
+ );
72
75
 
73
76
  const scrollY = useRef(new Animated.Value(0)).current;
74
77
  const feedRef = useRef<AmityCommunityFeedRef>(null);
@@ -94,7 +97,7 @@ const AmityCommunityProfilePage: React.FC<ICommunityProfilePage> = ({
94
97
  animatedTranslateY.setValue(15);
95
98
 
96
99
  // Run entrance animation
97
- Animated.parallel([
100
+ stickyHeaderAnimation.current = Animated.parallel([
98
101
  Animated.timing(animatedOpacity, {
99
102
  toValue: 1,
100
103
  duration: 200,
@@ -106,8 +109,12 @@ const AmityCommunityProfilePage: React.FC<ICommunityProfilePage> = ({
106
109
  easing: Easing.out(Easing.ease),
107
110
  useNativeDriver: true,
108
111
  }),
109
- ]).start();
112
+ ]);
113
+ stickyHeaderAnimation.current.start();
110
114
  }
115
+ return () => {
116
+ stickyHeaderAnimation.current?.stop();
117
+ };
111
118
  }, [isScrolledPastHeader, animatedOpacity, animatedTranslateY]);
112
119
 
113
120
  const handleLoadMore = useCallback(() => {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { useCallback, useState } from 'react';
3
- import { LogBox, SafeAreaView, StyleSheet } from 'react-native';
2
+ import { useCallback, useRef, useState } from 'react';
3
+ import { SafeAreaView, StyleSheet, View } from 'react-native';
4
4
  import CustomSocialTab from '../../../../v4/component/CustomSocialTab/CustomSocialTab';
5
5
  import { useUiKitConfig } from '../../../../v4/hook';
6
6
  import {
@@ -12,15 +12,11 @@ import {
12
12
  import { useTheme } from 'react-native-paper';
13
13
  import { useBehaviour } from '../../../../v4/providers/BehaviourProvider';
14
14
  import AmitySocialHomeTopNavigationComponent from '../../../../v4/PublicApi/Components/AmitySocialHomeTopNavigationComponent/AmitySocialHomeTopNavigationComponent';
15
- import AmityEmptyNewsFeedComponent from '../../../../v4/PublicApi/Components/AmityEmptyNewsFeedComponent/AmityEmptyNewsFeedComponent';
16
15
  import AmityMyCommunitiesComponent from '../../../../v4/PublicApi/Components/AmityMyCommunitiesComponent/AmityMyCommunitiesComponent';
17
16
  import AmityNewsFeedComponent from '../../../../v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent';
18
17
  import AmityExploreComponent from '../../../../v4/PublicApi/Components/AmityExploreComponent/AmityExploreComponent';
19
- import NewsFeedLoadingComponent from '../../../../v4/component/NewsFeedLoadingComponent/NewsFeedLoadingComponent';
20
- import { useCustomRankingGlobalFeed } from '../../../../v4/hook/useCustomRankingGlobalFeed';
21
18
  import { MyMD3Theme } from '../../../../providers/amity-ui-kit-provider';
22
19
 
23
- LogBox.ignoreAllLogs(true);
24
20
  const AmitySocialHomePage = () => {
25
21
  const theme = useTheme() as MyMD3Theme;
26
22
  const styles = StyleSheet.create({
@@ -31,8 +27,6 @@ const AmitySocialHomePage = () => {
31
27
  });
32
28
 
33
29
  const { AmitySocialHomePageBehaviour } = useBehaviour();
34
- const { itemWithAds: globalFeedPosts, loading } =
35
- useCustomRankingGlobalFeed();
36
30
 
37
31
  const [newsFeedTab] = useUiKitConfig({
38
32
  page: PageID.social_home_page,
@@ -56,11 +50,13 @@ const AmitySocialHomePage = () => {
56
50
  }) as string[];
57
51
 
58
52
  const [activeTab, setActiveTab] = useState<string>(newsFeedTab);
53
+ const visitedTabs = useRef<Set<string>>(new Set([newsFeedTab]));
59
54
 
60
55
  const onTabChange = useCallback(
61
56
  (tabName: string) => {
62
57
  if (AmitySocialHomePageBehaviour.onChooseTab)
63
58
  return AmitySocialHomePageBehaviour.onChooseTab(tabName);
59
+ visitedTabs.current.add(tabName);
64
60
  setActiveTab(tabName);
65
61
  },
66
62
  [AmitySocialHomePageBehaviour]
@@ -70,30 +66,10 @@ const AmitySocialHomePage = () => {
70
66
  onTabChange(exploreTab);
71
67
  }, [exploreTab, onTabChange]);
72
68
 
73
- const renderNewsFeed = () => {
74
- if (loading) return <NewsFeedLoadingComponent />;
75
- if (activeTab === exploreTab)
76
- return <AmityExploreComponent pageId={PageID.social_home_page} />;
77
-
78
- if (activeTab === newsFeedTab) {
79
- if (!loading && globalFeedPosts?.length === 0)
80
- return (
81
- <AmityEmptyNewsFeedComponent
82
- pageId={PageID.social_home_page}
83
- onPressExploreCommunity={onPressExploreCommunity}
84
- />
85
- );
86
- return <AmityNewsFeedComponent pageId={PageID.social_home_page} />;
87
- }
88
- if (activeTab === myCommunitiesTab)
89
- return (
90
- <AmityMyCommunitiesComponent
91
- pageId={PageID.social_home_page}
92
- componentId={ComponentID.my_communities}
93
- />
94
- );
95
- return null;
96
- };
69
+ const tabStyle = (tab: string) => ({
70
+ flex: 1,
71
+ display: activeTab === tab ? ('flex' as const) : ('none' as const),
72
+ });
97
73
 
98
74
  return (
99
75
  <SafeAreaView
@@ -108,7 +84,25 @@ const AmitySocialHomePage = () => {
108
84
  onTabChange={onTabChange}
109
85
  activeTab={activeTab}
110
86
  />
111
- {renderNewsFeed()}
87
+ <View style={tabStyle(newsFeedTab)}>
88
+ <AmityNewsFeedComponent
89
+ pageId={PageID.social_home_page}
90
+ onPressExploreCommunity={onPressExploreCommunity}
91
+ />
92
+ </View>
93
+ {visitedTabs.current.has(exploreTab) && (
94
+ <View style={tabStyle(exploreTab)}>
95
+ <AmityExploreComponent pageId={PageID.social_home_page} />
96
+ </View>
97
+ )}
98
+ {visitedTabs.current.has(myCommunitiesTab) && (
99
+ <View style={tabStyle(myCommunitiesTab)}>
100
+ <AmityMyCommunitiesComponent
101
+ pageId={PageID.social_home_page}
102
+ componentId={ComponentID.my_communities}
103
+ />
104
+ </View>
105
+ )}
112
106
  </SafeAreaView>
113
107
  );
114
108
  };
@@ -595,6 +595,7 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
595
595
  <CommentList
596
596
  postId={currentStory?.storyId}
597
597
  postType="story"
598
+ disabledComment={!communityData?.allowCommentInStory}
598
599
  disabledInteraction={!communityData?.isJoined}
599
600
  onNavigate={onClose}
600
601
  />
@@ -1,9 +1,10 @@
1
- export const icon = (
2
- color: string = '#292B32'
3
- ) => `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
4
- <path d="M10 14.1562C9.625 14.1562 9.34375 13.875 9.34375 13.5V12C9.34375 11.6484 9.625 11.3438 10 11.3438C10.3516 11.3438 10.6562 11.6484 10.6562 12V13.5C10.6562 13.875 10.3516 14.1562 10 14.1562ZM15.25 10.125V15.375C15.25 16.0078 14.7344 16.5 14.125 16.5H5.875C5.24219 16.5 4.75 16.0078 4.75 15.375V10.125C4.75 9.51562 5.24219 9 5.875 9H6.625V7.875C6.625 6.02344 8.125 4.5 10 4.5C11.875 4.52344 13.375 6.04688 13.375 7.92188V9H14.125C14.7344 9 15.25 9.51562 15.25 10.125ZM7.75 9H12.25V7.875C12.25 6.65625 11.2188 5.625 10 5.625C8.75781 5.625 7.75 6.65625 7.75 7.875V9ZM14.125 10.125H5.875V15.375H14.125V10.125Z" fill="${color}"/>
5
- </svg>
6
-
1
+ export const icon =
2
+ () => `<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20">
3
+ <path
4
+ fill="currentColor"
5
+ d="M15.5 8c.813 0 1.5.688 1.5 1.5v7a1.5 1.5 0 01-1.5 1.5h-11A1.48 1.48 0 013 16.5v-7A1.5 1.5 0 014.5 8h1V6.5C5.5 4.031 7.5 2 10 2c2.5.031 4.5 2.063 4.5 4.563V8h1zM7 6.5V8h6V6.5c0-1.625-1.375-3-3-3-1.656 0-3 1.375-3 3zm8.5 10v-7h-11v7h11z"
6
+ ></path>
7
+ </svg>
7
8
  `;
8
9
 
9
10
  export default icon;
@@ -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;