@amityco/react-native-social-uikit 4.0.0-ca3519f.0 → 4.0.0-cfcb02e.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.
Files changed (417) hide show
  1. package/README.md +1 -1
  2. package/lib/commonjs/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js +1 -1
  3. package/lib/commonjs/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js.map +1 -1
  4. package/lib/commonjs/components/ErrorBoundary/ErrorBoundary.js +77 -0
  5. package/lib/commonjs/components/ErrorBoundary/ErrorBoundary.js.map +1 -0
  6. package/lib/commonjs/components/ErrorBoundary/index.js +20 -0
  7. package/lib/commonjs/components/ErrorBoundary/index.js.map +1 -0
  8. package/lib/commonjs/components/MediaSection/index.js +3 -3
  9. package/lib/commonjs/components/MediaSection/index.js.map +1 -1
  10. package/lib/commonjs/components/PostTypeChoiceModal/PostTypeChoiceModal.js +14 -5
  11. package/lib/commonjs/components/PostTypeChoiceModal/PostTypeChoiceModal.js.map +1 -1
  12. package/lib/commonjs/components/PostTypeChoiceModal/style.js +1 -2
  13. package/lib/commonjs/components/PostTypeChoiceModal/style.js.map +1 -1
  14. package/lib/commonjs/components/Social/PostList/index.js +8 -5
  15. package/lib/commonjs/components/Social/PostList/index.js.map +1 -1
  16. package/lib/commonjs/hooks/useAuth.js +4 -2
  17. package/lib/commonjs/hooks/useAuth.js.map +1 -1
  18. package/lib/commonjs/index.js +13 -0
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/commonjs/providers/Social/communities-sdk.js +2 -1
  21. package/lib/commonjs/providers/Social/communities-sdk.js.map +1 -1
  22. package/lib/commonjs/providers/amity-ui-kit-provider.js +4 -2
  23. package/lib/commonjs/providers/amity-ui-kit-provider.js.map +1 -1
  24. package/lib/commonjs/providers/auth-provider.js +20 -11
  25. package/lib/commonjs/providers/auth-provider.js.map +1 -1
  26. package/lib/commonjs/screens/CreateLivestream/CreateLivestream.js +16 -16
  27. package/lib/commonjs/screens/CreateLivestream/CreateLivestream.js.map +1 -1
  28. package/lib/commonjs/screens/LivestreamPlayer/index.js +3 -6
  29. package/lib/commonjs/screens/LivestreamPlayer/index.js.map +1 -1
  30. package/lib/commonjs/svg/svg-xml-list.js +1 -1
  31. package/lib/commonjs/util/postTypeChecker.js.map +1 -1
  32. package/lib/commonjs/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js +43 -25
  33. package/lib/commonjs/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js.map +1 -1
  34. package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js +4 -16
  35. package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js.map +1 -1
  36. package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/CommentListItem.js +22 -9
  37. package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/CommentListItem.js.map +1 -1
  38. package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/styles.js +4 -3
  39. package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/styles.js.map +1 -1
  40. package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/index.js +14 -13
  41. package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/index.js.map +1 -1
  42. package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/styles.js +8 -10
  43. package/lib/commonjs/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/styles.js.map +1 -1
  44. package/lib/commonjs/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.js +2 -1
  45. package/lib/commonjs/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.js.map +1 -1
  46. package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js +1 -1
  47. package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js.map +1 -1
  48. package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js +2 -1
  49. package/lib/commonjs/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js.map +1 -1
  50. package/lib/commonjs/v4/PublicApi/Elements/ButtonWithIconElement/styles.js +3 -2
  51. package/lib/commonjs/v4/PublicApi/Elements/ButtonWithIconElement/styles.js.map +1 -1
  52. package/lib/commonjs/v4/PublicApi/Elements/CommonElements/AvatarElement.js +16 -9
  53. package/lib/commonjs/v4/PublicApi/Elements/CommonElements/AvatarElement.js.map +1 -1
  54. package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +28 -25
  55. package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
  56. package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js +2 -2
  57. package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js.map +1 -1
  58. package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js +231 -76
  59. package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js.map +1 -1
  60. package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js +50 -0
  61. package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js.map +1 -0
  62. package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js +71 -3
  63. package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js.map +1 -1
  64. package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js +113 -124
  65. package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js.map +1 -1
  66. package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.js +3 -2
  67. package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.js.map +1 -1
  68. package/lib/commonjs/v4/PublicApi/Pages/AmityPostDetailPage/AmityPostDetailPage.js +21 -2
  69. package/lib/commonjs/v4/PublicApi/Pages/AmityPostDetailPage/AmityPostDetailPage.js.map +1 -1
  70. package/lib/commonjs/v4/PublicApi/Pages/AmitySocialGlobalSearchPage/AmitySocialGlobalSearchPage.js.map +1 -1
  71. package/lib/commonjs/v4/PublicApi/Pages/AmityUserProfilePage/AmityUserProfilePage.js +17 -6
  72. package/lib/commonjs/v4/PublicApi/Pages/AmityUserProfilePage/AmityUserProfilePage.js.map +1 -1
  73. package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +1 -1
  74. package/lib/commonjs/v4/assets/icons/poll.js +2 -2
  75. package/lib/commonjs/v4/component/LivestreamContent/index.js +12 -12
  76. package/lib/commonjs/v4/component/LivestreamContent/index.js.map +1 -1
  77. package/lib/commonjs/v4/component/MyAvatar/MyAvatar.js +9 -6
  78. package/lib/commonjs/v4/component/MyAvatar/MyAvatar.js.map +1 -1
  79. package/lib/commonjs/v4/component/PollContent/PollResults.js +1 -0
  80. package/lib/commonjs/v4/component/PollContent/PollResults.js.map +1 -1
  81. package/lib/commonjs/v4/component/PostContent/index.js +4 -4
  82. package/lib/commonjs/v4/component/PostContent/index.js.map +1 -1
  83. package/lib/commonjs/v4/component/PostMenu/index.js +2 -2
  84. package/lib/commonjs/v4/component/PostMenu/index.js.map +1 -1
  85. package/lib/commonjs/v4/component/RenderTextWithMention/RenderTextWithMention.js +16 -9
  86. package/lib/commonjs/v4/component/RenderTextWithMention/RenderTextWithMention.js.map +1 -1
  87. package/lib/commonjs/v4/component/SearchResultItem/SearchResultItem.js +1 -0
  88. package/lib/commonjs/v4/component/SearchResultItem/SearchResultItem.js.map +1 -1
  89. package/lib/commonjs/v4/component/Toast/index.js +4 -4
  90. package/lib/commonjs/v4/component/Toast/index.js.map +1 -1
  91. package/lib/commonjs/v4/component/Toast/styles.js +2 -2
  92. package/lib/commonjs/v4/component/Toast/styles.js.map +1 -1
  93. package/lib/commonjs/v4/constants/index.js +4 -2
  94. package/lib/commonjs/v4/constants/index.js.map +1 -1
  95. package/lib/commonjs/v4/elements/CommunityCreatePostButton/CommunityCreatePostButton.js +1 -1
  96. package/lib/commonjs/v4/elements/CommunityCreatePostButton/CommunityCreatePostButton.js.map +1 -1
  97. package/lib/commonjs/v4/engine/AssetDownloader.js +2 -1
  98. package/lib/commonjs/v4/engine/AssetDownloader.js.map +1 -1
  99. package/lib/commonjs/v4/enum/roomStatus.js +15 -0
  100. package/lib/commonjs/v4/enum/roomStatus.js.map +1 -0
  101. package/lib/commonjs/v4/features/room/hooks/useRoom.js +26 -0
  102. package/lib/commonjs/v4/features/room/hooks/useRoom.js.map +1 -0
  103. package/lib/commonjs/v4/hook/index.js +22 -0
  104. package/lib/commonjs/v4/hook/index.js.map +1 -1
  105. package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js +1 -3
  106. package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
  107. package/lib/commonjs/v4/hook/usePostSubscription.js +38 -0
  108. package/lib/commonjs/v4/hook/usePostSubscription.js.map +1 -0
  109. package/lib/commonjs/v4/hook/useRoomSubscription.js +22 -0
  110. package/lib/commonjs/v4/hook/useRoomSubscription.js.map +1 -0
  111. package/lib/commonjs/v4/index.js +7 -0
  112. package/lib/commonjs/v4/index.js.map +1 -1
  113. package/lib/commonjs/v4/routes/AmityPageRenderer.js +5 -0
  114. package/lib/commonjs/v4/routes/AmityPageRenderer.js.map +1 -1
  115. package/lib/commonjs/v4/routes/AmitySocialUIKitV4Navigator.js +4 -1
  116. package/lib/commonjs/v4/routes/AmitySocialUIKitV4Navigator.js.map +1 -1
  117. package/lib/commonjs/v4/screen/GlobalBan/GlobalBan.js +42 -0
  118. package/lib/commonjs/v4/screen/GlobalBan/GlobalBan.js.map +1 -0
  119. package/lib/commonjs/v4/screen/GlobalBan/index.js +13 -0
  120. package/lib/commonjs/v4/screen/GlobalBan/index.js.map +1 -0
  121. package/lib/commonjs/v4/screen/GlobalBan/styles.js +46 -0
  122. package/lib/commonjs/v4/screen/GlobalBan/styles.js.map +1 -0
  123. package/lib/commonjs/v4/screen/PostDetail/index.js +3 -2
  124. package/lib/commonjs/v4/screen/PostDetail/index.js.map +1 -1
  125. package/lib/commonjs/v4/stores/slices/toast.js +4 -1
  126. package/lib/commonjs/v4/stores/slices/toast.js.map +1 -1
  127. package/lib/module/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js +1 -1
  128. package/lib/module/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js.map +1 -1
  129. package/lib/module/components/ErrorBoundary/ErrorBoundary.js +69 -0
  130. package/lib/module/components/ErrorBoundary/ErrorBoundary.js.map +1 -0
  131. package/lib/module/components/ErrorBoundary/index.js +3 -0
  132. package/lib/module/components/ErrorBoundary/index.js.map +1 -0
  133. package/lib/module/components/MediaSection/index.js +3 -3
  134. package/lib/module/components/MediaSection/index.js.map +1 -1
  135. package/lib/module/components/PostTypeChoiceModal/PostTypeChoiceModal.js +15 -8
  136. package/lib/module/components/PostTypeChoiceModal/PostTypeChoiceModal.js.map +1 -1
  137. package/lib/module/components/PostTypeChoiceModal/style.js +1 -2
  138. package/lib/module/components/PostTypeChoiceModal/style.js.map +1 -1
  139. package/lib/module/components/Social/PostList/index.js +8 -5
  140. package/lib/module/components/Social/PostList/index.js.map +1 -1
  141. package/lib/module/hooks/useAuth.js +4 -2
  142. package/lib/module/hooks/useAuth.js.map +1 -1
  143. package/lib/module/index.js +3 -6
  144. package/lib/module/index.js.map +1 -1
  145. package/lib/module/providers/Social/communities-sdk.js +2 -1
  146. package/lib/module/providers/Social/communities-sdk.js.map +1 -1
  147. package/lib/module/providers/amity-ui-kit-provider.js +4 -2
  148. package/lib/module/providers/amity-ui-kit-provider.js.map +1 -1
  149. package/lib/module/providers/auth-provider.js +20 -11
  150. package/lib/module/providers/auth-provider.js.map +1 -1
  151. package/lib/module/screens/CreateLivestream/CreateLivestream.js +17 -17
  152. package/lib/module/screens/CreateLivestream/CreateLivestream.js.map +1 -1
  153. package/lib/module/screens/LivestreamPlayer/index.js +4 -8
  154. package/lib/module/screens/LivestreamPlayer/index.js.map +1 -1
  155. package/lib/module/svg/svg-xml-list.js +1 -1
  156. package/lib/module/util/postTypeChecker.js.map +1 -1
  157. package/lib/module/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js +44 -26
  158. package/lib/module/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js.map +1 -1
  159. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js +4 -16
  160. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.js.map +1 -1
  161. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/CommentListItem.js +22 -9
  162. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/CommentListItem.js.map +1 -1
  163. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/styles.js +4 -3
  164. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/styles.js.map +1 -1
  165. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/index.js +14 -13
  166. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/index.js.map +1 -1
  167. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/styles.js +8 -10
  168. package/lib/module/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/styles.js.map +1 -1
  169. package/lib/module/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.js +2 -1
  170. package/lib/module/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.js.map +1 -1
  171. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js +1 -1
  172. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.js.map +1 -1
  173. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js +2 -1
  174. package/lib/module/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.js.map +1 -1
  175. package/lib/module/v4/PublicApi/Elements/ButtonWithIconElement/styles.js +3 -2
  176. package/lib/module/v4/PublicApi/Elements/ButtonWithIconElement/styles.js.map +1 -1
  177. package/lib/module/v4/PublicApi/Elements/CommonElements/AvatarElement.js +16 -9
  178. package/lib/module/v4/PublicApi/Elements/CommonElements/AvatarElement.js.map +1 -1
  179. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +29 -26
  180. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
  181. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js +2 -2
  182. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js.map +1 -1
  183. package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js +236 -80
  184. package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js.map +1 -1
  185. package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js +42 -0
  186. package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js.map +1 -0
  187. package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js +71 -3
  188. package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js.map +1 -1
  189. package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js +115 -126
  190. package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js.map +1 -1
  191. package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.js +3 -2
  192. package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.js.map +1 -1
  193. package/lib/module/v4/PublicApi/Pages/AmityPostDetailPage/AmityPostDetailPage.js +21 -2
  194. package/lib/module/v4/PublicApi/Pages/AmityPostDetailPage/AmityPostDetailPage.js.map +1 -1
  195. package/lib/module/v4/PublicApi/Pages/AmitySocialGlobalSearchPage/AmitySocialGlobalSearchPage.js.map +1 -1
  196. package/lib/module/v4/PublicApi/Pages/AmityUserProfilePage/AmityUserProfilePage.js +17 -6
  197. package/lib/module/v4/PublicApi/Pages/AmityUserProfilePage/AmityUserProfilePage.js.map +1 -1
  198. package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +1 -1
  199. package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
  200. package/lib/module/v4/assets/icons/poll.js +2 -2
  201. package/lib/module/v4/component/LivestreamContent/index.js +13 -13
  202. package/lib/module/v4/component/LivestreamContent/index.js.map +1 -1
  203. package/lib/module/v4/component/MyAvatar/MyAvatar.js +9 -6
  204. package/lib/module/v4/component/MyAvatar/MyAvatar.js.map +1 -1
  205. package/lib/module/v4/component/PollContent/PollResults.js +1 -0
  206. package/lib/module/v4/component/PollContent/PollResults.js.map +1 -1
  207. package/lib/module/v4/component/PostContent/index.js +4 -4
  208. package/lib/module/v4/component/PostContent/index.js.map +1 -1
  209. package/lib/module/v4/component/PostMenu/index.js +2 -2
  210. package/lib/module/v4/component/PostMenu/index.js.map +1 -1
  211. package/lib/module/v4/component/RenderTextWithMention/RenderTextWithMention.js +17 -10
  212. package/lib/module/v4/component/RenderTextWithMention/RenderTextWithMention.js.map +1 -1
  213. package/lib/module/v4/component/SearchResultItem/SearchResultItem.js +1 -0
  214. package/lib/module/v4/component/SearchResultItem/SearchResultItem.js.map +1 -1
  215. package/lib/module/v4/component/Toast/index.js +4 -4
  216. package/lib/module/v4/component/Toast/index.js.map +1 -1
  217. package/lib/module/v4/component/Toast/styles.js +2 -2
  218. package/lib/module/v4/component/Toast/styles.js.map +1 -1
  219. package/lib/module/v4/constants/index.js +3 -1
  220. package/lib/module/v4/constants/index.js.map +1 -1
  221. package/lib/module/v4/elements/CommunityCreatePostButton/CommunityCreatePostButton.js +1 -1
  222. package/lib/module/v4/elements/CommunityCreatePostButton/CommunityCreatePostButton.js.map +1 -1
  223. package/lib/module/v4/engine/AssetDownloader.js +2 -1
  224. package/lib/module/v4/engine/AssetDownloader.js.map +1 -1
  225. package/lib/module/v4/enum/roomStatus.js +9 -0
  226. package/lib/module/v4/enum/roomStatus.js.map +1 -0
  227. package/lib/module/v4/features/room/hooks/useRoom.js +20 -0
  228. package/lib/module/v4/features/room/hooks/useRoom.js.map +1 -0
  229. package/lib/module/v4/hook/index.js +2 -0
  230. package/lib/module/v4/hook/index.js.map +1 -1
  231. package/lib/module/v4/hook/useCustomRankingGlobalFeed.js +1 -3
  232. package/lib/module/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
  233. package/lib/module/v4/hook/usePostSubscription.js +31 -0
  234. package/lib/module/v4/hook/usePostSubscription.js.map +1 -0
  235. package/lib/module/v4/hook/useRoomSubscription.js +15 -0
  236. package/lib/module/v4/hook/useRoomSubscription.js.map +1 -0
  237. package/lib/module/v4/index.js +1 -1
  238. package/lib/module/v4/index.js.map +1 -1
  239. package/lib/module/v4/routes/AmityPageRenderer.js +5 -0
  240. package/lib/module/v4/routes/AmityPageRenderer.js.map +1 -1
  241. package/lib/module/v4/routes/AmitySocialUIKitV4Navigator.js +4 -1
  242. package/lib/module/v4/routes/AmitySocialUIKitV4Navigator.js.map +1 -1
  243. package/lib/module/v4/screen/GlobalBan/GlobalBan.js +35 -0
  244. package/lib/module/v4/screen/GlobalBan/GlobalBan.js.map +1 -0
  245. package/lib/module/v4/screen/GlobalBan/index.js +2 -0
  246. package/lib/module/v4/screen/GlobalBan/index.js.map +1 -0
  247. package/lib/module/v4/screen/GlobalBan/styles.js +39 -0
  248. package/lib/module/v4/screen/GlobalBan/styles.js.map +1 -0
  249. package/lib/module/v4/screen/PostDetail/index.js +3 -2
  250. package/lib/module/v4/screen/PostDetail/index.js.map +1 -1
  251. package/lib/module/v4/stores/slices/toast.js +4 -1
  252. package/lib/module/v4/stores/slices/toast.js.map +1 -1
  253. package/lib/typescript/src/components/ErrorBoundary/ErrorBoundary.d.ts +20 -0
  254. package/lib/typescript/src/components/ErrorBoundary/ErrorBoundary.d.ts.map +1 -0
  255. package/lib/typescript/src/components/ErrorBoundary/index.d.ts +3 -0
  256. package/lib/typescript/src/components/ErrorBoundary/index.d.ts.map +1 -0
  257. package/lib/typescript/src/components/MediaSection/index.d.ts.map +1 -1
  258. package/lib/typescript/src/components/PostTypeChoiceModal/style.d.ts +1 -2
  259. package/lib/typescript/src/components/PostTypeChoiceModal/style.d.ts.map +1 -1
  260. package/lib/typescript/src/components/Social/PostList/index.d.ts +1 -3
  261. package/lib/typescript/src/components/Social/PostList/index.d.ts.map +1 -1
  262. package/lib/typescript/src/hooks/useAuth.d.ts.map +1 -1
  263. package/lib/typescript/src/index.d.ts +3 -2
  264. package/lib/typescript/src/index.d.ts.map +1 -1
  265. package/lib/typescript/src/providers/amity-ui-kit-provider.d.ts.map +1 -1
  266. package/lib/typescript/src/providers/auth-provider.d.ts.map +1 -1
  267. package/lib/typescript/src/screens/LivestreamPlayer/index.d.ts.map +1 -1
  268. package/lib/typescript/src/types/auth.interface.d.ts +1 -0
  269. package/lib/typescript/src/types/auth.interface.d.ts.map +1 -1
  270. package/lib/typescript/src/types/user.interface.d.ts +1 -0
  271. package/lib/typescript/src/types/user.interface.d.ts.map +1 -1
  272. package/lib/typescript/src/util/postTypeChecker.d.ts +1 -1
  273. package/lib/typescript/src/util/postTypeChecker.d.ts.map +1 -1
  274. package/lib/typescript/src/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.d.ts.map +1 -1
  275. package/lib/typescript/src/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.d.ts.map +1 -1
  276. package/lib/typescript/src/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/CommentListItem.d.ts.map +1 -1
  277. package/lib/typescript/src/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/styles.d.ts +1 -0
  278. package/lib/typescript/src/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/styles.d.ts.map +1 -1
  279. package/lib/typescript/src/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/index.d.ts +1 -2
  280. package/lib/typescript/src/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/index.d.ts.map +1 -1
  281. package/lib/typescript/src/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/styles.d.ts +3 -5
  282. package/lib/typescript/src/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/styles.d.ts.map +1 -1
  283. package/lib/typescript/src/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.d.ts +1 -3
  284. package/lib/typescript/src/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.d.ts.map +1 -1
  285. package/lib/typescript/src/v4/PublicApi/Elements/ButtonWithIconElement/styles.d.ts +1 -0
  286. package/lib/typescript/src/v4/PublicApi/Elements/ButtonWithIconElement/styles.d.ts.map +1 -1
  287. package/lib/typescript/src/v4/PublicApi/Elements/CommonElements/AvatarElement.d.ts +1 -0
  288. package/lib/typescript/src/v4/PublicApi/Elements/CommonElements/AvatarElement.d.ts.map +1 -1
  289. package/lib/typescript/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.d.ts.map +1 -1
  290. package/lib/typescript/src/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.d.ts +1 -1
  291. package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.d.ts.map +1 -1
  292. package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.d.ts +8 -0
  293. package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.d.ts.map +1 -0
  294. package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.d.ts +70 -2
  295. package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.d.ts.map +1 -1
  296. package/lib/typescript/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.d.ts.map +1 -1
  297. package/lib/typescript/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.d.ts +1 -0
  298. package/lib/typescript/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.d.ts.map +1 -1
  299. package/lib/typescript/src/v4/PublicApi/Pages/AmityPostDetailPage/AmityPostDetailPage.d.ts +1 -0
  300. package/lib/typescript/src/v4/PublicApi/Pages/AmityPostDetailPage/AmityPostDetailPage.d.ts.map +1 -1
  301. package/lib/typescript/src/v4/PublicApi/Pages/AmitySocialGlobalSearchPage/AmitySocialGlobalSearchPage.d.ts.map +1 -1
  302. package/lib/typescript/src/v4/PublicApi/Pages/AmityUserProfilePage/AmityUserProfilePage.d.ts.map +1 -1
  303. package/lib/typescript/src/v4/component/LivestreamContent/index.d.ts +1 -1
  304. package/lib/typescript/src/v4/component/LivestreamContent/index.d.ts.map +1 -1
  305. package/lib/typescript/src/v4/component/MyAvatar/MyAvatar.d.ts.map +1 -1
  306. package/lib/typescript/src/v4/component/PollContent/PollResults.d.ts.map +1 -1
  307. package/lib/typescript/src/v4/component/PostContent/index.d.ts.map +1 -1
  308. package/lib/typescript/src/v4/component/RenderTextWithMention/RenderTextWithMention.d.ts.map +1 -1
  309. package/lib/typescript/src/v4/component/SearchResultItem/SearchResultItem.d.ts.map +1 -1
  310. package/lib/typescript/src/v4/component/Toast/styles.d.ts +1 -1
  311. package/lib/typescript/src/v4/component/Toast/styles.d.ts.map +1 -1
  312. package/lib/typescript/src/v4/constants/index.d.ts +2 -0
  313. package/lib/typescript/src/v4/constants/index.d.ts.map +1 -1
  314. package/lib/typescript/src/v4/enum/roomStatus.d.ts +9 -0
  315. package/lib/typescript/src/v4/enum/roomStatus.d.ts.map +1 -0
  316. package/lib/typescript/src/v4/features/room/hooks/useRoom.d.ts +2 -0
  317. package/lib/typescript/src/v4/features/room/hooks/useRoom.d.ts.map +1 -0
  318. package/lib/typescript/src/v4/hook/index.d.ts +2 -0
  319. package/lib/typescript/src/v4/hook/index.d.ts.map +1 -1
  320. package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts +3 -0
  321. package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts.map +1 -1
  322. package/lib/typescript/src/v4/hook/usePostSubscription.d.ts +4 -0
  323. package/lib/typescript/src/v4/hook/usePostSubscription.d.ts.map +1 -0
  324. package/lib/typescript/src/v4/hook/useRoomSubscription.d.ts +4 -0
  325. package/lib/typescript/src/v4/hook/useRoomSubscription.d.ts.map +1 -0
  326. package/lib/typescript/src/v4/index.d.ts +1 -0
  327. package/lib/typescript/src/v4/index.d.ts.map +1 -1
  328. package/lib/typescript/src/v4/routes/AmityPageRenderer.d.ts.map +1 -1
  329. package/lib/typescript/src/v4/routes/AmitySocialUIKitV4Navigator.d.ts.map +1 -1
  330. package/lib/typescript/src/v4/routes/RouteParamList.d.ts +2 -1
  331. package/lib/typescript/src/v4/routes/RouteParamList.d.ts.map +1 -1
  332. package/lib/typescript/src/v4/screen/GlobalBan/GlobalBan.d.ts +3 -0
  333. package/lib/typescript/src/v4/screen/GlobalBan/GlobalBan.d.ts.map +1 -0
  334. package/lib/typescript/src/v4/screen/GlobalBan/index.d.ts +2 -0
  335. package/lib/typescript/src/v4/screen/GlobalBan/index.d.ts.map +1 -0
  336. package/lib/typescript/src/v4/screen/GlobalBan/styles.d.ts +34 -0
  337. package/lib/typescript/src/v4/screen/GlobalBan/styles.d.ts.map +1 -0
  338. package/lib/typescript/src/v4/screen/PostDetail/index.d.ts.map +1 -1
  339. package/lib/typescript/src/v4/stores/slices/toast.d.ts +1 -0
  340. package/lib/typescript/src/v4/stores/slices/toast.d.ts.map +1 -1
  341. package/package.json +10 -4
  342. package/src/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.tsx +1 -1
  343. package/src/components/ErrorBoundary/ErrorBoundary.tsx +84 -0
  344. package/src/components/ErrorBoundary/index.ts +2 -0
  345. package/src/components/MediaSection/index.tsx +4 -6
  346. package/src/components/PostTypeChoiceModal/PostTypeChoiceModal.tsx +15 -15
  347. package/src/components/PostTypeChoiceModal/style.ts +1 -2
  348. package/src/components/Social/PostList/index.tsx +8 -6
  349. package/src/hooks/useAuth.ts +2 -0
  350. package/src/index.tsx +4 -2
  351. package/src/providers/Social/communities-sdk.ts +1 -1
  352. package/src/providers/amity-ui-kit-provider.tsx +33 -27
  353. package/src/providers/auth-provider.tsx +17 -7
  354. package/src/screens/CreateLivestream/CreateLivestream.tsx +17 -17
  355. package/src/screens/LivestreamPlayer/index.tsx +9 -15
  356. package/src/svg/svg-xml-list.ts +1 -1
  357. package/src/types/auth.interface.ts +1 -0
  358. package/src/types/user.interface.ts +1 -0
  359. package/src/util/postTypeChecker.ts +1 -1
  360. package/src/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.tsx +47 -31
  361. package/src/v4/PublicApi/Components/AmityPostCommentComponent/AmityPostCommentComponent.tsx +4 -11
  362. package/src/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/CommentListItem.tsx +39 -15
  363. package/src/v4/PublicApi/Components/AmityPostCommentComponent/CommentListItem/styles.ts +3 -2
  364. package/src/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/index.tsx +38 -23
  365. package/src/v4/PublicApi/Components/AmityPostCommentComponent/ReplyCommentList/styles.ts +5 -7
  366. package/src/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.tsx +2 -1
  367. package/src/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/DetailStyle.tsx +1 -1
  368. package/src/v4/PublicApi/Components/AmityPostEngagementActionsComponent/Components/FeedStyle.tsx +1 -1
  369. package/src/v4/PublicApi/Elements/ButtonWithIconElement/styles.ts +3 -2
  370. package/src/v4/PublicApi/Elements/CommonElements/AvatarElement.tsx +23 -10
  371. package/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.tsx +24 -25
  372. package/src/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.ts +2 -2
  373. package/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.tsx +273 -101
  374. package/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.tsx +48 -0
  375. package/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.ts +72 -3
  376. package/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.tsx +150 -155
  377. package/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.ts +3 -1
  378. package/src/v4/PublicApi/Pages/AmityPostDetailPage/AmityPostDetailPage.tsx +20 -1
  379. package/src/v4/PublicApi/Pages/AmitySocialGlobalSearchPage/AmitySocialGlobalSearchPage.tsx +0 -1
  380. package/src/v4/PublicApi/Pages/AmityUserProfilePage/AmityUserProfilePage.tsx +24 -7
  381. package/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.tsx +1 -1
  382. package/src/v4/assets/icons/poll.tsx +2 -2
  383. package/src/v4/component/LivestreamContent/index.tsx +22 -22
  384. package/src/v4/component/MyAvatar/MyAvatar.tsx +12 -6
  385. package/src/v4/component/PollContent/PollResults.tsx +1 -0
  386. package/src/v4/component/PostContent/index.tsx +6 -8
  387. package/src/v4/component/PostMenu/index.tsx +2 -2
  388. package/src/v4/component/RenderTextWithMention/RenderTextWithMention.tsx +16 -10
  389. package/src/v4/component/SearchResultItem/SearchResultItem.tsx +3 -0
  390. package/src/v4/component/Toast/index.tsx +1 -1
  391. package/src/v4/component/Toast/styles.ts +2 -2
  392. package/src/v4/constants/index.ts +4 -0
  393. package/src/v4/elements/CommunityCreatePostButton/CommunityCreatePostButton.tsx +1 -1
  394. package/src/v4/engine/AssetDownloader.ts +1 -1
  395. package/src/v4/enum/roomStatus.ts +8 -0
  396. package/src/v4/features/room/hooks/useRoom.ts +20 -0
  397. package/src/v4/hook/index.ts +2 -0
  398. package/src/v4/hook/useCustomRankingGlobalFeed.ts +1 -1
  399. package/src/v4/hook/usePostSubscription.ts +34 -0
  400. package/src/v4/hook/useRoomSubscription.ts +19 -0
  401. package/src/v4/index.tsx +1 -1
  402. package/src/v4/routes/AmityPageRenderer.tsx +6 -0
  403. package/src/v4/routes/AmitySocialUIKitV4Navigator.tsx +5 -1
  404. package/src/v4/routes/RouteParamList.tsx +2 -1
  405. package/src/v4/screen/GlobalBan/GlobalBan.tsx +38 -0
  406. package/src/v4/screen/GlobalBan/index.ts +1 -0
  407. package/src/v4/screen/GlobalBan/styles.ts +39 -0
  408. package/src/v4/screen/PostDetail/index.tsx +1 -0
  409. package/src/v4/stores/slices/toast.ts +5 -0
  410. package/uikit.config.json +1 -1
  411. package/lib/commonjs/v4/enum/livestreamStatus.js +0 -13
  412. package/lib/commonjs/v4/enum/livestreamStatus.js.map +0 -1
  413. package/lib/module/v4/enum/livestreamStatus.js +0 -7
  414. package/lib/module/v4/enum/livestreamStatus.js.map +0 -1
  415. package/lib/typescript/src/v4/enum/livestreamStatus.d.ts +0 -7
  416. package/lib/typescript/src/v4/enum/livestreamStatus.d.ts.map +0 -1
  417. package/src/v4/enum/livestreamStatus.ts +0 -6
@@ -8,7 +8,7 @@ export const useStyles = () => {
8
8
  const { height: screenHeight } = Dimensions.get('window');
9
9
  const insets = useSafeAreaInsets();
10
10
 
11
- const availableHeight = screenHeight - 80 - 60 - 40 - 40 - 120;
11
+ const availableHeight = screenHeight - 80 - 60 - 40 - 40 - 120 - 50;
12
12
  const styles = StyleSheet.create({
13
13
  container: {
14
14
  flex: 1,
@@ -26,7 +26,6 @@ export const useStyles = () => {
26
26
  },
27
27
  overlay: {
28
28
  flex: 1,
29
- height: '100%',
30
29
  top: 0,
31
30
  bottom: 0,
32
31
  left: 0,
@@ -158,12 +157,19 @@ export const useStyles = () => {
158
157
  text: {
159
158
  color: theme.colors.background,
160
159
  },
161
- timer: {
160
+
161
+ closeButton: {
162
162
  left: 16,
163
163
  zIndex: 100,
164
164
  position: 'absolute',
165
165
  top: 20 + insets.top,
166
166
  },
167
+ timer: {
168
+ right: 16,
169
+ zIndex: 100,
170
+ position: 'absolute',
171
+ top: 20 + insets.top,
172
+ },
167
173
  permission: {
168
174
  flex: 1,
169
175
  top: 80 + insets.top,
@@ -191,6 +197,69 @@ export const useStyles = () => {
191
197
  color: theme.colors.background,
192
198
  textAlign: 'center',
193
199
  },
200
+ containerRoom: {
201
+ flex: 1,
202
+ alignItems: 'stretch',
203
+ justifyContent: 'center',
204
+ padding: 10,
205
+ },
206
+ participantView: {
207
+ flex: 1,
208
+ margin: 5,
209
+ height: 200,
210
+ backgroundColor: '#ccc',
211
+ },
212
+ roomContainer: {
213
+ flex: 1,
214
+ width: '100%',
215
+ height: '100%',
216
+ },
217
+ videoTrack: {
218
+ width: '100%',
219
+ height: '100%',
220
+ },
221
+ countdownOverlay: {
222
+ position: 'absolute',
223
+ top: 0,
224
+ left: 0,
225
+ right: 0,
226
+ bottom: 80,
227
+ justifyContent: 'center',
228
+ alignItems: 'center',
229
+ backgroundColor: 'rgba(0, 0, 0, 0.7)',
230
+ zIndex: 150,
231
+ },
232
+ countdownContainer: {
233
+ alignItems: 'center',
234
+ gap: 24,
235
+ },
236
+ countdownCircle: {
237
+ position: 'relative',
238
+ alignItems: 'center',
239
+ justifyContent: 'center',
240
+ width: 72,
241
+ height: 72,
242
+ },
243
+ countdownNumberContainer: {
244
+ position: 'absolute',
245
+ top: 0,
246
+ left: 0,
247
+ right: 0,
248
+ bottom: 0,
249
+ alignItems: 'center',
250
+ justifyContent: 'center',
251
+ },
252
+ countdownNumber: {
253
+ fontSize: 32,
254
+ fontWeight: '700',
255
+ color: theme.colors.background,
256
+ },
257
+ countdownText: {
258
+ fontSize: 24,
259
+ fontWeight: '500',
260
+ color: theme.colors.background,
261
+ textAlign: 'center',
262
+ },
194
263
  });
195
264
 
196
265
  return styles;
@@ -1,131 +1,79 @@
1
- import React, { useEffect, useRef, useState } from 'react';
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 { LivestreamStatus } from '../../../enum/livestreamStatus';
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
- const usePostSubscription = (postId: string) => {
31
- const [subscribedPost, setSubscribedPost] = useState<Amity.Post>(null);
32
-
33
- useEffect(() => {
34
- let unsubscribe: () => void;
35
- if (postId) {
36
- unsubscribe = PostRepository.getPost(postId, ({ data }) => {
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 [livestream, setLivestream] = useState<Amity.Stream>();
70
-
71
- const { streamId, post } = route.params;
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 onStopPlayer = () => {
76
- ref.current && ref.current.pause();
77
- setIsPlaying(false);
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 = StreamRepository.getStreamById(
101
- streamId,
47
+ const unsubscribe = RoomRepository.getRoom(
48
+ roomId,
102
49
  ({ data, loading, error: streamError }) => {
103
50
  if (streamError) setError(streamError);
104
- if (!loading && data) setLivestream({ ...data });
51
+ if (!loading && data) setRoom({ ...data });
105
52
  }
106
53
  );
107
54
 
108
55
  return () => unsubscribe();
109
- }, [streamId]);
56
+ }, [roomId]);
110
57
 
111
58
  useEffect(() => {
112
- if (livestream?.isDeleted || subscribedPost?.isDeleted) {
113
- navigation.replace('PostDetail', { postId: subscribedPost?.postId });
59
+ if (room?.status === RoomStatus.live) {
60
+ setWasLive(true);
114
61
  }
115
- }, [livestream?.isDeleted, subscribedPost, navigation]);
62
+ }, [room?.status]);
116
63
 
117
64
  useEffect(() => {
118
- const isTerminated =
119
- livestream?.moderation?.terminateLabels &&
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', {
67
+ postId: subscribedPost?.postId,
68
+ isDeleted: subscribedPost?.isDeleted,
69
+ });
127
70
  }
128
- }, [livestream?.moderation?.terminateLabels, livestream?.status, navigation]);
71
+ }, [
72
+ navigation,
73
+ room?.isDeleted,
74
+ subscribedPost?.postId,
75
+ subscribedPost?.isDeleted,
76
+ ]);
129
77
 
130
78
  useEffect(() => {
131
79
  const unsubscribe = NetInfo.addEventListener((state) => {
@@ -134,24 +82,68 @@ function AmityLiveStreamPlayerPage() {
134
82
  return () => unsubscribe();
135
83
  }, []);
136
84
 
137
- if (!livestream || error)
85
+ useEffect(() => {
86
+ if (!room?.status) return;
87
+
88
+ const shouldEnd =
89
+ room.status === RoomStatus.ended ||
90
+ (room.status === RoomStatus.recorded && wasLive);
91
+
92
+ if (!shouldEnd || isStreamEnding.current) return;
93
+
94
+ isStreamEnding.current = true;
95
+ setIsPaused(true);
96
+
97
+ if (Platform.OS === 'ios') {
98
+ // iOS: ONLY dismiss fullscreen. DO NOT touch key. DO NOT unmount.
99
+ requestAnimationFrame(() => {
100
+ videoRef.current?.dismissFullscreenPlayer?.();
101
+ });
102
+ } else {
103
+ // Android: HARD destroy
104
+ setTimeout(() => {
105
+ setVideoKey((prev) => prev + 1);
106
+ }, 50);
107
+ }
108
+ }, [room?.status, wasLive]);
109
+
110
+ useEffect(() => {
111
+ if (room?.status === RoomStatus.terminated) {
112
+ navigation.replace('LivestreamTerminated', { type: 'viewer' });
113
+ }
114
+ }, [room?.status, navigation]);
115
+
116
+ const shouldShowEndThumbnail =
117
+ room?.status === RoomStatus.ended ||
118
+ (room?.status === RoomStatus.recorded && wasLive) ||
119
+ (room as any)?.user?.isGlobalBan;
120
+
121
+ if (!room || error) {
138
122
  return (
139
123
  <SafeAreaView style={styles.container}>
140
124
  <LiveStreamIdleThumbnail />
141
125
  </SafeAreaView>
142
126
  );
127
+ }
128
+
129
+ const closePlayer = () => {
130
+ navigation.goBack();
131
+ };
132
+
133
+ const videoUrl =
134
+ room.status === RoomStatus.recorded
135
+ ? room.recordedPlaybackInfos[0]?.url
136
+ : room.livePlaybackUrl;
143
137
 
144
138
  return (
145
139
  <SafeAreaView style={styles.container}>
146
- {livestream.status === LivestreamStatus.ended ? (
140
+ {shouldShowEndThumbnail ? (
147
141
  <>
148
142
  <View style={styles.steamEndContainer}>
149
143
  <LiveStreamEndThumbnail />
150
144
  </View>
151
- <TouchableOpacity
152
- style={styles.closeButton}
153
- onPress={navigation.goBack}
154
- >
145
+
146
+ <TouchableOpacity style={styles.closeButton} onPress={closePlayer}>
155
147
  <SvgXml
156
148
  xml={close()}
157
149
  width="28"
@@ -160,14 +152,65 @@ function AmityLiveStreamPlayerPage() {
160
152
  />
161
153
  </TouchableOpacity>
162
154
  </>
163
- ) : // <AmityStreamPlayer
164
- // ref={ref}
165
- // stream={livestream}
166
- // onBack={navigation.goBack}
167
- // status={livestream.status === 'live' ? 'live' : 'recorded'}
168
- // />
169
- null}
170
- {livestream.status === LivestreamStatus.live && reconnecting && (
155
+ ) : (
156
+ <View style={styles.container}>
157
+ {(room.status === RoomStatus.live ||
158
+ room.status === RoomStatus.waitingReconnect) && (
159
+ <View style={styles.indicator}>
160
+ <View style={styles.status}>
161
+ <Typography.CaptionBold style={styles.live}>
162
+ LIVE
163
+ </Typography.CaptionBold>
164
+ </View>
165
+ </View>
166
+ )}
167
+
168
+ {!shouldShowEndThumbnail && (
169
+ <Video
170
+ key={
171
+ Platform.OS === 'android' ? `${videoUrl}-${videoKey}` : videoUrl
172
+ }
173
+ ref={videoRef}
174
+ source={{
175
+ uri:
176
+ room.status === RoomStatus.recorded
177
+ ? room.recordedPlaybackInfos[0]?.url
178
+ : room.livePlaybackUrl,
179
+ headers: {
180
+ Authorization: `Bearer ${client?.token?.accessToken}`,
181
+ },
182
+ type: 'm3u8',
183
+ }}
184
+ style={styles.container}
185
+ resizeMode="cover"
186
+ controls={true}
187
+ fullscreenOrientation="landscape"
188
+ paused={isPaused}
189
+ muted={false}
190
+ volume={1.0}
191
+ audioOutput="speaker"
192
+ playInBackground={false}
193
+ playWhenInactive={false}
194
+ repeat={false}
195
+ onLoad={() => {
196
+ setIsVideoLoading(false);
197
+ if (room.status === RoomStatus.recorded) {
198
+ setIsPaused(false);
199
+ }
200
+ }}
201
+ />
202
+ )}
203
+
204
+ {isVideoLoading && (
205
+ <View style={styles.connecting}>
206
+ <CircularProgressIndicator size={40} strokeWidth={2} />
207
+ </View>
208
+ )}
209
+ </View>
210
+ )}
211
+
212
+ {((room.status === RoomStatus.live && reconnecting) ||
213
+ room.status === RoomStatus.waitingReconnect) && (
171
214
  <View style={styles.connecting}>
172
215
  <CircularProgressIndicator size={40} strokeWidth={2} />
173
216
  <Typography.TitleBold style={styles.text}>
@@ -179,54 +222,6 @@ function AmityLiveStreamPlayerPage() {
179
222
  </Typography.Caption>
180
223
  </View>
181
224
  )}
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
225
  </SafeAreaView>
231
226
  );
232
227
  }
@@ -13,14 +13,16 @@ export const useStyles = () => {
13
13
  position: 'relative',
14
14
  backgroundColor: '#000000',
15
15
  },
16
+
16
17
  steamEndContainer: {
17
18
  flex: 1,
18
19
  justifyContent: 'center',
20
+ backgroundColor: '#000000',
19
21
  },
20
22
  indicator: {
21
23
  left: 16,
22
24
  zIndex: 1,
23
- top: insets.top + 20,
25
+ top: 20,
24
26
  position: 'absolute',
25
27
  },
26
28
  status: {
@@ -40,6 +40,8 @@ import { closeIcon } from '../../../../svg/svg-xml-list';
40
40
  import { SvgXml } from 'react-native-svg';
41
41
  import { IMentionPosition } from '../../../../types';
42
42
  import uiSlice from '../../../../redux/slices/uiSlice';
43
+ import NetInfo from '@react-native-community/netinfo';
44
+ import { useToast } from '../../../../v4/stores/slices/toast';
43
45
  import MyAvatar from '../../../../v4/component/MyAvatar/MyAvatar';
44
46
  import {
45
47
  comment_contains_inapproproate_word,
@@ -64,6 +66,7 @@ type AmityPostDetailPageType = {
64
66
  isFromComponent?: boolean;
65
67
  showEndPopup?: boolean;
66
68
  category?: AmityPostCategory;
69
+ isDeleted?: boolean;
67
70
  };
68
71
 
69
72
  const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
@@ -71,6 +74,7 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
71
74
  isFromComponent,
72
75
  showEndPopup,
73
76
  category,
77
+ isDeleted,
74
78
  }) => {
75
79
  const pageId = PageID.post_detail_page;
76
80
  const dispatch = useUIKitDispatch();
@@ -80,6 +84,7 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
80
84
  useNavigation<NativeStackNavigationProp<RootStackParamList>>();
81
85
  const { isExcluded, themeStyles, accessibilityId } = useAmityPage({ pageId });
82
86
  const styles = useStyles(themeStyles);
87
+ const { showToast } = useToast();
83
88
  const [postData, setPostData] = useState<Amity.Post<any>>(null);
84
89
  const [loading, setLoading] = useState<boolean>(true);
85
90
 
@@ -108,6 +113,20 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
108
113
 
109
114
  const { showToastMessage } = uiSlice.actions;
110
115
 
116
+ useEffect(() => {
117
+ const unsubscribe = NetInfo.addEventListener((state) => {
118
+ if (!state.isConnected) {
119
+ showToast({
120
+ type: 'failed',
121
+ message: 'No internet connection.',
122
+ duration: 3000,
123
+ bottomPosition: 96,
124
+ });
125
+ }
126
+ });
127
+ return () => unsubscribe();
128
+ }, [showToast]);
129
+
111
130
  useLayoutEffect(() => {
112
131
  if (!postId) return () => {};
113
132
  setLoading(true);
@@ -304,7 +323,7 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
304
323
 
305
324
  if (isExcluded) return null;
306
325
 
307
- if (postData?.isDeleted) {
326
+ if (isDeleted || postData?.isDeleted) {
308
327
  return (
309
328
  <ErrorComponent
310
329
  themeStyle={themeStyles}
@@ -31,7 +31,6 @@ const AmitySocialGlobalSearchPage = () => {
31
31
  />
32
32
  </View>
33
33
  );
34
-
35
34
  const isCommunity = searchType === TabName.Communities;
36
35
  if (isExcluded) return null;
37
36
  return (
@@ -152,7 +152,9 @@ function UserProfile({
152
152
  </TouchableOpacity>
153
153
  ),
154
154
  headerLeft: () => {
155
- return isShowBackButton ? <BackButton onPress={handleGoBack} /> : null;
155
+ return isShowBackButton ? (
156
+ <BackButton goBack={false} onPress={handleGoBack} />
157
+ ) : null;
156
158
  },
157
159
  });
158
160
  }, [
@@ -174,17 +176,32 @@ function UserProfile({
174
176
  }, [client]);
175
177
 
176
178
  useEffect(() => {
177
- if (!user?.avatarFileId) {
178
- return setAvatar(defaultAvatarUri);
179
- }
180
- (async () => {
179
+ const loadAvatar = async () => {
180
+ if (!user) {
181
+ setAvatar(defaultAvatarUri);
182
+ return;
183
+ }
184
+
185
+ if (user.avatarCustomUrl) {
186
+ setAvatar(user.avatarCustomUrl);
187
+ return;
188
+ }
189
+
190
+ if (!user.avatarFileId) {
191
+ setAvatar(defaultAvatarUri);
192
+ return;
193
+ }
194
+
181
195
  const avatarUrl = await getImage({
182
196
  fileId: user.avatarFileId,
183
197
  imageSize: ImageSizeState.small,
184
198
  });
199
+
185
200
  setAvatar(avatarUrl ?? defaultAvatarUri);
186
- })();
187
- }, [getImage, user?.avatarFileId]);
201
+ };
202
+
203
+ loadAvatar();
204
+ }, [getImage, user]);
188
205
 
189
206
  useFocusEffect(
190
207
  useCallback(() => {
@@ -43,7 +43,7 @@ import { Typography } from '../../../../component/Typography/Typography';
43
43
  import { useTheme } from 'react-native-paper';
44
44
  import { MyMD3Theme } from '../../../../../providers/amity-ui-kit-provider';
45
45
  import { useUIKitDispatch } from '../../../../../redux/store';
46
- import { informative } from '~/v4/assets/icons/toast';
46
+ import { informative } from '../../../../../v4/assets/icons/toast';
47
47
  import { close as closeIcon } from '../../../../assets/icons';
48
48
 
49
49
  interface IAmityViewStoryItem {
@@ -1,6 +1,6 @@
1
1
  export const icon =
2
- () => `<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <path d="M18.1875 4.375C19.1016 4.375 19.875 5.14844 19.875 6.0625V18.4375C19.875 19.3867 19.1016 20.125 18.1875 20.125H5.8125C4.86328 20.125 4.125 19.3867 4.125 18.4375V6.0625C4.125 5.14844 4.86328 4.375 5.8125 4.375H18.1875ZM18.1875 18.4375V6.0625H5.8125V18.4375H18.1875ZM8.34375 16.75C8.02734 16.75 7.78125 16.5039 7.78125 16.1875V11.6875C7.78125 11.4062 8.02734 11.125 8.34375 11.125H8.90625C9.1875 11.125 9.46875 11.4062 9.46875 11.6875V16.1875C9.46875 16.5039 9.1875 16.75 8.90625 16.75H8.34375ZM11.7188 16.75C11.4023 16.75 11.1562 16.5039 11.1562 16.1875V8.3125C11.1562 8.03125 11.4023 7.75 11.7188 7.75H12.2812C12.5625 7.75 12.8438 8.03125 12.8438 8.3125V16.1875C12.8438 16.5039 12.5625 16.75 12.2812 16.75H11.7188ZM15.0938 16.75C14.7773 16.75 14.5312 16.5039 14.5312 16.1875V13.9375C14.5312 13.6562 14.7773 13.375 15.0938 13.375H15.6562C15.9375 13.375 16.2188 13.6562 16.2188 13.9375V16.1875C16.2188 16.5039 15.9375 16.75 15.6562 16.75H15.0938Z" fill="currentColor"/>
2
+ () => `<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M16.1875 2.375C17.1016 2.375 17.875 3.14844 17.875 4.0625V16.4375C17.875 17.3867 17.1016 18.125 16.1875 18.125H3.8125C2.86328 18.125 2.125 17.3867 2.125 16.4375V4.0625C2.125 3.14844 2.86328 2.375 3.8125 2.375H16.1875ZM16.1875 16.4375V4.0625H3.8125V16.4375H16.1875ZM6.34375 14.75C6.02734 14.75 5.78125 14.5039 5.78125 14.1875V9.6875C5.78125 9.40625 6.02734 9.125 6.34375 9.125H6.90625C7.1875 9.125 7.46875 9.40625 7.46875 9.6875V14.1875C7.46875 14.5039 7.1875 14.75 6.90625 14.75H6.34375ZM9.71875 14.75C9.40234 14.75 9.15625 14.5039 9.15625 14.1875V6.3125C9.15625 6.03125 9.40234 5.75 9.71875 5.75H10.2812C10.5625 5.75 10.8438 6.03125 10.8438 6.3125V14.1875C10.8438 14.5039 10.5625 14.75 10.2812 14.75H9.71875ZM13.0938 14.75C12.7773 14.75 12.5312 14.5039 12.5312 14.1875V11.9375C12.5312 11.6562 12.7773 11.375 13.0938 11.375H13.6562C13.9375 11.375 14.2188 11.6562 14.2188 11.9375V14.1875C14.2188 14.5039 13.9375 14.75 13.6562 14.75H13.0938Z" fill="currentColor" style="fill:currentColor;fill:color(display-p3 0.1624 0.1694 0.1976);fill-opacity:1;"/>
4
4
  </svg>
5
5
  `;
6
6