@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.
- package/lib/commonjs/snippet/AmityGlobalFeedComponent.js +6 -1
- package/lib/commonjs/snippet/AmityGlobalFeedComponent.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.js +3 -3
- package/lib/commonjs/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.js +5 -7
- package/lib/commonjs/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.js +23 -3
- package/lib/commonjs/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js +11 -17
- package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js +1 -1
- package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js +1 -1
- package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.js +8 -23
- package/lib/commonjs/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +8 -2
- package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js +21 -29
- package/lib/commonjs/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +1 -0
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
- package/lib/commonjs/v4/assets/icons/lock.js +6 -4
- package/lib/commonjs/v4/assets/icons/lock.js.map +1 -1
- package/lib/commonjs/v4/component/CommunityRowItem/CommunityRowItem.js +5 -4
- package/lib/commonjs/v4/component/CommunityRowItem/CommunityRowItem.js.map +1 -1
- package/lib/commonjs/v4/component/Social/CommentList/CommentList.js +24 -15
- package/lib/commonjs/v4/component/Social/CommentList/CommentList.js.map +1 -1
- package/lib/commonjs/v4/component/Social/CommentList/styles.js +12 -0
- package/lib/commonjs/v4/component/Social/CommentList/styles.js.map +1 -1
- package/lib/commonjs/v4/component/Social/CommentListItem/CommentListItem.js +3 -2
- package/lib/commonjs/v4/component/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/commonjs/v4/component/TargetSelectionPage/TargetItem/TargetItem.js +4 -2
- package/lib/commonjs/v4/component/TargetSelectionPage/TargetItem/TargetItem.js.map +1 -1
- package/lib/commonjs/v4/component/TargetSelectionPage/TargetSelectionPage.js +1 -0
- package/lib/commonjs/v4/component/TargetSelectionPage/TargetSelectionPage.js.map +1 -1
- package/lib/commonjs/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +8 -3
- package/lib/commonjs/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
- package/lib/commonjs/v4/elements/CommunityRowImage/CommunityRowImage.js +4 -32
- package/lib/commonjs/v4/elements/CommunityRowImage/CommunityRowImage.js.map +1 -1
- package/lib/commonjs/v4/enum/roomStatus.js +2 -1
- package/lib/commonjs/v4/enum/roomStatus.js.map +1 -1
- package/lib/commonjs/v4/features/community/Setting/hooks/useCommunitySetting.js +6 -3
- package/lib/commonjs/v4/features/community/Setting/hooks/useCommunitySetting.js.map +1 -1
- package/lib/commonjs/v4/{component/CommunityCategoryChips/CommunityCategoryChips.js → features/feed/components/CommunityCategories/CommunityCategories.js} +19 -21
- package/lib/commonjs/v4/features/feed/components/CommunityCategories/CommunityCategories.js.map +1 -0
- package/lib/commonjs/v4/features/feed/components/CommunityCategories/index.js +13 -0
- package/lib/commonjs/v4/features/feed/components/CommunityCategories/index.js.map +1 -0
- package/lib/commonjs/v4/{component/CommunityCategoryChips → features/feed/components/CommunityCategories}/styles.js +7 -2
- package/lib/commonjs/v4/features/feed/components/CommunityCategories/styles.js.map +1 -0
- package/lib/commonjs/v4/features/feed/components/index.js +17 -0
- package/lib/commonjs/v4/features/feed/components/index.js.map +1 -0
- package/lib/commonjs/v4/features/feed/elements/CommunityCategory/CommunityCategory.js +42 -0
- package/lib/commonjs/v4/features/feed/elements/CommunityCategory/CommunityCategory.js.map +1 -0
- package/lib/commonjs/v4/features/feed/elements/CommunityCategory/index.js +13 -0
- package/lib/commonjs/v4/features/feed/elements/CommunityCategory/index.js.map +1 -0
- package/lib/commonjs/v4/features/feed/elements/CommunityCategory/styles.js +29 -0
- package/lib/commonjs/v4/features/feed/elements/CommunityCategory/styles.js.map +1 -0
- package/lib/commonjs/v4/features/feed/elements/index.js +17 -0
- package/lib/commonjs/v4/features/feed/elements/index.js.map +1 -0
- package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js +33 -38
- package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
- package/lib/commonjs/v4/hook/usePaginator.js +11 -16
- package/lib/commonjs/v4/hook/usePaginator.js.map +1 -1
- package/lib/commonjs/v4/routes/AmitySocialUIKitV4Navigator.js +1 -0
- package/lib/commonjs/v4/routes/AmitySocialUIKitV4Navigator.js.map +1 -1
- package/lib/commonjs/v4/screen/FollowerList/Components/FollowerListItem.js +1 -1
- package/lib/commonjs/v4/screen/FollowerList/Components/FollowerListItem.js.map +1 -1
- package/lib/module/snippet/AmityGlobalFeedComponent.js +6 -1
- package/lib/module/snippet/AmityGlobalFeedComponent.js.map +1 -1
- package/lib/module/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.js +3 -3
- package/lib/module/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.js.map +1 -1
- package/lib/module/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.js +6 -8
- package/lib/module/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.js.map +1 -1
- package/lib/module/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.js +23 -3
- package/lib/module/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.js.map +1 -1
- package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js +11 -17
- package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js.map +1 -1
- package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js +1 -1
- package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js.map +1 -1
- package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js +1 -1
- package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js.map +1 -1
- package/lib/module/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.js +9 -23
- package/lib/module/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +8 -2
- package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js +23 -31
- package/lib/module/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +1 -0
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
- package/lib/module/v4/assets/icons/lock.js +6 -4
- package/lib/module/v4/assets/icons/lock.js.map +1 -1
- package/lib/module/v4/component/CommunityRowItem/CommunityRowItem.js +5 -4
- package/lib/module/v4/component/CommunityRowItem/CommunityRowItem.js.map +1 -1
- package/lib/module/v4/component/Social/CommentList/CommentList.js +24 -15
- package/lib/module/v4/component/Social/CommentList/CommentList.js.map +1 -1
- package/lib/module/v4/component/Social/CommentList/styles.js +12 -0
- package/lib/module/v4/component/Social/CommentList/styles.js.map +1 -1
- package/lib/module/v4/component/Social/CommentListItem/CommentListItem.js +3 -2
- package/lib/module/v4/component/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/module/v4/component/TargetSelectionPage/TargetItem/TargetItem.js +4 -2
- package/lib/module/v4/component/TargetSelectionPage/TargetItem/TargetItem.js.map +1 -1
- package/lib/module/v4/component/TargetSelectionPage/TargetSelectionPage.js +1 -0
- package/lib/module/v4/component/TargetSelectionPage/TargetSelectionPage.js.map +1 -1
- package/lib/module/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +8 -3
- package/lib/module/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
- package/lib/module/v4/elements/CommunityRowImage/CommunityRowImage.js +6 -34
- package/lib/module/v4/elements/CommunityRowImage/CommunityRowImage.js.map +1 -1
- package/lib/module/v4/enum/roomStatus.js +2 -1
- package/lib/module/v4/enum/roomStatus.js.map +1 -1
- package/lib/module/v4/features/community/Setting/hooks/useCommunitySetting.js +6 -3
- package/lib/module/v4/features/community/Setting/hooks/useCommunitySetting.js.map +1 -1
- package/lib/module/v4/{component/CommunityCategoryChips/CommunityCategoryChips.js → features/feed/components/CommunityCategories/CommunityCategories.js} +18 -19
- package/lib/module/v4/features/feed/components/CommunityCategories/CommunityCategories.js.map +1 -0
- package/lib/module/v4/features/feed/components/CommunityCategories/index.js +2 -0
- package/lib/module/v4/features/feed/components/CommunityCategories/index.js.map +1 -0
- package/lib/module/v4/{component/CommunityCategoryChips → features/feed/components/CommunityCategories}/styles.js +7 -2
- package/lib/module/v4/features/feed/components/CommunityCategories/styles.js.map +1 -0
- package/lib/module/v4/features/feed/components/index.js +2 -0
- package/lib/module/v4/features/feed/components/index.js.map +1 -0
- package/lib/module/v4/features/feed/elements/CommunityCategory/CommunityCategory.js +35 -0
- package/lib/module/v4/features/feed/elements/CommunityCategory/CommunityCategory.js.map +1 -0
- package/lib/module/v4/features/feed/elements/CommunityCategory/index.js +2 -0
- package/lib/module/v4/features/feed/elements/CommunityCategory/index.js.map +1 -0
- package/lib/module/v4/features/feed/elements/CommunityCategory/styles.js +22 -0
- package/lib/module/v4/features/feed/elements/CommunityCategory/styles.js.map +1 -0
- package/lib/module/v4/features/feed/elements/index.js +2 -0
- package/lib/module/v4/features/feed/elements/index.js.map +1 -0
- package/lib/module/v4/hook/useCustomRankingGlobalFeed.js +34 -39
- package/lib/module/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
- package/lib/module/v4/hook/usePaginator.js +12 -17
- package/lib/module/v4/hook/usePaginator.js.map +1 -1
- package/lib/module/v4/routes/AmitySocialUIKitV4Navigator.js +1 -0
- package/lib/module/v4/routes/AmitySocialUIKitV4Navigator.js.map +1 -1
- package/lib/module/v4/screen/FollowerList/Components/FollowerListItem.js +1 -1
- package/lib/module/v4/screen/FollowerList/Components/FollowerListItem.js.map +1 -1
- package/lib/typescript/src/components/PollSection/usePoll.d.ts +1 -1
- package/lib/typescript/src/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.d.ts +4 -0
- package/lib/typescript/src/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.d.ts +1 -0
- package/lib/typescript/src/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.d.ts.map +1 -1
- package/lib/typescript/src/v4/assets/icons/lock.d.ts +1 -1
- package/lib/typescript/src/v4/assets/icons/lock.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/Social/CommentList/CommentList.d.ts +1 -0
- package/lib/typescript/src/v4/component/Social/CommentList/CommentList.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/Social/CommentList/styles.d.ts +12 -0
- package/lib/typescript/src/v4/component/Social/CommentList/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/Social/CommentListItem/CommentListItem.d.ts +2 -1
- package/lib/typescript/src/v4/component/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/TargetSelectionPage/TargetItem/TargetItem.d.ts +2 -1
- package/lib/typescript/src/v4/component/TargetSelectionPage/TargetItem/TargetItem.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/TargetSelectionPage/TargetSelectionPage.d.ts.map +1 -1
- package/lib/typescript/src/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.d.ts.map +1 -1
- package/lib/typescript/src/v4/elements/CommunityRowImage/CommunityRowImage.d.ts +1 -1
- package/lib/typescript/src/v4/elements/CommunityRowImage/CommunityRowImage.d.ts.map +1 -1
- package/lib/typescript/src/v4/enum/roomStatus.d.ts +1 -0
- package/lib/typescript/src/v4/enum/roomStatus.d.ts.map +1 -1
- package/lib/typescript/src/v4/features/community/Setting/hooks/useCommunitySetting.d.ts.map +1 -1
- package/lib/typescript/src/v4/features/feed/components/CommunityCategories/CommunityCategories.d.ts +12 -0
- package/lib/typescript/src/v4/features/feed/components/CommunityCategories/CommunityCategories.d.ts.map +1 -0
- package/lib/typescript/src/v4/features/feed/components/CommunityCategories/index.d.ts +2 -0
- package/lib/typescript/src/v4/features/feed/components/CommunityCategories/index.d.ts.map +1 -0
- package/lib/typescript/src/v4/features/feed/components/CommunityCategories/styles.d.ts +30 -0
- package/lib/typescript/src/v4/features/feed/components/CommunityCategories/styles.d.ts.map +1 -0
- package/lib/typescript/src/v4/features/feed/components/index.d.ts +2 -0
- package/lib/typescript/src/v4/features/feed/components/index.d.ts.map +1 -0
- package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/CommunityCategory.d.ts +12 -0
- package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/CommunityCategory.d.ts.map +1 -0
- package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/index.d.ts +2 -0
- package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/index.d.ts.map +1 -0
- package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/styles.d.ts +17 -0
- package/lib/typescript/src/v4/features/feed/elements/CommunityCategory/styles.d.ts.map +1 -0
- package/lib/typescript/src/v4/features/feed/elements/index.d.ts +2 -0
- package/lib/typescript/src/v4/features/feed/elements/index.d.ts.map +1 -0
- package/lib/typescript/src/v4/hook/useCustomRankingGlobalFeed.d.ts +6 -1
- package/lib/typescript/src/v4/hook/useCustomRankingGlobalFeed.d.ts.map +1 -1
- package/lib/typescript/src/v4/hook/usePaginator.d.ts.map +1 -1
- package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts +1 -39
- package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts.map +1 -1
- package/lib/typescript/src/v4/hook/usePoll.d.ts +1 -1
- package/lib/typescript/src/v4/routes/AmitySocialUIKitV4Navigator.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/snippet/AmityGlobalFeedComponent.tsx +6 -1
- package/src/v4/PublicApi/Components/AmityCommunityHeaderComponent/AmityCommunityHeaderComponent.tsx +3 -3
- package/src/v4/PublicApi/Components/AmityGlobalFeedComponent/AmityGlobalFeedComponent.tsx +9 -6
- package/src/v4/PublicApi/Components/AmityNewsFeedComponent/AmityNewsFeedComponent.tsx +27 -2
- package/src/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.tsx +29 -36
- package/src/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.tsx +2 -2
- package/src/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.tsx +1 -1
- package/src/v4/PublicApi/Components/AmityRecommenedCommunityComponent/RecommenedCommunityItems/RecommenedCommunityItems.tsx +8 -24
- package/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.tsx +9 -2
- package/src/v4/PublicApi/Pages/AmitySocialHomePage/AmitySocialHomePage.tsx +27 -33
- package/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.tsx +1 -0
- package/src/v4/assets/icons/lock.tsx +7 -6
- package/src/v4/component/CommunityRowItem/CommunityRowItem.tsx +4 -4
- package/src/v4/component/Social/CommentList/CommentList.tsx +69 -56
- package/src/v4/component/Social/CommentList/styles.ts +12 -0
- package/src/v4/component/Social/CommentListItem/CommentListItem.tsx +3 -1
- package/src/v4/component/TargetSelectionPage/TargetItem/TargetItem.tsx +3 -0
- package/src/v4/component/TargetSelectionPage/TargetSelectionPage.tsx +1 -0
- package/src/v4/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +6 -2
- package/src/v4/elements/CommunityRowImage/CommunityRowImage.tsx +7 -34
- package/src/v4/enum/roomStatus.ts +1 -0
- package/src/v4/features/community/Setting/hooks/useCommunitySetting.ts +4 -2
- package/src/v4/{component/CommunityCategoryChips/CommunityCategoryChips.tsx → features/feed/components/CommunityCategories/CommunityCategories.tsx} +20 -22
- package/src/v4/features/feed/components/CommunityCategories/index.ts +1 -0
- package/src/v4/{component/CommunityCategoryChips → features/feed/components/CommunityCategories}/styles.ts +4 -2
- package/src/v4/features/feed/components/index.ts +1 -0
- package/src/v4/features/feed/elements/CommunityCategory/CommunityCategory.tsx +45 -0
- package/src/v4/features/feed/elements/CommunityCategory/index.ts +1 -0
- package/src/v4/features/feed/elements/CommunityCategory/styles.ts +20 -0
- package/src/v4/features/feed/elements/index.ts +1 -0
- package/src/v4/hook/useCustomRankingGlobalFeed.ts +47 -47
- package/src/v4/hook/usePaginator.ts +20 -23
- package/src/v4/routes/AmitySocialUIKitV4Navigator.tsx +1 -0
- package/src/v4/screen/FollowerList/Components/FollowerListItem.tsx +1 -1
- package/lib/commonjs/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js +0 -38
- package/lib/commonjs/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js.map +0 -1
- package/lib/commonjs/v4/component/CommunityCategoryChips/CommunityCategoryChips.js.map +0 -1
- package/lib/commonjs/v4/component/CommunityCategoryChips/styles.js.map +0 -1
- package/lib/commonjs/v4/elements/CommunityCatetory/CommunityCategory.js +0 -38
- package/lib/commonjs/v4/elements/CommunityCatetory/CommunityCategory.js.map +0 -1
- package/lib/module/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js +0 -30
- package/lib/module/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.js.map +0 -1
- package/lib/module/v4/component/CommunityCategoryChips/CommunityCategoryChips.js.map +0 -1
- package/lib/module/v4/component/CommunityCategoryChips/styles.js.map +0 -1
- package/lib/module/v4/elements/CommunityCatetory/CommunityCategory.js +0 -31
- package/lib/module/v4/elements/CommunityCatetory/CommunityCategory.js.map +0 -1
- package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.d.ts +0 -11
- package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.d.ts.map +0 -1
- package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChips.d.ts +0 -11
- package/lib/typescript/src/v4/component/CommunityCategoryChips/CommunityCategoryChips.d.ts.map +0 -1
- package/lib/typescript/src/v4/component/CommunityCategoryChips/styles.d.ts +0 -27
- package/lib/typescript/src/v4/component/CommunityCategoryChips/styles.d.ts.map +0 -1
- package/lib/typescript/src/v4/elements/CommunityCatetory/CommunityCategory.d.ts +0 -12
- package/lib/typescript/src/v4/elements/CommunityCatetory/CommunityCategory.d.ts.map +0 -1
- package/src/v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.tsx +0 -47
- package/src/v4/elements/CommunityCatetory/CommunityCategory.tsx +0 -41
|
@@ -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
|
|
@@ -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: () =>
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
{
|
|
35
|
+
{fileUrl ? (
|
|
63
36
|
<Image
|
|
64
|
-
source={{ uri:
|
|
37
|
+
source={{ uri: getFileUrlWithSize(fileUrl) }}
|
|
65
38
|
style={styles.image}
|
|
66
39
|
resizeMode="cover"
|
|
67
40
|
/>
|
|
@@ -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 {
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
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
|
|
16
|
-
|
|
17
|
-
themeStyles,
|
|
16
|
+
export function CommunityCategories({
|
|
17
|
+
categories,
|
|
18
18
|
allVisible,
|
|
19
19
|
...props
|
|
20
|
-
})
|
|
21
|
-
const styles = useStyles(
|
|
22
|
-
const visibleCategories =
|
|
23
|
-
const hiddenCategoriesCount =
|
|
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 ?
|
|
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((
|
|
67
|
-
<
|
|
66
|
+
{displayCategories.map((category, index) => (
|
|
67
|
+
<CommunityCategory
|
|
68
68
|
key={index}
|
|
69
|
-
|
|
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((
|
|
78
|
-
<
|
|
76
|
+
{displayCategories.map((category, index) => (
|
|
77
|
+
<CommunityCategory
|
|
79
78
|
key={index}
|
|
80
|
-
|
|
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 = (
|
|
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 {
|
|
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
|
-
|
|
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.
|
|
56
|
+
return FeedRepository.getGlobalFeed(
|
|
82
57
|
{ limit: globalFeedPageLimit },
|
|
83
|
-
({ data, loading, error: $error, onNextPage }) => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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 () =>
|
|
101
|
-
|
|
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
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
(
|
|
93
|
-
|
|
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
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
useEffect(() => {
|
|
278
|
+
if (!adsLoaded || isLoading) return;
|
|
279
|
+
startTransition(() => {
|
|
282
280
|
const newItems = combineItemsWithAds(items);
|
|
283
|
-
|
|
284
281
|
setItemWithAds(newItems);
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
);
|
|
282
|
+
});
|
|
283
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
284
|
+
}, [adsLoaded, items, isLoading]);
|
|
288
285
|
|
|
289
286
|
return { itemWithAds, reset };
|
|
290
287
|
};
|
|
@@ -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]);
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.CommunityCategoryChip = void 0;
|
|
7
|
-
var _tsSdkReactNative = require("@amityco/ts-sdk-react-native");
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _reactNative = require("react-native");
|
|
10
|
-
var _styles = require("../styles");
|
|
11
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
-
const CommunityCategoryChip = ({
|
|
13
|
-
categoryId,
|
|
14
|
-
style,
|
|
15
|
-
maxWidth,
|
|
16
|
-
themeStyles
|
|
17
|
-
}) => {
|
|
18
|
-
const [category, setCategory] = (0, _react.useState)(null);
|
|
19
|
-
const styles = (0, _styles.useStyles)(themeStyles);
|
|
20
|
-
(0, _react.useEffect)(() => {
|
|
21
|
-
const fetch = async () => {
|
|
22
|
-
const result = await _tsSdkReactNative.CategoryRepository.getCategory(categoryId);
|
|
23
|
-
setCategory(result.data);
|
|
24
|
-
};
|
|
25
|
-
fetch();
|
|
26
|
-
}, [categoryId]);
|
|
27
|
-
if (category == null) return null;
|
|
28
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
29
|
-
style: [styles.chipContainer, maxWidth ? {
|
|
30
|
-
maxWidth: maxWidth
|
|
31
|
-
} : null, style]
|
|
32
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
33
|
-
style: styles.chipText,
|
|
34
|
-
numberOfLines: 1
|
|
35
|
-
}, category.name));
|
|
36
|
-
};
|
|
37
|
-
exports.CommunityCategoryChip = CommunityCategoryChip;
|
|
38
|
-
//# sourceMappingURL=CommunityCategoryChip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_tsSdkReactNative","require","_react","_interopRequireWildcard","_reactNative","_styles","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CommunityCategoryChip","categoryId","style","maxWidth","themeStyles","category","setCategory","useState","styles","useStyles","useEffect","fetch","result","CategoryRepository","getCategory","data","createElement","View","chipContainer","Text","chipText","numberOfLines","name","exports"],"sourceRoot":"../../../../../../src","sources":["v4/component/CommunityCategoryChips/CommunityCategoryChip/CommunityCategoryChip.tsx"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAsC,SAAAE,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAU/B,MAAMkB,qBAA2D,GAAGA,CAAC;EAC1EC,UAAU;EACVC,KAAK;EACLC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAG,IAAAC,eAAQ,EAAwB,IAAI,CAAC;EACrE,MAAMC,MAAM,GAAG,IAAAC,iBAAS,EAACL,WAAW,CAAC;EAErC,IAAAM,gBAAS,EAAC,MAAM;IACd,MAAMC,KAAK,GAAG,MAAAA,CAAA,KAAY;MACxB,MAAMC,MAAM,GAAG,MAAMC,oCAAkB,CAACC,WAAW,CAACb,UAAU,CAAC;MAC/DK,WAAW,CAACM,MAAM,CAACG,IAAI,CAAC;IAC1B,CAAC;IAEDJ,KAAK,CAAC,CAAC;EACT,CAAC,EAAE,CAACV,UAAU,CAAC,CAAC;EAEhB,IAAII,QAAQ,IAAI,IAAI,EAAE,OAAO,IAAI;EAEjC,oBACE5B,MAAA,CAAAc,OAAA,CAAAyB,aAAA,CAACrC,YAAA,CAAAsC,IAAI;IACHf,KAAK,EAAE,CACLM,MAAM,CAACU,aAAa,EACpBf,QAAQ,GAAG;MAAEA,QAAQ,EAAEA;IAA2B,CAAC,GAAG,IAAI,EAC1DD,KAAK;EACL,gBAEFzB,MAAA,CAAAc,OAAA,CAAAyB,aAAA,CAACrC,YAAA,CAAAwC,IAAI;IAACjB,KAAK,EAAEM,MAAM,CAACY,QAAS;IAACC,aAAa,EAAE;EAAE,GAC5ChB,QAAQ,CAACiB,IACN,CACF,CAAC;AAEX,CAAC;AAACC,OAAA,CAAAvB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_CommunityCategoryChip","_styles","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","MAX_VISIBLE_CATEGORIES","CommunityCategoryChips","categoryIds","themeStyles","allVisible","props","styles","useStyles","visibleCategories","slice","hiddenCategoriesCount","showMoreText","showMore","getMaxWidthForItem","totalVisibleItems","displayCategories","displayShowMore","createElement","View","style","container","ScrollView","horizontal","showsHorizontalScrollIndicator","contentContainerStyle","scrollableContainer","map","id","index","CommunityCategoryChip","key","categoryId","maxWidth","Fragment","chipContainer","Text","chipText","exports"],"sourceRoot":"../../../../../src","sources":["v4/component/CommunityCategoryChips/CommunityCategoryChips.tsx"],"mappings":"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","ignoreList":[]}
|