@amityco/react-native-social-uikit 4.0.0-93c391d.0 → 4.0.0-9d15a274.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/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js +1 -1
- package/lib/commonjs/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js.map +1 -1
- package/lib/commonjs/components/MediaSection/index.js +3 -3
- package/lib/commonjs/components/MediaSection/index.js.map +1 -1
- package/lib/commonjs/components/PostTypeChoiceModal/PostTypeChoiceModal.js +14 -5
- package/lib/commonjs/components/PostTypeChoiceModal/PostTypeChoiceModal.js.map +1 -1
- package/lib/commonjs/components/PostTypeChoiceModal/style.js +1 -2
- package/lib/commonjs/components/PostTypeChoiceModal/style.js.map +1 -1
- package/lib/commonjs/components/Social/PostList/index.js +1 -3
- package/lib/commonjs/components/Social/PostList/index.js.map +1 -1
- package/lib/commonjs/components/Toast/Toast.js +1 -2
- package/lib/commonjs/components/Toast/Toast.js.map +1 -1
- package/lib/commonjs/index.js +6 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/providers/file-provider.js +19 -38
- package/lib/commonjs/providers/file-provider.js.map +1 -1
- package/lib/commonjs/screens/CreateLivestream/CreateLivestream.js +16 -16
- package/lib/commonjs/screens/CreateLivestream/CreateLivestream.js.map +1 -1
- package/lib/commonjs/screens/LivestreamPlayer/index.js +3 -6
- package/lib/commonjs/screens/LivestreamPlayer/index.js.map +1 -1
- package/lib/commonjs/svg/svg-xml-list.js +2 -7
- package/lib/commonjs/svg/svg-xml-list.js.map +1 -1
- package/lib/commonjs/util/postTypeChecker.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js +11 -9
- package/lib/commonjs/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.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 +2 -1
- package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Elements/ButtonWithIconElement/styles.js +3 -2
- package/lib/commonjs/v4/PublicApi/Elements/ButtonWithIconElement/styles.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +28 -25
- package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js +2 -2
- package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js +217 -68
- package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js +50 -0
- package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js.map +1 -0
- package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js +71 -3
- package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js +106 -124
- package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.js +2 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.js +1 -37
- package/lib/commonjs/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +21 -54
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/styles.js +2 -24
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/styles.js.map +1 -1
- package/lib/commonjs/v4/assets/icons/toast.js +6 -6
- package/lib/commonjs/v4/assets/icons/toast.js.map +1 -1
- package/lib/commonjs/v4/component/CommunityStories/index.js +4 -9
- package/lib/commonjs/v4/component/CommunityStories/index.js.map +1 -1
- package/lib/commonjs/v4/component/CommunityStories/styles.js +2 -7
- package/lib/commonjs/v4/component/CommunityStories/styles.js.map +1 -1
- package/lib/commonjs/v4/component/LivestreamContent/index.js +12 -12
- package/lib/commonjs/v4/component/LivestreamContent/index.js.map +1 -1
- package/lib/commonjs/v4/component/LoadingImage/index.js +22 -21
- package/lib/commonjs/v4/component/LoadingImage/index.js.map +1 -1
- package/lib/commonjs/v4/component/LoadingImage/styles.js +2 -19
- package/lib/commonjs/v4/component/LoadingImage/styles.js.map +1 -1
- package/lib/commonjs/v4/component/LoadingVideo/index.js +3 -11
- package/lib/commonjs/v4/component/LoadingVideo/index.js.map +1 -1
- package/lib/commonjs/v4/component/MyStories/StoryCircleItem.js +4 -11
- package/lib/commonjs/v4/component/MyStories/StoryCircleItem.js.map +1 -1
- package/lib/commonjs/v4/component/MyStories/styles.js +0 -5
- package/lib/commonjs/v4/component/MyStories/styles.js.map +1 -1
- package/lib/commonjs/v4/component/PostContent/index.js +4 -4
- package/lib/commonjs/v4/component/PostContent/index.js.map +1 -1
- package/lib/commonjs/v4/component/PostMenu/index.js +2 -2
- package/lib/commonjs/v4/component/PostMenu/index.js.map +1 -1
- package/lib/commonjs/v4/component/RenderTextWithMention/RenderTextWithMention.js +16 -9
- package/lib/commonjs/v4/component/RenderTextWithMention/RenderTextWithMention.js.map +1 -1
- package/lib/commonjs/v4/component/Toast/index.js +4 -4
- package/lib/commonjs/v4/component/Toast/index.js.map +1 -1
- package/lib/commonjs/v4/component/Toast/styles.js +2 -2
- package/lib/commonjs/v4/component/Toast/styles.js.map +1 -1
- package/lib/commonjs/v4/constants/index.js +2 -1
- package/lib/commonjs/v4/constants/index.js.map +1 -1
- package/lib/commonjs/v4/enum/roomStatus.js +14 -0
- package/lib/commonjs/v4/enum/roomStatus.js.map +1 -0
- package/lib/commonjs/v4/hook/index.js +22 -0
- package/lib/commonjs/v4/hook/index.js.map +1 -1
- package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js +1 -3
- package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
- package/lib/commonjs/v4/hook/usePostSubscription.js +38 -0
- package/lib/commonjs/v4/hook/usePostSubscription.js.map +1 -0
- package/lib/commonjs/v4/hook/useRoomSubscription.js +22 -0
- package/lib/commonjs/v4/hook/useRoomSubscription.js.map +1 -0
- package/lib/commonjs/v4/index.js +7 -0
- package/lib/commonjs/v4/index.js.map +1 -1
- package/lib/commonjs/v4/stores/slices/toast.js +4 -1
- package/lib/commonjs/v4/stores/slices/toast.js.map +1 -1
- package/lib/module/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js +1 -1
- package/lib/module/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js.map +1 -1
- package/lib/module/components/MediaSection/index.js +3 -3
- package/lib/module/components/MediaSection/index.js.map +1 -1
- package/lib/module/components/PostTypeChoiceModal/PostTypeChoiceModal.js +15 -8
- package/lib/module/components/PostTypeChoiceModal/PostTypeChoiceModal.js.map +1 -1
- package/lib/module/components/PostTypeChoiceModal/style.js +1 -2
- package/lib/module/components/PostTypeChoiceModal/style.js.map +1 -1
- package/lib/module/components/Social/PostList/index.js +1 -3
- package/lib/module/components/Social/PostList/index.js.map +1 -1
- package/lib/module/components/Toast/Toast.js +1 -2
- package/lib/module/components/Toast/Toast.js.map +1 -1
- package/lib/module/index.js +2 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/providers/file-provider.js +19 -38
- package/lib/module/providers/file-provider.js.map +1 -1
- package/lib/module/screens/CreateLivestream/CreateLivestream.js +17 -17
- package/lib/module/screens/CreateLivestream/CreateLivestream.js.map +1 -1
- package/lib/module/screens/LivestreamPlayer/index.js +4 -8
- package/lib/module/screens/LivestreamPlayer/index.js.map +1 -1
- package/lib/module/svg/svg-xml-list.js +1 -5
- package/lib/module/svg/svg-xml-list.js.map +1 -1
- package/lib/module/util/postTypeChecker.js.map +1 -1
- package/lib/module/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js +11 -9
- package/lib/module/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.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 +2 -1
- package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js.map +1 -1
- package/lib/module/v4/PublicApi/Elements/ButtonWithIconElement/styles.js +3 -2
- package/lib/module/v4/PublicApi/Elements/ButtonWithIconElement/styles.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +29 -26
- package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js +2 -2
- package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js +222 -72
- package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js +42 -0
- package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js.map +1 -0
- package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js +71 -3
- package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js +108 -126
- package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.js +2 -1
- package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.js +1 -37
- package/lib/module/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +21 -54
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/styles.js +2 -24
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/styles.js.map +1 -1
- package/lib/module/v4/assets/icons/toast.js +6 -6
- package/lib/module/v4/assets/icons/toast.js.map +1 -1
- package/lib/module/v4/component/CommunityStories/index.js +5 -10
- package/lib/module/v4/component/CommunityStories/index.js.map +1 -1
- package/lib/module/v4/component/CommunityStories/styles.js +2 -7
- package/lib/module/v4/component/CommunityStories/styles.js.map +1 -1
- package/lib/module/v4/component/LivestreamContent/index.js +13 -13
- package/lib/module/v4/component/LivestreamContent/index.js.map +1 -1
- package/lib/module/v4/component/LoadingImage/index.js +21 -21
- package/lib/module/v4/component/LoadingImage/index.js.map +1 -1
- package/lib/module/v4/component/LoadingImage/styles.js +2 -19
- package/lib/module/v4/component/LoadingImage/styles.js.map +1 -1
- package/lib/module/v4/component/LoadingVideo/index.js +3 -11
- package/lib/module/v4/component/LoadingVideo/index.js.map +1 -1
- package/lib/module/v4/component/MyStories/StoryCircleItem.js +6 -13
- package/lib/module/v4/component/MyStories/StoryCircleItem.js.map +1 -1
- package/lib/module/v4/component/MyStories/styles.js +0 -5
- package/lib/module/v4/component/MyStories/styles.js.map +1 -1
- package/lib/module/v4/component/PostContent/index.js +4 -4
- package/lib/module/v4/component/PostContent/index.js.map +1 -1
- package/lib/module/v4/component/PostMenu/index.js +2 -2
- package/lib/module/v4/component/PostMenu/index.js.map +1 -1
- package/lib/module/v4/component/RenderTextWithMention/RenderTextWithMention.js +17 -10
- package/lib/module/v4/component/RenderTextWithMention/RenderTextWithMention.js.map +1 -1
- package/lib/module/v4/component/Toast/index.js +4 -4
- package/lib/module/v4/component/Toast/index.js.map +1 -1
- package/lib/module/v4/component/Toast/styles.js +2 -2
- package/lib/module/v4/component/Toast/styles.js.map +1 -1
- package/lib/module/v4/constants/index.js +1 -0
- package/lib/module/v4/constants/index.js.map +1 -1
- package/lib/module/v4/enum/roomStatus.js +8 -0
- package/lib/module/v4/enum/roomStatus.js.map +1 -0
- package/lib/module/v4/hook/index.js +2 -0
- package/lib/module/v4/hook/index.js.map +1 -1
- package/lib/module/v4/hook/useCustomRankingGlobalFeed.js +1 -3
- package/lib/module/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
- package/lib/module/v4/hook/usePostSubscription.js +31 -0
- package/lib/module/v4/hook/usePostSubscription.js.map +1 -0
- package/lib/module/v4/hook/useRoomSubscription.js +15 -0
- package/lib/module/v4/hook/useRoomSubscription.js.map +1 -0
- package/lib/module/v4/index.js +1 -1
- package/lib/module/v4/index.js.map +1 -1
- package/lib/module/v4/stores/slices/toast.js +4 -1
- package/lib/module/v4/stores/slices/toast.js.map +1 -1
- package/lib/typescript/src/components/MediaSection/index.d.ts.map +1 -1
- package/lib/typescript/src/components/PostTypeChoiceModal/style.d.ts +1 -2
- package/lib/typescript/src/components/PostTypeChoiceModal/style.d.ts.map +1 -1
- package/lib/typescript/src/components/Social/PostList/index.d.ts +1 -3
- package/lib/typescript/src/components/Social/PostList/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Toast/Toast.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/providers/file-provider.d.ts.map +1 -1
- package/lib/typescript/src/screens/LivestreamPlayer/index.d.ts.map +1 -1
- package/lib/typescript/src/svg/svg-xml-list.d.ts +0 -1
- package/lib/typescript/src/svg/svg-xml-list.d.ts.map +1 -1
- package/lib/typescript/src/util/postTypeChecker.d.ts +1 -1
- package/lib/typescript/src/util/postTypeChecker.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.d.ts +1 -3
- package/lib/typescript/src/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Elements/ButtonWithIconElement/styles.d.ts +1 -0
- package/lib/typescript/src/v4/PublicApi/Elements/ButtonWithIconElement/styles.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/AmityCommunityProfilePage/styles.d.ts +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.d.ts +8 -0
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.d.ts.map +1 -0
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.d.ts +70 -2
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.d.ts +1 -0
- package/lib/typescript/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.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/PublicApi/Pages/AmityViewStoryPage/styles.d.ts +0 -22
- package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/assets/icons/toast.d.ts +3 -3
- package/lib/typescript/src/v4/assets/icons/toast.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/CommunityStories/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/CommunityStories/styles.d.ts +0 -5
- package/lib/typescript/src/v4/component/CommunityStories/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/LivestreamContent/index.d.ts +1 -1
- package/lib/typescript/src/v4/component/LivestreamContent/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/LoadingImage/index.d.ts +1 -2
- package/lib/typescript/src/v4/component/LoadingImage/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/LoadingImage/styles.d.ts +0 -21
- package/lib/typescript/src/v4/component/LoadingImage/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/LoadingVideo/index.d.ts +1 -2
- package/lib/typescript/src/v4/component/LoadingVideo/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/MyStories/StoryCircleItem.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/MyStories/styles.d.ts +0 -5
- package/lib/typescript/src/v4/component/MyStories/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/PostContent/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/RenderTextWithMention/RenderTextWithMention.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/Toast/styles.d.ts +1 -1
- package/lib/typescript/src/v4/component/Toast/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/constants/index.d.ts +1 -0
- package/lib/typescript/src/v4/constants/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/enum/roomStatus.d.ts +8 -0
- package/lib/typescript/src/v4/enum/roomStatus.d.ts.map +1 -0
- package/lib/typescript/src/v4/hook/index.d.ts +2 -0
- package/lib/typescript/src/v4/hook/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts +3 -0
- package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts.map +1 -1
- package/lib/typescript/src/v4/hook/usePostSubscription.d.ts +4 -0
- package/lib/typescript/src/v4/hook/usePostSubscription.d.ts.map +1 -0
- package/lib/typescript/src/v4/hook/useRoomSubscription.d.ts +4 -0
- package/lib/typescript/src/v4/hook/useRoomSubscription.d.ts.map +1 -0
- package/lib/typescript/src/v4/index.d.ts +1 -0
- package/lib/typescript/src/v4/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/routes/RouteParamList.d.ts +1 -1
- package/lib/typescript/src/v4/routes/RouteParamList.d.ts.map +1 -1
- package/lib/typescript/src/v4/stores/slices/toast.d.ts +1 -0
- package/lib/typescript/src/v4/stores/slices/toast.d.ts.map +1 -1
- package/package.json +6 -3
- package/src/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.tsx +1 -1
- package/src/components/MediaSection/index.tsx +4 -6
- package/src/components/PostTypeChoiceModal/PostTypeChoiceModal.tsx +15 -15
- package/src/components/PostTypeChoiceModal/style.ts +1 -2
- package/src/components/Social/PostList/index.tsx +1 -4
- package/src/components/Toast/Toast.tsx +0 -1
- package/src/index.tsx +2 -2
- package/src/providers/file-provider.tsx +20 -42
- package/src/screens/CreateLivestream/CreateLivestream.tsx +17 -17
- package/src/screens/LivestreamPlayer/index.tsx +9 -15
- package/src/svg/svg-xml-list.ts +1 -7
- package/src/util/postTypeChecker.ts +1 -1
- package/src/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.tsx +10 -10
- package/src/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.tsx +1 -1
- package/src/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.tsx +1 -1
- package/src/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.tsx +1 -1
- package/src/v4/PublicApi/Elements/ButtonWithIconElement/styles.ts +3 -2
- package/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.tsx +24 -25
- package/src/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.ts +2 -2
- package/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.tsx +255 -89
- package/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.tsx +48 -0
- package/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.ts +72 -3
- package/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.tsx +145 -155
- package/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.ts +2 -0
- package/src/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.tsx +0 -46
- package/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.tsx +57 -122
- package/src/v4/PublicApi/Pages/AmityViewStoryPage/styles.ts +1 -23
- package/src/v4/assets/icons/toast.tsx +9 -12
- package/src/v4/component/CommunityStories/index.tsx +17 -26
- package/src/v4/component/CommunityStories/styles.ts +2 -7
- package/src/v4/component/LivestreamContent/index.tsx +21 -22
- package/src/v4/component/LoadingImage/index.tsx +22 -28
- package/src/v4/component/LoadingImage/styles.ts +0 -17
- package/src/v4/component/LoadingVideo/index.tsx +3 -12
- package/src/v4/component/MyStories/StoryCircleItem.tsx +12 -19
- package/src/v4/component/MyStories/styles.ts +0 -5
- package/src/v4/component/PostContent/index.tsx +6 -8
- package/src/v4/component/PostMenu/index.tsx +2 -2
- package/src/v4/component/RenderTextWithMention/RenderTextWithMention.tsx +16 -10
- package/src/v4/component/Toast/index.tsx +1 -1
- package/src/v4/component/Toast/styles.ts +2 -2
- package/src/v4/constants/index.ts +3 -0
- package/src/v4/enum/roomStatus.ts +7 -0
- package/src/v4/hook/index.ts +2 -0
- package/src/v4/hook/useCustomRankingGlobalFeed.ts +1 -1
- package/src/v4/hook/usePostSubscription.ts +34 -0
- package/src/v4/hook/useRoomSubscription.ts +19 -0
- package/src/v4/index.tsx +1 -1
- package/src/v4/routes/RouteParamList.tsx +1 -1
- package/src/v4/stores/slices/toast.ts +5 -0
- package/uikit.config.json +1 -1
- package/lib/commonjs/v4/enum/livestreamStatus.js +0 -13
- package/lib/commonjs/v4/enum/livestreamStatus.js.map +0 -1
- package/lib/module/v4/enum/livestreamStatus.js +0 -7
- package/lib/module/v4/enum/livestreamStatus.js.map +0 -1
- package/lib/typescript/src/v4/enum/livestreamStatus.d.ts +0 -7
- package/lib/typescript/src/v4/enum/livestreamStatus.d.ts.map +0 -1
- package/src/v4/enum/livestreamStatus.ts +0 -6
|
@@ -1,131 +1,76 @@
|
|
|
1
|
-
import React, { useEffect,
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
TouchableOpacity,
|
|
5
|
-
TouchableWithoutFeedback,
|
|
6
|
-
useAnimatedValue,
|
|
7
|
-
} from 'react-native';
|
|
1
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
2
|
+
import { View, TouchableOpacity, Platform } from 'react-native';
|
|
8
3
|
import { useStyles } from './styles';
|
|
9
|
-
// @ts-ignore
|
|
10
|
-
// import { AmityStreamPlayer } from '@amityco/video-player-react-native';
|
|
11
4
|
import LiveStreamEndThumbnail from '../../../component/LivestreamContent/LivestreamEndedThumbnail';
|
|
12
|
-
import { Animated } from 'react-native';
|
|
13
5
|
import { SvgXml } from 'react-native-svg';
|
|
14
|
-
import {
|
|
15
|
-
getPostTopic,
|
|
16
|
-
PostRepository,
|
|
17
|
-
StreamRepository,
|
|
18
|
-
subscribeTopic,
|
|
19
|
-
} from '@amityco/ts-sdk-react-native';
|
|
20
|
-
import { close, pause, resume } from '../../../assets/icons';
|
|
6
|
+
import { close } from '../../../assets/icons';
|
|
21
7
|
import { RouteProp, useNavigation, useRoute } from '@react-navigation/native';
|
|
22
8
|
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
23
9
|
import { RootStackParamList } from '../../../routes/RouteParamList';
|
|
24
|
-
import {
|
|
10
|
+
import { RoomStatus } from '../../../enum/roomStatus';
|
|
25
11
|
import LiveStreamIdleThumbnail from '../../../component/LivestreamContent/LivestreamIdleThumbnail';
|
|
26
12
|
import { Typography } from '../../../component/Typography/Typography';
|
|
27
13
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
28
14
|
import NetInfo from '@react-native-community/netinfo';
|
|
29
15
|
import { CircularProgressIndicator } from '../../../component/CircularProgressIndicator';
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
setSubscribedPost(data);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return () => {
|
|
41
|
-
unsubscribe && unsubscribe();
|
|
42
|
-
};
|
|
43
|
-
}, [postId]);
|
|
44
|
-
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
let unsubscribe: () => void;
|
|
47
|
-
if (subscribedPost) {
|
|
48
|
-
unsubscribe = subscribeTopic(getPostTopic(subscribedPost));
|
|
49
|
-
}
|
|
50
|
-
return () => {
|
|
51
|
-
unsubscribe && unsubscribe();
|
|
52
|
-
};
|
|
53
|
-
}, [subscribedPost]);
|
|
54
|
-
|
|
55
|
-
return { subscribedPost };
|
|
56
|
-
};
|
|
16
|
+
import Video from 'react-native-video';
|
|
17
|
+
import useAuth from '../../../../hooks/useAuth';
|
|
18
|
+
import {
|
|
19
|
+
usePostSubscription,
|
|
20
|
+
useRoomSubscription,
|
|
21
|
+
} from '../../../../v4/hook/index';
|
|
22
|
+
import { RoomRepository } from '@amityco/ts-sdk-react-native';
|
|
57
23
|
|
|
58
24
|
function AmityLiveStreamPlayerPage() {
|
|
59
|
-
const ref = useRef<any>(null);
|
|
60
25
|
const { styles, theme } = useStyles();
|
|
61
|
-
const controlOpacity = useAnimatedValue(0);
|
|
62
26
|
const navigation =
|
|
63
27
|
useNavigation<NativeStackNavigationProp<RootStackParamList>>();
|
|
64
28
|
const route = useRoute<RouteProp<RootStackParamList, 'LivestreamPlayer'>>();
|
|
65
29
|
|
|
66
|
-
const [error, setError] = useState<any>(null);
|
|
67
|
-
const [isPlaying, setIsPlaying] = useState(true);
|
|
68
30
|
const [reconnecting, setReconnecting] = useState(false);
|
|
69
|
-
const [
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
31
|
+
const [room, setRoom] = useState<Amity.Room | null>(null);
|
|
32
|
+
const [error, setError] = useState<Error | null>(null);
|
|
33
|
+
const [isVideoLoading, setIsVideoLoading] = useState(true);
|
|
34
|
+
const [videoKey, setVideoKey] = useState(0);
|
|
35
|
+
const [isPaused, setIsPaused] = useState(false);
|
|
36
|
+
const [wasLive, setWasLive] = useState(false);
|
|
37
|
+
|
|
38
|
+
const { roomId, post } = route.params;
|
|
73
39
|
const { subscribedPost } = usePostSubscription(post?.postId);
|
|
40
|
+
useRoomSubscription({ room });
|
|
74
41
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const onStartPlayer = () => {
|
|
81
|
-
ref.current && ref.current.play();
|
|
82
|
-
setIsPlaying(true);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const onPressControlButton = () => {
|
|
86
|
-
isPlaying ? onStopPlayer() : onStartPlayer();
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const onToggleControl = () => {
|
|
90
|
-
controlOpacity.stopAnimation((currentValue) => {
|
|
91
|
-
Animated.timing(controlOpacity, {
|
|
92
|
-
toValue: currentValue === 0 ? 1 : 0,
|
|
93
|
-
duration: 300,
|
|
94
|
-
useNativeDriver: false,
|
|
95
|
-
}).start();
|
|
96
|
-
});
|
|
97
|
-
};
|
|
42
|
+
const { client } = useAuth();
|
|
43
|
+
const videoRef = useRef<any>(null);
|
|
44
|
+
const isStreamEnding = useRef(false);
|
|
98
45
|
|
|
99
46
|
useEffect(() => {
|
|
100
|
-
const unsubscribe =
|
|
101
|
-
|
|
47
|
+
const unsubscribe = RoomRepository.getRoom(
|
|
48
|
+
roomId,
|
|
102
49
|
({ data, loading, error: streamError }) => {
|
|
103
50
|
if (streamError) setError(streamError);
|
|
104
|
-
if (!loading && data)
|
|
51
|
+
if (!loading && data) setRoom({ ...data });
|
|
105
52
|
}
|
|
106
53
|
);
|
|
107
54
|
|
|
108
55
|
return () => unsubscribe();
|
|
109
|
-
}, [
|
|
56
|
+
}, [roomId]);
|
|
110
57
|
|
|
111
58
|
useEffect(() => {
|
|
112
|
-
if (
|
|
113
|
-
|
|
59
|
+
if (room?.status === RoomStatus.live) {
|
|
60
|
+
setWasLive(true);
|
|
114
61
|
}
|
|
115
|
-
}, [
|
|
62
|
+
}, [room?.status]);
|
|
116
63
|
|
|
117
64
|
useEffect(() => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
livestream?.moderation?.terminateLabels?.length > 0;
|
|
121
|
-
const isLiveOrEnded =
|
|
122
|
-
livestream?.status === LivestreamStatus.live ||
|
|
123
|
-
livestream?.status === LivestreamStatus.ended;
|
|
124
|
-
|
|
125
|
-
if (isLiveOrEnded && isTerminated) {
|
|
126
|
-
navigation.replace('LivestreamTerminated', { type: 'viewer' });
|
|
65
|
+
if (room?.isDeleted || subscribedPost?.isDeleted) {
|
|
66
|
+
navigation.replace('PostDetail', { postId: subscribedPost?.postId });
|
|
127
67
|
}
|
|
128
|
-
}, [
|
|
68
|
+
}, [
|
|
69
|
+
navigation,
|
|
70
|
+
room?.isDeleted,
|
|
71
|
+
subscribedPost?.postId,
|
|
72
|
+
subscribedPost?.isDeleted,
|
|
73
|
+
]);
|
|
129
74
|
|
|
130
75
|
useEffect(() => {
|
|
131
76
|
const unsubscribe = NetInfo.addEventListener((state) => {
|
|
@@ -134,24 +79,66 @@ function AmityLiveStreamPlayerPage() {
|
|
|
134
79
|
return () => unsubscribe();
|
|
135
80
|
}, []);
|
|
136
81
|
|
|
137
|
-
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (!room?.status) return;
|
|
84
|
+
|
|
85
|
+
const shouldEnd =
|
|
86
|
+
room.status === RoomStatus.ended ||
|
|
87
|
+
(room.status === RoomStatus.recorded && wasLive);
|
|
88
|
+
|
|
89
|
+
if (!shouldEnd || isStreamEnding.current) return;
|
|
90
|
+
|
|
91
|
+
isStreamEnding.current = true;
|
|
92
|
+
setIsPaused(true);
|
|
93
|
+
|
|
94
|
+
if (Platform.OS === 'ios') {
|
|
95
|
+
// iOS: ONLY dismiss fullscreen. DO NOT touch key. DO NOT unmount.
|
|
96
|
+
requestAnimationFrame(() => {
|
|
97
|
+
videoRef.current?.dismissFullscreenPlayer?.();
|
|
98
|
+
});
|
|
99
|
+
} else {
|
|
100
|
+
// Android: HARD destroy
|
|
101
|
+
setTimeout(() => {
|
|
102
|
+
setVideoKey((prev) => prev + 1);
|
|
103
|
+
}, 50);
|
|
104
|
+
}
|
|
105
|
+
}, [room?.status, wasLive]);
|
|
106
|
+
|
|
107
|
+
const isTerminated =
|
|
108
|
+
room?.moderation?.terminateLabels &&
|
|
109
|
+
room?.moderation?.terminateLabels?.length > 0;
|
|
110
|
+
|
|
111
|
+
const shouldShowEndThumbnail =
|
|
112
|
+
room?.status === RoomStatus.ended ||
|
|
113
|
+
(room?.status === RoomStatus.recorded && wasLive) ||
|
|
114
|
+
isTerminated;
|
|
115
|
+
|
|
116
|
+
if (!room || error) {
|
|
138
117
|
return (
|
|
139
118
|
<SafeAreaView style={styles.container}>
|
|
140
119
|
<LiveStreamIdleThumbnail />
|
|
141
120
|
</SafeAreaView>
|
|
142
121
|
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const closePlayer = () => {
|
|
125
|
+
navigation.goBack();
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const videoUrl =
|
|
129
|
+
room.status === RoomStatus.recorded
|
|
130
|
+
? room.recordedPlaybackInfos[0]?.url
|
|
131
|
+
: room.livePlaybackUrl;
|
|
143
132
|
|
|
144
133
|
return (
|
|
145
134
|
<SafeAreaView style={styles.container}>
|
|
146
|
-
{
|
|
135
|
+
{shouldShowEndThumbnail ? (
|
|
147
136
|
<>
|
|
148
137
|
<View style={styles.steamEndContainer}>
|
|
149
138
|
<LiveStreamEndThumbnail />
|
|
150
139
|
</View>
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
onPress={navigation.goBack}
|
|
154
|
-
>
|
|
140
|
+
|
|
141
|
+
<TouchableOpacity style={styles.closeButton} onPress={closePlayer}>
|
|
155
142
|
<SvgXml
|
|
156
143
|
xml={close()}
|
|
157
144
|
width="28"
|
|
@@ -160,14 +147,65 @@ function AmityLiveStreamPlayerPage() {
|
|
|
160
147
|
/>
|
|
161
148
|
</TouchableOpacity>
|
|
162
149
|
</>
|
|
163
|
-
) :
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
150
|
+
) : (
|
|
151
|
+
<View style={styles.container}>
|
|
152
|
+
{(room.status === RoomStatus.live ||
|
|
153
|
+
room.status === RoomStatus.waiting_reconnect) && (
|
|
154
|
+
<View style={styles.indicator}>
|
|
155
|
+
<View style={styles.status}>
|
|
156
|
+
<Typography.CaptionBold style={styles.live}>
|
|
157
|
+
LIVE
|
|
158
|
+
</Typography.CaptionBold>
|
|
159
|
+
</View>
|
|
160
|
+
</View>
|
|
161
|
+
)}
|
|
162
|
+
|
|
163
|
+
{!shouldShowEndThumbnail && (
|
|
164
|
+
<Video
|
|
165
|
+
key={
|
|
166
|
+
Platform.OS === 'android' ? `${videoUrl}-${videoKey}` : videoUrl
|
|
167
|
+
}
|
|
168
|
+
ref={videoRef}
|
|
169
|
+
source={{
|
|
170
|
+
uri:
|
|
171
|
+
room.status === RoomStatus.recorded
|
|
172
|
+
? room.recordedPlaybackInfos[0]?.url
|
|
173
|
+
: room.livePlaybackUrl,
|
|
174
|
+
headers: {
|
|
175
|
+
Authorization: `Bearer ${client.token.accessToken}`,
|
|
176
|
+
},
|
|
177
|
+
type: 'm3u8',
|
|
178
|
+
}}
|
|
179
|
+
style={styles.container}
|
|
180
|
+
resizeMode="contain"
|
|
181
|
+
controls={true}
|
|
182
|
+
fullscreenOrientation="landscape"
|
|
183
|
+
paused={isPaused}
|
|
184
|
+
muted={false}
|
|
185
|
+
volume={1.0}
|
|
186
|
+
audioOutput="speaker"
|
|
187
|
+
playInBackground={false}
|
|
188
|
+
playWhenInactive={false}
|
|
189
|
+
repeat={false}
|
|
190
|
+
onLoad={() => {
|
|
191
|
+
setIsVideoLoading(false);
|
|
192
|
+
if (room.status === RoomStatus.recorded) {
|
|
193
|
+
setIsPaused(false);
|
|
194
|
+
}
|
|
195
|
+
}}
|
|
196
|
+
/>
|
|
197
|
+
)}
|
|
198
|
+
|
|
199
|
+
{isVideoLoading && (
|
|
200
|
+
<View style={styles.connecting}>
|
|
201
|
+
<CircularProgressIndicator size={40} strokeWidth={2} />
|
|
202
|
+
</View>
|
|
203
|
+
)}
|
|
204
|
+
</View>
|
|
205
|
+
)}
|
|
206
|
+
|
|
207
|
+
{((room.status === RoomStatus.live && reconnecting) ||
|
|
208
|
+
room.status === RoomStatus.waiting_reconnect) && (
|
|
171
209
|
<View style={styles.connecting}>
|
|
172
210
|
<CircularProgressIndicator size={40} strokeWidth={2} />
|
|
173
211
|
<Typography.TitleBold style={styles.text}>
|
|
@@ -179,54 +217,6 @@ function AmityLiveStreamPlayerPage() {
|
|
|
179
217
|
</Typography.Caption>
|
|
180
218
|
</View>
|
|
181
219
|
)}
|
|
182
|
-
{livestream.status === LivestreamStatus.live && (
|
|
183
|
-
<>
|
|
184
|
-
<View style={styles.indicator}>
|
|
185
|
-
<View style={styles.status}>
|
|
186
|
-
<Typography.CaptionBold style={styles.live}>
|
|
187
|
-
LIVE
|
|
188
|
-
</Typography.CaptionBold>
|
|
189
|
-
</View>
|
|
190
|
-
</View>
|
|
191
|
-
<TouchableWithoutFeedback onPress={onToggleControl}>
|
|
192
|
-
<Animated.View
|
|
193
|
-
style={[styles.control, { opacity: controlOpacity }]}
|
|
194
|
-
>
|
|
195
|
-
<TouchableOpacity
|
|
196
|
-
style={styles.closeButton}
|
|
197
|
-
onPress={navigation.goBack}
|
|
198
|
-
>
|
|
199
|
-
<SvgXml
|
|
200
|
-
xml={close()}
|
|
201
|
-
width="28"
|
|
202
|
-
height="28"
|
|
203
|
-
color={theme.colors.background}
|
|
204
|
-
/>
|
|
205
|
-
</TouchableOpacity>
|
|
206
|
-
|
|
207
|
-
<View style={styles.controller}>
|
|
208
|
-
<TouchableOpacity onPress={onPressControlButton}>
|
|
209
|
-
{isPlaying ? (
|
|
210
|
-
<SvgXml
|
|
211
|
-
width={32}
|
|
212
|
-
height={32}
|
|
213
|
-
xml={pause()}
|
|
214
|
-
color={theme.colors.background}
|
|
215
|
-
/>
|
|
216
|
-
) : (
|
|
217
|
-
<SvgXml
|
|
218
|
-
width={32}
|
|
219
|
-
height={32}
|
|
220
|
-
xml={resume()}
|
|
221
|
-
color={theme.colors.background}
|
|
222
|
-
/>
|
|
223
|
-
)}
|
|
224
|
-
</TouchableOpacity>
|
|
225
|
-
</View>
|
|
226
|
-
</Animated.View>
|
|
227
|
-
</TouchableWithoutFeedback>
|
|
228
|
-
</>
|
|
229
|
-
)}
|
|
230
220
|
</SafeAreaView>
|
|
231
221
|
);
|
|
232
222
|
}
|
|
@@ -107,16 +107,12 @@ const AmityPostComposerPage: FC<AmityPostComposerPageType> = ({
|
|
|
107
107
|
const [deletedPostIds, setDeletedPostIds] = useState<string[]>([]);
|
|
108
108
|
const [isUploading, setIsUploading] = useState(false);
|
|
109
109
|
const [hasChangedAttachment, setHasChangedAttachment] = useState(false);
|
|
110
|
-
const [imageErrors, setImageErrors] = useState<Set<string>>(new Set());
|
|
111
|
-
const [videoErrors, setVideoErrors] = useState<Set<string>>(new Set());
|
|
112
110
|
const privateCommunityId = !community?.isPublic && community?.communityId;
|
|
113
111
|
const title = isEditMode
|
|
114
112
|
? 'Edit Post'
|
|
115
113
|
: community?.displayName ?? 'My Timeline';
|
|
116
114
|
const isInputValid =
|
|
117
115
|
!isUploading &&
|
|
118
|
-
imageErrors.size === 0 &&
|
|
119
|
-
videoErrors.size === 0 &&
|
|
120
116
|
inputMessage.trim().length <= MAXIMUM_POST_CHARACTERS &&
|
|
121
117
|
(inputMessage.trim().length > 0 ||
|
|
122
118
|
displayImages.length > 0 ||
|
|
@@ -602,45 +598,10 @@ const AmityPostComposerPage: FC<AmityPostComposerPageType> = ({
|
|
|
602
598
|
}
|
|
603
599
|
}, [displayVideos.length, processMedia]);
|
|
604
600
|
|
|
605
|
-
const handleImageUploadError = useCallback(
|
|
606
|
-
(hasError: boolean, source: string) => {
|
|
607
|
-
setImageErrors((prev) => {
|
|
608
|
-
const newSet = new Set(prev);
|
|
609
|
-
if (hasError) {
|
|
610
|
-
newSet.add(source);
|
|
611
|
-
} else {
|
|
612
|
-
newSet.delete(source);
|
|
613
|
-
}
|
|
614
|
-
return newSet;
|
|
615
|
-
});
|
|
616
|
-
},
|
|
617
|
-
[]
|
|
618
|
-
);
|
|
619
|
-
|
|
620
|
-
const handleVideoUploadError = useCallback(
|
|
621
|
-
(hasError: boolean, source: string) => {
|
|
622
|
-
setVideoErrors((prev) => {
|
|
623
|
-
const newSet = new Set(prev);
|
|
624
|
-
if (hasError) {
|
|
625
|
-
newSet.add(source);
|
|
626
|
-
} else {
|
|
627
|
-
newSet.delete(source);
|
|
628
|
-
}
|
|
629
|
-
return newSet;
|
|
630
|
-
});
|
|
631
|
-
},
|
|
632
|
-
[]
|
|
633
|
-
);
|
|
634
|
-
|
|
635
601
|
const handleOnCloseImage = useCallback(
|
|
636
602
|
(originalPath: string, _, postId: string) => {
|
|
637
603
|
setHasChangedAttachment(true);
|
|
638
604
|
setDeletedPostIds((prev) => [...prev, postId]);
|
|
639
|
-
setImageErrors((prev) => {
|
|
640
|
-
const newSet = new Set(prev);
|
|
641
|
-
newSet.delete(originalPath);
|
|
642
|
-
return newSet;
|
|
643
|
-
});
|
|
644
605
|
setDisplayImages((prevData) => {
|
|
645
606
|
const newData = prevData.filter(
|
|
646
607
|
(item: IDisplayImage) => item.url !== originalPath
|
|
@@ -654,11 +615,6 @@ const AmityPostComposerPage: FC<AmityPostComposerPageType> = ({
|
|
|
654
615
|
(originalPath: string, _, postId: string) => {
|
|
655
616
|
setHasChangedAttachment(true);
|
|
656
617
|
setDeletedPostIds((prev) => [...prev, postId]);
|
|
657
|
-
setVideoErrors((prev) => {
|
|
658
|
-
const newSet = new Set(prev);
|
|
659
|
-
newSet.delete(originalPath);
|
|
660
|
-
return newSet;
|
|
661
|
-
});
|
|
662
618
|
setDisplayVideos((prevData) => {
|
|
663
619
|
const newData = prevData.filter(
|
|
664
620
|
(item: IDisplayImage) => item.url !== originalPath
|
|
@@ -804,7 +760,6 @@ const AmityPostComposerPage: FC<AmityPostComposerPageType> = ({
|
|
|
804
760
|
onClose={handleOnCloseImage}
|
|
805
761
|
index={index} //TODO: Fix this without index
|
|
806
762
|
onLoadFinish={handleOnFinishImage}
|
|
807
|
-
onUploadError={handleImageUploadError}
|
|
808
763
|
isUploaded={item.isUploaded}
|
|
809
764
|
fileId={item.fileId}
|
|
810
765
|
fileCount={displayImages.length}
|
|
@@ -828,7 +783,6 @@ const AmityPostComposerPage: FC<AmityPostComposerPageType> = ({
|
|
|
828
783
|
onClose={handleOnCloseVideo}
|
|
829
784
|
index={index} //TODO: Fix this without index
|
|
830
785
|
onLoadFinish={handleOnFinishVideo}
|
|
831
|
-
onUploadError={handleVideoUploadError}
|
|
832
786
|
isUploaded={item.isUploaded}
|
|
833
787
|
fileId={item.fileId}
|
|
834
788
|
thumbNail={item.thumbNail as string}
|