@amityco/react-native-social-uikit 4.0.0-e24bae8.0 → 4.0.0-e3111902.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +13 -3
- package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityDraftStoryPage/AmityDraftStoryPage.js +4 -0
- package/lib/commonjs/v4/PublicApi/Pages/AmityDraftStoryPage/AmityDraftStoryPage.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityDraftStoryPage/styles.js +15 -8
- package/lib/commonjs/v4/PublicApi/Pages/AmityDraftStoryPage/styles.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/Avatar/Avatar.js +5 -3
- package/lib/commonjs/v4/component/Avatar/Avatar.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 +22 -2
- 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/Membership/components/MemberItem/MemberItem.js +2 -1
- package/lib/commonjs/v4/features/community/Membership/components/MemberItem/MemberItem.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/hook/usePostPermission.js +38 -0
- package/lib/commonjs/v4/hook/usePostPermission.js.map +1 -0
- 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 +13 -3
- package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityDraftStoryPage/AmityDraftStoryPage.js +4 -0
- package/lib/module/v4/PublicApi/Pages/AmityDraftStoryPage/AmityDraftStoryPage.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityDraftStoryPage/styles.js +15 -8
- package/lib/module/v4/PublicApi/Pages/AmityDraftStoryPage/styles.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/Avatar/Avatar.js +5 -3
- package/lib/module/v4/component/Avatar/Avatar.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 +22 -2
- 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/Membership/components/MemberItem/MemberItem.js +2 -1
- package/lib/module/v4/features/community/Membership/components/MemberItem/MemberItem.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/hook/usePostPermission.js +31 -0
- package/lib/module/v4/hook/usePostPermission.js.map +1 -0
- 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/AmityDraftStoryPage/AmityDraftStoryPage.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityDraftStoryPage/styles.d.ts +14 -7
- package/lib/typescript/src/v4/PublicApi/Pages/AmityDraftStoryPage/styles.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/Avatar/Avatar.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/Membership/components/MemberItem/MemberItem.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/hook/usePostPermission.d.ts +6 -0
- package/lib/typescript/src/v4/hook/usePostPermission.d.ts.map +1 -0
- 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 +13 -3
- package/src/v4/PublicApi/Pages/AmityDraftStoryPage/AmityDraftStoryPage.tsx +5 -0
- package/src/v4/PublicApi/Pages/AmityDraftStoryPage/styles.ts +14 -7
- 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/Avatar/Avatar.tsx +5 -2
- 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 +23 -1
- 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/Membership/components/MemberItem/MemberItem.tsx +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/hook/usePostPermission.ts +46 -0
- 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
|
@@ -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
|
-
|
|
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
|
-
<
|
|
58
|
-
|
|
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
|
-
|
|
109
|
+
({ error, loading, data, hasNextPage, onNextPage }) => {
|
|
107
110
|
if (error) return;
|
|
108
111
|
if (!loading) {
|
|
109
|
-
data && data.length > 0 &&
|
|
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 =
|
|
133
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
formattedUserObject = {
|
|
139
|
+
userId: item?.creator?.userId,
|
|
140
|
+
displayName: item?.creator?.displayName,
|
|
141
|
+
avatarFileId: item?.creator?.avatarFileId,
|
|
142
|
+
};
|
|
142
143
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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
|
-
<
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
+
<Text
|
|
284
|
+
style={
|
|
285
|
+
inputMessage.length > 0
|
|
286
|
+
? styles.postBtnText
|
|
287
|
+
: styles.postDisabledBtn
|
|
288
|
+
}
|
|
289
|
+
>
|
|
290
|
+
Post
|
|
291
|
+
</Text>
|
|
292
|
+
</TouchableOpacity>
|
|
293
|
+
</View>
|
|
294
|
+
))}
|
|
283
295
|
</KeyboardAvoidingView>
|
|
284
296
|
);
|
|
285
297
|
};
|
|
@@ -299,6 +311,7 @@ const CommentList: FC<ICommentListProp> = ({
|
|
|
299
311
|
commentDetail={item}
|
|
300
312
|
onClickReply={handleClickReply}
|
|
301
313
|
postType={postType}
|
|
314
|
+
disabledComment={disabledComment}
|
|
302
315
|
disabledInteraction={disabledInteraction}
|
|
303
316
|
onNavigate={onNavigate}
|
|
304
317
|
/>
|
|
@@ -123,6 +123,18 @@ export const useStyles = () => {
|
|
|
123
123
|
commentListFooter: {
|
|
124
124
|
width: width,
|
|
125
125
|
},
|
|
126
|
+
disabledCommentWrap: {
|
|
127
|
+
flexDirection: 'row',
|
|
128
|
+
alignItems: 'center',
|
|
129
|
+
justifyContent: 'center',
|
|
130
|
+
padding: 16,
|
|
131
|
+
gap: 8,
|
|
132
|
+
borderTopWidth: 1,
|
|
133
|
+
borderTopColor: theme.colors.baseShade4,
|
|
134
|
+
},
|
|
135
|
+
disabledCommentText: {
|
|
136
|
+
color: theme.colors.baseShade2,
|
|
137
|
+
},
|
|
126
138
|
});
|
|
127
139
|
|
|
128
140
|
return styles;
|
|
@@ -69,6 +69,7 @@ export interface ICommentList {
|
|
|
69
69
|
onClickReply: (user: UserInterface, commentId: string) => void;
|
|
70
70
|
postType: Amity.CommentReferenceType;
|
|
71
71
|
disabledInteraction?: boolean;
|
|
72
|
+
disabledComment?: boolean;
|
|
72
73
|
onNavigate?: () => void;
|
|
73
74
|
}
|
|
74
75
|
|
|
@@ -79,6 +80,7 @@ const CommentListItem = ({
|
|
|
79
80
|
postType,
|
|
80
81
|
disabledInteraction,
|
|
81
82
|
onNavigate,
|
|
83
|
+
disabledComment,
|
|
82
84
|
}: ICommentList) => {
|
|
83
85
|
const theme = useTheme() as MyMD3Theme;
|
|
84
86
|
const styles = useStyles();
|
|
@@ -345,7 +347,7 @@ const CommentListItem = ({
|
|
|
345
347
|
</Typography.CaptionBold>
|
|
346
348
|
</TouchableOpacity>
|
|
347
349
|
<TouchableOpacity
|
|
348
|
-
onPress={onHandleReply}
|
|
350
|
+
onPress={disabledComment ? undefined : onHandleReply}
|
|
349
351
|
style={styles.likeBtn}
|
|
350
352
|
>
|
|
351
353
|
<Typography.CaptionBold style={styles.btnText}>
|
|
@@ -18,6 +18,7 @@ interface ITargetItem {
|
|
|
18
18
|
isBadgeShow?: boolean;
|
|
19
19
|
isPrivate?: boolean;
|
|
20
20
|
onSelect: () => void;
|
|
21
|
+
avatarCustomUrl?: string;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
const TargetItem = ({
|
|
@@ -30,6 +31,7 @@ const TargetItem = ({
|
|
|
30
31
|
isBadgeShow,
|
|
31
32
|
isPrivate,
|
|
32
33
|
onSelect,
|
|
34
|
+
avatarCustomUrl,
|
|
33
35
|
}: ITargetItem) => {
|
|
34
36
|
const theme = useTheme() as MyMD3Theme;
|
|
35
37
|
|
|
@@ -72,6 +74,7 @@ const TargetItem = ({
|
|
|
72
74
|
elementID={avatarElementId}
|
|
73
75
|
avatarId={avatarFileId}
|
|
74
76
|
targetType="community"
|
|
77
|
+
avatarCustomUrl={avatarCustomUrl}
|
|
75
78
|
/>
|
|
76
79
|
{isPrivate && (
|
|
77
80
|
<ImageElement
|
|
@@ -19,6 +19,8 @@ import { useStyles } from './styles';
|
|
|
19
19
|
import { Illustration } from '../../../v4/PublicApi/Components/AmityEmptyNewsFeedComponent/Elements';
|
|
20
20
|
import { useNavigation } from '@react-navigation/native';
|
|
21
21
|
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
22
|
+
import { CommunityPostSettings } from '@amityco/ts-sdk-react-native';
|
|
23
|
+
import { usePostPermission } from '../../../v4/hook/usePostPermission';
|
|
22
24
|
|
|
23
25
|
export type FeedParams = {
|
|
24
26
|
targetId: string;
|
|
@@ -76,7 +78,7 @@ const TargetSelectionPage = ({
|
|
|
76
78
|
});
|
|
77
79
|
|
|
78
80
|
const renderItem = ({ item }: { item: Amity.Community }) => {
|
|
79
|
-
|
|
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: () =>
|
|
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
|
/>
|
|
@@ -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 {
|
|
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';
|