@amityco/react-native-social-uikit 4.0.0-RC17 → 4.0.0-RC19

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 (223) 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/AmitySocialHomePage/AmitySocialHomePage.js +21 -29
  20. package/lib/commonjs/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js.map +1 -1
  21. package/lib/commonjs/v4/component/Avatar/Avatar.js +5 -3
  22. package/lib/commonjs/v4/component/Avatar/Avatar.js.map +1 -1
  23. package/lib/commonjs/v4/component/CommunityRowItem/CommunityRowItem.js +5 -4
  24. package/lib/commonjs/v4/component/CommunityRowItem/CommunityRowItem.js.map +1 -1
  25. package/lib/commonjs/v4/component/Social/CommentList/CommentList.js +8 -12
  26. package/lib/commonjs/v4/component/Social/CommentList/CommentList.js.map +1 -1
  27. package/lib/commonjs/v4/component/TargetSelectionPage/TargetItem/TargetItem.js +4 -2
  28. package/lib/commonjs/v4/component/TargetSelectionPage/TargetItem/TargetItem.js.map +1 -1
  29. package/lib/commonjs/v4/component/TargetSelectionPage/TargetSelectionPage.js +22 -2
  30. package/lib/commonjs/v4/component/TargetSelectionPage/TargetSelectionPage.js.map +1 -1
  31. package/lib/commonjs/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +8 -3
  32. package/lib/commonjs/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  33. package/lib/commonjs/v4/elements/CommunityRowImage/CommunityRowImage.js +4 -32
  34. package/lib/commonjs/v4/elements/CommunityRowImage/CommunityRowImage.js.map +1 -1
  35. package/lib/commonjs/v4/features/community/Membership/components/MemberItem/MemberItem.js +2 -1
  36. package/lib/commonjs/v4/features/community/Membership/components/MemberItem/MemberItem.js.map +1 -1
  37. package/lib/commonjs/v4/features/community/Setting/hooks/useCommunitySetting.js +6 -3
  38. package/lib/commonjs/v4/features/community/Setting/hooks/useCommunitySetting.js.map +1 -1
  39. package/lib/commonjs/v4/{component/CommunityCategoryChips/CommunityCategoryChips.js → features/feed/components/CommunityCategories/CommunityCategories.js} +19 -21
  40. package/lib/commonjs/v4/features/feed/components/CommunityCategories/CommunityCategories.js.map +1 -0
  41. package/lib/commonjs/v4/features/feed/components/CommunityCategories/index.js +13 -0
  42. package/lib/commonjs/v4/features/feed/components/CommunityCategories/index.js.map +1 -0
  43. package/lib/commonjs/v4/{component/CommunityCategoryChips → features/feed/components/CommunityCategories}/styles.js +7 -2
  44. package/lib/commonjs/v4/features/feed/components/CommunityCategories/styles.js.map +1 -0
  45. package/lib/commonjs/v4/features/feed/components/index.js +17 -0
  46. package/lib/commonjs/v4/features/feed/components/index.js.map +1 -0
  47. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/CommunityCategory.js +42 -0
  48. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/CommunityCategory.js.map +1 -0
  49. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/index.js +13 -0
  50. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/index.js.map +1 -0
  51. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/styles.js +29 -0
  52. package/lib/commonjs/v4/features/feed/elements/CommunityCategory/styles.js.map +1 -0
  53. package/lib/commonjs/v4/features/feed/elements/index.js +17 -0
  54. package/lib/commonjs/v4/features/feed/elements/index.js.map +1 -0
  55. package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js +33 -38
  56. package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
  57. package/lib/commonjs/v4/hook/usePaginator.js +11 -16
  58. package/lib/commonjs/v4/hook/usePaginator.js.map +1 -1
  59. package/lib/commonjs/v4/hook/usePostPermission.js +38 -0
  60. package/lib/commonjs/v4/hook/usePostPermission.js.map +1 -0
  61. package/lib/commonjs/v4/routes/AmitySocialUIKitV4Navigator.js +1 -0
  62. package/lib/commonjs/v4/routes/AmitySocialUIKitV4Navigator.js.map +1 -1
  63. package/lib/commonjs/v4/screen/FollowerList/Components/FollowerListItem.js +1 -1
  64. package/lib/commonjs/v4/screen/FollowerList/Components/FollowerListItem.js.map +1 -1
  65. package/lib/module/snippet/AmityGlobalFeedComponent.js +6 -1
  66. package/lib/module/snippet/AmityGlobalFeedComponent.js.map +1 -1
  67. package/lib/module/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.js +3 -3
  68. package/lib/module/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.js.map +1 -1
  69. package/lib/module/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.js +6 -8
  70. package/lib/module/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.js.map +1 -1
  71. package/lib/module/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.js +23 -3
  72. package/lib/module/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.js.map +1 -1
  73. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js +11 -17
  74. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js.map +1 -1
  75. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js +1 -1
  76. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js.map +1 -1
  77. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js +1 -1
  78. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js.map +1 -1
  79. package/lib/module/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.js +9 -23
  80. package/lib/module/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.js.map +1 -1
  81. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +13 -3
  82. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
  83. package/lib/module/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js +23 -31
  84. package/lib/module/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js.map +1 -1
  85. package/lib/module/v4/component/Avatar/Avatar.js +5 -3
  86. package/lib/module/v4/component/Avatar/Avatar.js.map +1 -1
  87. package/lib/module/v4/component/CommunityRowItem/CommunityRowItem.js +5 -4
  88. package/lib/module/v4/component/CommunityRowItem/CommunityRowItem.js.map +1 -1
  89. package/lib/module/v4/component/Social/CommentList/CommentList.js +8 -12
  90. package/lib/module/v4/component/Social/CommentList/CommentList.js.map +1 -1
  91. package/lib/module/v4/component/TargetSelectionPage/TargetItem/TargetItem.js +4 -2
  92. package/lib/module/v4/component/TargetSelectionPage/TargetItem/TargetItem.js.map +1 -1
  93. package/lib/module/v4/component/TargetSelectionPage/TargetSelectionPage.js +22 -2
  94. package/lib/module/v4/component/TargetSelectionPage/TargetSelectionPage.js.map +1 -1
  95. package/lib/module/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +8 -3
  96. package/lib/module/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  97. package/lib/module/v4/elements/CommunityRowImage/CommunityRowImage.js +6 -34
  98. package/lib/module/v4/elements/CommunityRowImage/CommunityRowImage.js.map +1 -1
  99. package/lib/module/v4/features/community/Membership/components/MemberItem/MemberItem.js +2 -1
  100. package/lib/module/v4/features/community/Membership/components/MemberItem/MemberItem.js.map +1 -1
  101. package/lib/module/v4/features/community/Setting/hooks/useCommunitySetting.js +6 -3
  102. package/lib/module/v4/features/community/Setting/hooks/useCommunitySetting.js.map +1 -1
  103. package/lib/module/v4/{component/CommunityCategoryChips/CommunityCategoryChips.js → features/feed/components/CommunityCategories/CommunityCategories.js} +18 -19
  104. package/lib/module/v4/features/feed/components/CommunityCategories/CommunityCategories.js.map +1 -0
  105. package/lib/module/v4/features/feed/components/CommunityCategories/index.js +2 -0
  106. package/lib/module/v4/features/feed/components/CommunityCategories/index.js.map +1 -0
  107. package/lib/module/v4/{component/CommunityCategoryChips → features/feed/components/CommunityCategories}/styles.js +7 -2
  108. package/lib/module/v4/features/feed/components/CommunityCategories/styles.js.map +1 -0
  109. package/lib/module/v4/features/feed/components/index.js +2 -0
  110. package/lib/module/v4/features/feed/components/index.js.map +1 -0
  111. package/lib/module/v4/features/feed/elements/CommunityCategory/CommunityCategory.js +35 -0
  112. package/lib/module/v4/features/feed/elements/CommunityCategory/CommunityCategory.js.map +1 -0
  113. package/lib/module/v4/features/feed/elements/CommunityCategory/index.js +2 -0
  114. package/lib/module/v4/features/feed/elements/CommunityCategory/index.js.map +1 -0
  115. package/lib/module/v4/features/feed/elements/CommunityCategory/styles.js +22 -0
  116. package/lib/module/v4/features/feed/elements/CommunityCategory/styles.js.map +1 -0
  117. package/lib/module/v4/features/feed/elements/index.js +2 -0
  118. package/lib/module/v4/features/feed/elements/index.js.map +1 -0
  119. package/lib/module/v4/hook/useCustomRankingGlobalFeed.js +34 -39
  120. package/lib/module/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
  121. package/lib/module/v4/hook/usePaginator.js +12 -17
  122. package/lib/module/v4/hook/usePaginator.js.map +1 -1
  123. package/lib/module/v4/hook/usePostPermission.js +31 -0
  124. package/lib/module/v4/hook/usePostPermission.js.map +1 -0
  125. package/lib/module/v4/routes/AmitySocialUIKitV4Navigator.js +1 -0
  126. package/lib/module/v4/routes/AmitySocialUIKitV4Navigator.js.map +1 -1
  127. package/lib/module/v4/screen/FollowerList/Components/FollowerListItem.js +1 -1
  128. package/lib/module/v4/screen/FollowerList/Components/FollowerListItem.js.map +1 -1
  129. package/lib/typescript/src/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.d.ts +4 -0
  130. package/lib/typescript/src/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.d.ts.map +1 -1
  131. package/lib/typescript/src/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.d.ts +1 -0
  132. package/lib/typescript/src/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.d.ts.map +1 -1
  133. package/lib/typescript/src/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.d.ts.map +1 -1
  134. package/lib/typescript/src/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.d.ts.map +1 -1
  135. package/lib/typescript/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.d.ts.map +1 -1
  136. package/lib/typescript/src/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.d.ts.map +1 -1
  137. package/lib/typescript/src/v4/component/Avatar/Avatar.d.ts.map +1 -1
  138. package/lib/typescript/src/v4/component/Social/CommentList/CommentList.d.ts.map +1 -1
  139. package/lib/typescript/src/v4/component/TargetSelectionPage/TargetItem/TargetItem.d.ts +2 -1
  140. package/lib/typescript/src/v4/component/TargetSelectionPage/TargetItem/TargetItem.d.ts.map +1 -1
  141. package/lib/typescript/src/v4/component/TargetSelectionPage/TargetSelectionPage.d.ts.map +1 -1
  142. package/lib/typescript/src/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.d.ts.map +1 -1
  143. package/lib/typescript/src/v4/elements/CommunityRowImage/CommunityRowImage.d.ts +1 -1
  144. package/lib/typescript/src/v4/elements/CommunityRowImage/CommunityRowImage.d.ts.map +1 -1
  145. package/lib/typescript/src/v4/features/community/Membership/components/MemberItem/MemberItem.d.ts.map +1 -1
  146. package/lib/typescript/src/v4/features/community/Setting/hooks/useCommunitySetting.d.ts.map +1 -1
  147. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/CommunityCategories.d.ts +12 -0
  148. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/CommunityCategories.d.ts.map +1 -0
  149. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/index.d.ts +2 -0
  150. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/index.d.ts.map +1 -0
  151. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/styles.d.ts +30 -0
  152. package/lib/typescript/src/v4/features/feed/components/CommunityCategories/styles.d.ts.map +1 -0
  153. package/lib/typescript/src/v4/features/feed/components/index.d.ts +2 -0
  154. package/lib/typescript/src/v4/features/feed/components/index.d.ts.map +1 -0
  155. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/CommunityCategory.d.ts +12 -0
  156. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/CommunityCategory.d.ts.map +1 -0
  157. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/index.d.ts +2 -0
  158. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/index.d.ts.map +1 -0
  159. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/styles.d.ts +17 -0
  160. package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/styles.d.ts.map +1 -0
  161. package/lib/typescript/src/v4/features/feed/elements/index.d.ts +2 -0
  162. package/lib/typescript/src/v4/features/feed/elements/index.d.ts.map +1 -0
  163. package/lib/typescript/src/v4/hook/useCustomRankingGlobalFeed.d.ts +6 -1
  164. package/lib/typescript/src/v4/hook/useCustomRankingGlobalFeed.d.ts.map +1 -1
  165. package/lib/typescript/src/v4/hook/usePaginator.d.ts.map +1 -1
  166. package/lib/typescript/src/v4/hook/usePostPermission.d.ts +6 -0
  167. package/lib/typescript/src/v4/hook/usePostPermission.d.ts.map +1 -0
  168. package/lib/typescript/src/v4/routes/AmitySocialUIKitV4Navigator.d.ts.map +1 -1
  169. package/package.json +3 -3
  170. package/src/snippet/AmityGlobalFeedComponent.tsx +6 -1
  171. package/src/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.tsx +3 -3
  172. package/src/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.tsx +9 -6
  173. package/src/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.tsx +27 -2
  174. package/src/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.tsx +29 -36
  175. package/src/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.tsx +2 -2
  176. package/src/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.tsx +1 -1
  177. package/src/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.tsx +8 -24
  178. package/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.tsx +13 -3
  179. package/src/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.tsx +27 -33
  180. package/src/v4/component/Avatar/Avatar.tsx +5 -2
  181. package/src/v4/component/CommunityRowItem/CommunityRowItem.tsx +4 -4
  182. package/src/v4/component/Social/CommentList/CommentList.tsx +25 -29
  183. package/src/v4/component/TargetSelectionPage/TargetItem/TargetItem.tsx +3 -0
  184. package/src/v4/component/TargetSelectionPage/TargetSelectionPage.tsx +23 -1
  185. package/src/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +6 -2
  186. package/src/v4/elements/CommunityRowImage/CommunityRowImage.tsx +7 -34
  187. package/src/v4/features/community/Membership/components/MemberItem/MemberItem.tsx +1 -0
  188. package/src/v4/features/community/Setting/hooks/useCommunitySetting.ts +4 -2
  189. package/src/v4/{component/CommunityCategoryChips/CommunityCategoryChips.tsx → features/feed/components/CommunityCategories/CommunityCategories.tsx} +20 -22
  190. package/src/v4/features/feed/components/CommunityCategories/index.ts +1 -0
  191. package/src/v4/{component/CommunityCategoryChips → features/feed/components/CommunityCategories}/styles.ts +4 -2
  192. package/src/v4/features/feed/components/index.ts +1 -0
  193. package/src/v4/features/feed/elements/CommunityCategory/CommunityCategory.tsx +45 -0
  194. package/src/v4/features/feed/elements/CommunityCategory/index.ts +1 -0
  195. package/src/v4/features/feed/elements/CommunityCategory/styles.ts +20 -0
  196. package/src/v4/features/feed/elements/index.ts +1 -0
  197. package/src/v4/hook/useCustomRankingGlobalFeed.ts +47 -47
  198. package/src/v4/hook/usePaginator.ts +20 -23
  199. package/src/v4/hook/usePostPermission.ts +46 -0
  200. package/src/v4/routes/AmitySocialUIKitV4Navigator.tsx +1 -0
  201. package/src/v4/screen/FollowerList/Components/FollowerListItem.tsx +1 -1
  202. package/lib/commonjs/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js +0 -38
  203. package/lib/commonjs/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js.map +0 -1
  204. package/lib/commonjs/v4/component/CommunityCategoryChips/CommunityCategoryChips.js.map +0 -1
  205. package/lib/commonjs/v4/component/CommunityCategoryChips/styles.js.map +0 -1
  206. package/lib/commonjs/v4/elements/CommunityCatetory/CommunityCategory.js +0 -38
  207. package/lib/commonjs/v4/elements/CommunityCatetory/CommunityCategory.js.map +0 -1
  208. package/lib/module/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js +0 -30
  209. package/lib/module/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js.map +0 -1
  210. package/lib/module/v4/component/CommunityCategoryChips/CommunityCategoryChips.js.map +0 -1
  211. package/lib/module/v4/component/CommunityCategoryChips/styles.js.map +0 -1
  212. package/lib/module/v4/elements/CommunityCatetory/CommunityCategory.js +0 -31
  213. package/lib/module/v4/elements/CommunityCatetory/CommunityCategory.js.map +0 -1
  214. package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.d.ts +0 -11
  215. package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.d.ts.map +0 -1
  216. package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChips.d.ts +0 -11
  217. package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChips.d.ts.map +0 -1
  218. package/lib/typescript/src/v4/component/CommunityCategoryChips/styles.d.ts +0 -27
  219. package/lib/typescript/src/v4/component/CommunityCategoryChips/styles.d.ts.map +0 -1
  220. package/lib/typescript/src/v4/elements/CommunityCatetory/CommunityCategory.d.ts +0 -12
  221. package/lib/typescript/src/v4/elements/CommunityCatetory/CommunityCategory.d.ts.map +0 -1
  222. package/src/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.tsx +0 -47
  223. package/src/v4/elements/CommunityCatetory/CommunityCategory.tsx +0 -41
@@ -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
  />
@@ -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';
@@ -1,5 +1,9 @@
1
- import { FeedRepository, PostRepository } from '@amityco/ts-sdk-react-native';
1
+ import {
2
+ FeedRepository,
3
+ PostStructureType,
4
+ } from '@amityco/ts-sdk-react-native';
2
5
  import { useCallback, useEffect, useRef, useState } from 'react';
6
+ import { InteractionManager } from 'react-native';
3
7
  import globalFeedSlice from '../../redux/slices/globalfeedSlice';
4
8
  import { globalFeedPageLimit } from '../../v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent';
5
9
  import {
@@ -17,11 +21,18 @@ export const isAmityAd = (
17
21
  return (item as Amity.Ad)?.adId !== undefined;
18
22
  };
19
23
 
20
- export const useCustomRankingGlobalFeed = () => {
24
+ type UseCustomRankingGlobalFeed = {
25
+ enabled?: boolean;
26
+ };
27
+
28
+ export const useCustomRankingGlobalFeed = ({
29
+ enabled = true,
30
+ }: UseCustomRankingGlobalFeed = {}) => {
21
31
  const { isConnected } = useAuth();
22
32
  const dispatch = useUIKitDispatch();
23
33
  const unsubscribeRef = useRef<() => void | null>(null);
24
34
  const onNextPageRef = useRef<() => void | null>(null);
35
+ const interactionHandleRef = useRef<{ cancel: () => void } | null>(null);
25
36
 
26
37
  const { setNewGlobalFeed } = globalFeedSlice.actions;
27
38
 
@@ -39,69 +50,57 @@ export const useCustomRankingGlobalFeed = () => {
39
50
  getItemId: (item) => (item as Amity.Post).postId.toString(),
40
51
  });
41
52
 
42
- const processPosts = async (posts: Amity.Post[]) => {
43
- const results = await Promise.all(
44
- posts.map((post) => {
45
- if (post?.children.length > 0) {
46
- return new Promise((resolve) => {
47
- const unsubscribe = PostRepository.getPost(
48
- post?.children[0],
49
- ({ error: $error, loading, data }) => {
50
- if (!$error && !loading) {
51
- if (
52
- data?.dataType === 'image' ||
53
- data?.dataType === 'video' ||
54
- data?.dataType === 'room' ||
55
- data?.dataType === 'poll'
56
- ) {
57
- resolve(post);
58
- } else {
59
- resolve(null);
60
- }
61
- } else {
62
- resolve(null);
63
- }
64
- }
65
- );
66
-
67
- unsubscribe();
68
- });
69
- } else {
70
- return post;
71
- }
72
- })
73
- );
74
-
75
- return results.filter((result) => result !== null) as Amity.Post<any>[];
76
- };
77
-
78
53
  const fetchCustomRanking = useCallback(() => {
79
54
  if (!isConnected) return null;
80
55
 
81
- return FeedRepository.getCustomRankingGlobalFeed(
56
+ return FeedRepository.getGlobalFeed(
82
57
  { limit: globalFeedPageLimit },
83
- ({ data, loading, error: $error, onNextPage }) => {
84
- setFetching(loading);
85
-
86
- if (!loading && data) {
87
- processPosts(data).then((posts) => dispatch(setNewGlobalFeed(posts)));
58
+ ({ data, loading: isLoading, error: $error, onNextPage }) => {
59
+ if (isLoading) {
60
+ setFetching(true);
61
+ return;
88
62
  }
89
63
 
90
64
  if (onNextPage) onNextPageRef.current = onNextPage;
91
-
92
65
  if ($error) setError($error);
66
+
67
+ if (data) {
68
+ const filtered = data.filter(
69
+ (post) =>
70
+ post.structureType !== PostStructureType.AUDIO &&
71
+ post.structureType !== PostStructureType.FILE &&
72
+ post.structureType !== PostStructureType.MIXED
73
+ );
74
+ interactionHandleRef.current?.cancel();
75
+ interactionHandleRef.current =
76
+ InteractionManager.runAfterInteractions(() => {
77
+ dispatch(setNewGlobalFeed(filtered));
78
+ setFetching(false);
79
+ interactionHandleRef.current = null;
80
+ });
81
+ } else {
82
+ setFetching(false);
83
+ }
93
84
  }
94
85
  );
95
86
  }, [dispatch, setNewGlobalFeed, isConnected]);
96
87
 
97
88
  useEffect(() => {
89
+ if (!enabled) return undefined;
90
+
98
91
  unsubscribeRef.current = fetchCustomRanking();
99
92
 
100
- return () => unsubscribeRef.current?.();
101
- }, [fetchCustomRanking]);
93
+ return () => {
94
+ unsubscribeRef.current?.();
95
+ interactionHandleRef.current?.cancel();
96
+ interactionHandleRef.current = null;
97
+ };
98
+ }, [fetchCustomRanking, enabled]);
102
99
 
103
100
  const refresh = useCallback(() => {
104
101
  if (unsubscribeRef.current) unsubscribeRef.current?.();
102
+ interactionHandleRef.current?.cancel();
103
+ interactionHandleRef.current = null;
105
104
  onNextPageRef.current = null;
106
105
 
107
106
  unsubscribeRef.current = fetchCustomRanking();
@@ -113,5 +112,6 @@ export const useCustomRankingGlobalFeed = () => {
113
112
  itemWithAds,
114
113
  onNextPage: onNextPageRef.current,
115
114
  error,
115
+ globalFeedPosts: postList,
116
116
  };
117
117
  };
@@ -1,10 +1,9 @@
1
- import { useCallback, useEffect, useRef, useState } from 'react';
1
+ import { useCallback, useEffect, useRef, useState, useTransition } from 'react';
2
2
  import { AdEngine } from '../engine/AdEngine';
3
3
  import {
4
4
  useAdSettings,
5
5
  useRecommendAds,
6
6
  } from '../../v4/providers/AdEngineProvider';
7
- import { useFocusEffect } from '@react-navigation/native';
8
7
 
9
8
  type ItemWithAd<T> = [T] | [T, Amity.Ad];
10
9
 
@@ -41,21 +40,19 @@ export const usePaginatorCore = <T>({
41
40
  newItems: T[],
42
41
  newItemIds: Set<string>
43
42
  ): Array<ItemWithAd<T>> => {
43
+ const newItemsMap = new Map<string, T>(
44
+ newItems.map((item) => [getItemId(item), item])
45
+ );
44
46
  return (itemWithAdsRef.current || [])
45
47
  .map((itemWithAd) => {
46
48
  const itemId = getItemId(itemWithAd[0]);
47
49
 
48
- // Skip items not in new items list
49
50
  if (!newItemIds.has(itemId)) {
50
51
  return null;
51
52
  }
52
53
 
53
- // Find the updated version of this item
54
- const updatedItem = newItems.find(
55
- (newItem) => getItemId(newItem) === itemId
56
- );
54
+ const updatedItem = newItemsMap.get(itemId);
57
55
 
58
- // Update the item while preserving its ad (if any)
59
56
  if (updatedItem) {
60
57
  if (itemWithAd.length === 1) {
61
58
  return [updatedItem] as [T];
@@ -86,13 +83,14 @@ export const usePaginatorCore = <T>({
86
83
  topIndex: number,
87
84
  prevItems: Array<ItemWithAd<T>>
88
85
  ): T[] => {
89
- return newItems.slice(topIndex).filter((newItem) => {
90
- const itemId = getItemId(newItem);
91
- return !prevItems.some(
92
- (prevItem) =>
93
- prevItem && prevItem[0] && getItemId(prevItem[0]) === itemId
94
- );
95
- });
86
+ const prevItemIds = new Set<string>(
87
+ prevItems
88
+ .filter((item) => item && item[0])
89
+ .map((item) => getItemId(item[0]))
90
+ );
91
+ return newItems
92
+ .slice(topIndex)
93
+ .filter((newItem) => !prevItemIds.has(getItemId(newItem)));
96
94
  };
97
95
 
98
96
  const frequency = AdEngine.instance.getAdFrequencyByPlacement(placement);
@@ -256,6 +254,7 @@ export const usePaginatorApi = <T>(params: {
256
254
  const [itemWithAds, setItemWithAds] = useState<
257
255
  (Amity.Ad | T)[] | undefined
258
256
  >();
257
+ const [_, startTransition] = useTransition();
259
258
 
260
259
  const { items, isLoading, ...rest } = params;
261
260
  const {
@@ -275,16 +274,14 @@ export const usePaginatorApi = <T>(params: {
275
274
  setHasAppenedFirstRoundAds(false);
276
275
  }, [coreReset]);
277
276
 
278
- useFocusEffect(
279
- useCallback(() => {
280
- if (!adsLoaded || isLoading) return;
281
-
277
+ useEffect(() => {
278
+ if (!adsLoaded || isLoading) return;
279
+ startTransition(() => {
282
280
  const newItems = combineItemsWithAds(items);
283
-
284
281
  setItemWithAds(newItems);
285
- // eslint-disable-next-line react-hooks/exhaustive-deps
286
- }, [adsLoaded, items, isLoading])
287
- );
282
+ });
283
+ // eslint-disable-next-line react-hooks/exhaustive-deps
284
+ }, [adsLoaded, items, isLoading]);
288
285
 
289
286
  return { itemWithAds, reset };
290
287
  };
@@ -0,0 +1,46 @@
1
+ import {
2
+ CommunityPostSettings,
3
+ CommunityRepository,
4
+ } from '@amityco/ts-sdk-react-native';
5
+ import { useEffect, useState } from 'react';
6
+ import useAuth from '../../hooks/useAuth';
7
+ import { isModerator } from '../utils/permissions';
8
+
9
+ type UsePostPermissionParams = {
10
+ community?: Amity.Community;
11
+ };
12
+
13
+ export function usePostPermission({ community }: UsePostPermissionParams) {
14
+ const { client } = useAuth();
15
+ const [hasPostPermission, setHasPostPermission] = useState(false);
16
+
17
+ const isOnlyAdminCanPost =
18
+ community?.postSetting === CommunityPostSettings.ONLY_ADMIN_CAN_POST;
19
+
20
+ useEffect(() => {
21
+ if (!community?.communityId || !client?.userId) return;
22
+
23
+ CommunityRepository.Membership.searchMembers(
24
+ {
25
+ communityId: community.communityId,
26
+ search: client.userId,
27
+ limit: 1,
28
+ memberships: ['member'],
29
+ includeDeleted: false,
30
+ },
31
+ ({ data }) => {
32
+ const userRoles = data[0]?.roles ?? [];
33
+ setHasPostPermission(
34
+ isOnlyAdminCanPost ? isModerator(userRoles) : !!community?.isJoined
35
+ );
36
+ }
37
+ );
38
+ }, [
39
+ community?.communityId,
40
+ client?.userId,
41
+ isOnlyAdminCanPost,
42
+ community?.isJoined,
43
+ ]);
44
+
45
+ return hasPostPermission;
46
+ }
@@ -289,6 +289,7 @@ export default function AmitySocialUIKitV4Navigator() {
289
289
  params: { displayName },
290
290
  },
291
291
  }: any) => ({
292
+ headerShown: true,
292
293
  title: displayName,
293
294
  headerLeft: () => <BackButton />,
294
295
  })}
@@ -70,7 +70,7 @@ const FollowerListItem: FC<FollowerListItemType> = ({
70
70
  fileId: data.avatarFileId,
71
71
  imageSize: ImageSizeState.small,
72
72
  });
73
- setAvatar(userAvatar ?? defaultAvatarUri);
73
+ setAvatar(data?.avatarCustomUrl ?? userAvatar ?? defaultAvatarUri);
74
74
  }
75
75
  });
76
76
  }, [getImage, userId]);