@amityco/react-native-social-uikit 4.0.0-c2327e7.0 → 4.0.0-d2b8337.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 (293) hide show
  1. package/lib/commonjs/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js +1 -1
  2. package/lib/commonjs/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js.map +1 -1
  3. package/lib/commonjs/components/MediaSection/index.js +3 -3
  4. package/lib/commonjs/components/MediaSection/index.js.map +1 -1
  5. package/lib/commonjs/components/PostTypeChoiceModal/PostTypeChoiceModal.js +5 -14
  6. package/lib/commonjs/components/PostTypeChoiceModal/PostTypeChoiceModal.js.map +1 -1
  7. package/lib/commonjs/components/PostTypeChoiceModal/style.js +2 -1
  8. package/lib/commonjs/components/PostTypeChoiceModal/style.js.map +1 -1
  9. package/lib/commonjs/components/Social/PostList/index.js +3 -1
  10. package/lib/commonjs/components/Social/PostList/index.js.map +1 -1
  11. package/lib/commonjs/components/Toast/Toast.js +2 -1
  12. package/lib/commonjs/components/Toast/Toast.js.map +1 -1
  13. package/lib/commonjs/index.js +0 -6
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/commonjs/providers/file-provider.js +38 -19
  16. package/lib/commonjs/providers/file-provider.js.map +1 -1
  17. package/lib/commonjs/screens/CreateLivestream/CreateLivestream.js +16 -16
  18. package/lib/commonjs/screens/CreateLivestream/CreateLivestream.js.map +1 -1
  19. package/lib/commonjs/screens/LivestreamPlayer/index.js +6 -3
  20. package/lib/commonjs/screens/LivestreamPlayer/index.js.map +1 -1
  21. package/lib/commonjs/svg/svg-xml-list.js +7 -2
  22. package/lib/commonjs/svg/svg-xml-list.js.map +1 -1
  23. package/lib/commonjs/util/postTypeChecker.js.map +1 -1
  24. package/lib/commonjs/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js +9 -11
  25. package/lib/commonjs/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js.map +1 -1
  26. package/lib/commonjs/v4/PublicApi/Elements/ButtonWithIconElement/styles.js +2 -3
  27. package/lib/commonjs/v4/PublicApi/Elements/ButtonWithIconElement/styles.js.map +1 -1
  28. package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +25 -28
  29. package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
  30. package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js +2 -2
  31. package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js.map +1 -1
  32. package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js +68 -206
  33. package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js.map +1 -1
  34. package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js +3 -71
  35. package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js.map +1 -1
  36. package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js +117 -120
  37. package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js.map +1 -1
  38. package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.js.map +1 -1
  39. package/lib/commonjs/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.js +37 -1
  40. package/lib/commonjs/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.js.map +1 -1
  41. package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +54 -21
  42. package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
  43. package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/styles.js +24 -2
  44. package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/styles.js.map +1 -1
  45. package/lib/commonjs/v4/assets/icons/toast.js +6 -6
  46. package/lib/commonjs/v4/assets/icons/toast.js.map +1 -1
  47. package/lib/commonjs/v4/component/CommunityStories/index.js +9 -4
  48. package/lib/commonjs/v4/component/CommunityStories/index.js.map +1 -1
  49. package/lib/commonjs/v4/component/CommunityStories/styles.js +7 -2
  50. package/lib/commonjs/v4/component/CommunityStories/styles.js.map +1 -1
  51. package/lib/commonjs/v4/component/LivestreamContent/index.js +12 -12
  52. package/lib/commonjs/v4/component/LivestreamContent/index.js.map +1 -1
  53. package/lib/commonjs/v4/component/LoadingImage/index.js +22 -25
  54. package/lib/commonjs/v4/component/LoadingImage/index.js.map +1 -1
  55. package/lib/commonjs/v4/component/LoadingImage/styles.js +19 -2
  56. package/lib/commonjs/v4/component/LoadingImage/styles.js.map +1 -1
  57. package/lib/commonjs/v4/component/LoadingVideo/index.js +12 -6
  58. package/lib/commonjs/v4/component/LoadingVideo/index.js.map +1 -1
  59. package/lib/commonjs/v4/component/MyStories/StoryCircleItem.js +11 -4
  60. package/lib/commonjs/v4/component/MyStories/StoryCircleItem.js.map +1 -1
  61. package/lib/commonjs/v4/component/MyStories/styles.js +5 -0
  62. package/lib/commonjs/v4/component/MyStories/styles.js.map +1 -1
  63. package/lib/commonjs/v4/component/PostContent/index.js +4 -4
  64. package/lib/commonjs/v4/component/PostContent/index.js.map +1 -1
  65. package/lib/commonjs/v4/component/PostMenu/index.js +2 -2
  66. package/lib/commonjs/v4/component/PostMenu/index.js.map +1 -1
  67. package/lib/commonjs/v4/component/Toast/index.js +4 -4
  68. package/lib/commonjs/v4/component/Toast/index.js.map +1 -1
  69. package/lib/commonjs/v4/component/Toast/styles.js +2 -2
  70. package/lib/commonjs/v4/component/Toast/styles.js.map +1 -1
  71. package/lib/commonjs/v4/enum/livestreamStatus.js +13 -0
  72. package/lib/commonjs/v4/enum/livestreamStatus.js.map +1 -0
  73. package/lib/commonjs/v4/hook/index.js +0 -22
  74. package/lib/commonjs/v4/hook/index.js.map +1 -1
  75. package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js +3 -1
  76. package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
  77. package/lib/commonjs/v4/index.js +0 -7
  78. package/lib/commonjs/v4/index.js.map +1 -1
  79. package/lib/commonjs/v4/stores/slices/toast.js +1 -4
  80. package/lib/commonjs/v4/stores/slices/toast.js.map +1 -1
  81. package/lib/module/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js +1 -1
  82. package/lib/module/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js.map +1 -1
  83. package/lib/module/components/MediaSection/index.js +3 -3
  84. package/lib/module/components/MediaSection/index.js.map +1 -1
  85. package/lib/module/components/PostTypeChoiceModal/PostTypeChoiceModal.js +8 -15
  86. package/lib/module/components/PostTypeChoiceModal/PostTypeChoiceModal.js.map +1 -1
  87. package/lib/module/components/PostTypeChoiceModal/style.js +2 -1
  88. package/lib/module/components/PostTypeChoiceModal/style.js.map +1 -1
  89. package/lib/module/components/Social/PostList/index.js +3 -1
  90. package/lib/module/components/Social/PostList/index.js.map +1 -1
  91. package/lib/module/components/Toast/Toast.js +2 -1
  92. package/lib/module/components/Toast/Toast.js.map +1 -1
  93. package/lib/module/index.js +6 -2
  94. package/lib/module/index.js.map +1 -1
  95. package/lib/module/providers/file-provider.js +38 -19
  96. package/lib/module/providers/file-provider.js.map +1 -1
  97. package/lib/module/screens/CreateLivestream/CreateLivestream.js +17 -17
  98. package/lib/module/screens/CreateLivestream/CreateLivestream.js.map +1 -1
  99. package/lib/module/screens/LivestreamPlayer/index.js +8 -4
  100. package/lib/module/screens/LivestreamPlayer/index.js.map +1 -1
  101. package/lib/module/svg/svg-xml-list.js +5 -1
  102. package/lib/module/svg/svg-xml-list.js.map +1 -1
  103. package/lib/module/util/postTypeChecker.js.map +1 -1
  104. package/lib/module/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js +9 -11
  105. package/lib/module/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js.map +1 -1
  106. package/lib/module/v4/PublicApi/Elements/ButtonWithIconElement/styles.js +2 -3
  107. package/lib/module/v4/PublicApi/Elements/ButtonWithIconElement/styles.js.map +1 -1
  108. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +26 -29
  109. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
  110. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js +2 -2
  111. package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js.map +1 -1
  112. package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js +72 -211
  113. package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js.map +1 -1
  114. package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js +3 -71
  115. package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js.map +1 -1
  116. package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js +120 -123
  117. package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js.map +1 -1
  118. package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.js.map +1 -1
  119. package/lib/module/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.js +37 -1
  120. package/lib/module/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.js.map +1 -1
  121. package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +54 -21
  122. package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
  123. package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/styles.js +24 -2
  124. package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/styles.js.map +1 -1
  125. package/lib/module/v4/assets/icons/toast.js +6 -6
  126. package/lib/module/v4/assets/icons/toast.js.map +1 -1
  127. package/lib/module/v4/component/CommunityStories/index.js +10 -5
  128. package/lib/module/v4/component/CommunityStories/index.js.map +1 -1
  129. package/lib/module/v4/component/CommunityStories/styles.js +7 -2
  130. package/lib/module/v4/component/CommunityStories/styles.js.map +1 -1
  131. package/lib/module/v4/component/LivestreamContent/index.js +13 -13
  132. package/lib/module/v4/component/LivestreamContent/index.js.map +1 -1
  133. package/lib/module/v4/component/LoadingImage/index.js +22 -24
  134. package/lib/module/v4/component/LoadingImage/index.js.map +1 -1
  135. package/lib/module/v4/component/LoadingImage/styles.js +19 -2
  136. package/lib/module/v4/component/LoadingImage/styles.js.map +1 -1
  137. package/lib/module/v4/component/LoadingVideo/index.js +12 -6
  138. package/lib/module/v4/component/LoadingVideo/index.js.map +1 -1
  139. package/lib/module/v4/component/MyStories/StoryCircleItem.js +13 -6
  140. package/lib/module/v4/component/MyStories/StoryCircleItem.js.map +1 -1
  141. package/lib/module/v4/component/MyStories/styles.js +5 -0
  142. package/lib/module/v4/component/MyStories/styles.js.map +1 -1
  143. package/lib/module/v4/component/PostContent/index.js +4 -4
  144. package/lib/module/v4/component/PostContent/index.js.map +1 -1
  145. package/lib/module/v4/component/PostMenu/index.js +2 -2
  146. package/lib/module/v4/component/PostMenu/index.js.map +1 -1
  147. package/lib/module/v4/component/Toast/index.js +4 -4
  148. package/lib/module/v4/component/Toast/index.js.map +1 -1
  149. package/lib/module/v4/component/Toast/styles.js +2 -2
  150. package/lib/module/v4/component/Toast/styles.js.map +1 -1
  151. package/lib/module/v4/enum/livestreamStatus.js +7 -0
  152. package/lib/module/v4/enum/livestreamStatus.js.map +1 -0
  153. package/lib/module/v4/hook/index.js +0 -2
  154. package/lib/module/v4/hook/index.js.map +1 -1
  155. package/lib/module/v4/hook/useCustomRankingGlobalFeed.js +3 -1
  156. package/lib/module/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
  157. package/lib/module/v4/index.js +1 -1
  158. package/lib/module/v4/index.js.map +1 -1
  159. package/lib/module/v4/stores/slices/toast.js +1 -4
  160. package/lib/module/v4/stores/slices/toast.js.map +1 -1
  161. package/lib/typescript/src/components/MediaSection/index.d.ts.map +1 -1
  162. package/lib/typescript/src/components/PostTypeChoiceModal/style.d.ts +2 -1
  163. package/lib/typescript/src/components/PostTypeChoiceModal/style.d.ts.map +1 -1
  164. package/lib/typescript/src/components/Social/PostList/index.d.ts +3 -1
  165. package/lib/typescript/src/components/Social/PostList/index.d.ts.map +1 -1
  166. package/lib/typescript/src/components/Toast/Toast.d.ts.map +1 -1
  167. package/lib/typescript/src/index.d.ts +2 -2
  168. package/lib/typescript/src/index.d.ts.map +1 -1
  169. package/lib/typescript/src/providers/file-provider.d.ts.map +1 -1
  170. package/lib/typescript/src/screens/LivestreamPlayer/index.d.ts.map +1 -1
  171. package/lib/typescript/src/svg/svg-xml-list.d.ts +1 -0
  172. package/lib/typescript/src/svg/svg-xml-list.d.ts.map +1 -1
  173. package/lib/typescript/src/util/postTypeChecker.d.ts +1 -1
  174. package/lib/typescript/src/util/postTypeChecker.d.ts.map +1 -1
  175. package/lib/typescript/src/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.d.ts +3 -1
  176. package/lib/typescript/src/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.d.ts.map +1 -1
  177. package/lib/typescript/src/v4/PublicApi/Elements/ButtonWithIconElement/styles.d.ts +0 -1
  178. package/lib/typescript/src/v4/PublicApi/Elements/ButtonWithIconElement/styles.d.ts.map +1 -1
  179. package/lib/typescript/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.d.ts.map +1 -1
  180. package/lib/typescript/src/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.d.ts +1 -1
  181. package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.d.ts.map +1 -1
  182. package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.d.ts +2 -70
  183. package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.d.ts.map +1 -1
  184. package/lib/typescript/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.d.ts.map +1 -1
  185. package/lib/typescript/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.d.ts.map +1 -1
  186. package/lib/typescript/src/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.d.ts.map +1 -1
  187. package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.d.ts.map +1 -1
  188. package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/styles.d.ts +22 -0
  189. package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/styles.d.ts.map +1 -1
  190. package/lib/typescript/src/v4/assets/icons/toast.d.ts +3 -3
  191. package/lib/typescript/src/v4/assets/icons/toast.d.ts.map +1 -1
  192. package/lib/typescript/src/v4/component/CommunityStories/index.d.ts.map +1 -1
  193. package/lib/typescript/src/v4/component/CommunityStories/styles.d.ts +5 -0
  194. package/lib/typescript/src/v4/component/CommunityStories/styles.d.ts.map +1 -1
  195. package/lib/typescript/src/v4/component/LivestreamContent/index.d.ts +1 -1
  196. package/lib/typescript/src/v4/component/LivestreamContent/index.d.ts.map +1 -1
  197. package/lib/typescript/src/v4/component/LoadingImage/index.d.ts +2 -1
  198. package/lib/typescript/src/v4/component/LoadingImage/index.d.ts.map +1 -1
  199. package/lib/typescript/src/v4/component/LoadingImage/styles.d.ts +21 -0
  200. package/lib/typescript/src/v4/component/LoadingImage/styles.d.ts.map +1 -1
  201. package/lib/typescript/src/v4/component/LoadingVideo/index.d.ts +2 -1
  202. package/lib/typescript/src/v4/component/LoadingVideo/index.d.ts.map +1 -1
  203. package/lib/typescript/src/v4/component/MyStories/StoryCircleItem.d.ts.map +1 -1
  204. package/lib/typescript/src/v4/component/MyStories/styles.d.ts +5 -0
  205. package/lib/typescript/src/v4/component/MyStories/styles.d.ts.map +1 -1
  206. package/lib/typescript/src/v4/component/PostContent/index.d.ts.map +1 -1
  207. package/lib/typescript/src/v4/component/Toast/styles.d.ts +1 -1
  208. package/lib/typescript/src/v4/component/Toast/styles.d.ts.map +1 -1
  209. package/lib/typescript/src/v4/enum/livestreamStatus.d.ts +7 -0
  210. package/lib/typescript/src/v4/enum/livestreamStatus.d.ts.map +1 -0
  211. package/lib/typescript/src/v4/hook/index.d.ts +0 -2
  212. package/lib/typescript/src/v4/hook/index.d.ts.map +1 -1
  213. package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts +0 -3
  214. package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts.map +1 -1
  215. package/lib/typescript/src/v4/index.d.ts +0 -1
  216. package/lib/typescript/src/v4/index.d.ts.map +1 -1
  217. package/lib/typescript/src/v4/routes/RouteParamList.d.ts +1 -1
  218. package/lib/typescript/src/v4/routes/RouteParamList.d.ts.map +1 -1
  219. package/lib/typescript/src/v4/stores/slices/toast.d.ts +0 -1
  220. package/lib/typescript/src/v4/stores/slices/toast.d.ts.map +1 -1
  221. package/package.json +3 -6
  222. package/src/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.tsx +1 -1
  223. package/src/components/MediaSection/index.tsx +6 -4
  224. package/src/components/PostTypeChoiceModal/PostTypeChoiceModal.tsx +15 -15
  225. package/src/components/PostTypeChoiceModal/style.ts +2 -1
  226. package/src/components/Social/PostList/index.tsx +4 -1
  227. package/src/components/Toast/Toast.tsx +1 -0
  228. package/src/index.tsx +2 -2
  229. package/src/providers/file-provider.tsx +42 -20
  230. package/src/screens/CreateLivestream/CreateLivestream.tsx +17 -17
  231. package/src/screens/LivestreamPlayer/index.tsx +15 -9
  232. package/src/svg/svg-xml-list.ts +7 -1
  233. package/src/util/postTypeChecker.ts +1 -1
  234. package/src/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.tsx +10 -10
  235. package/src/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.tsx +1 -1
  236. package/src/v4/PublicApi/Elements/ButtonWithIconElement/styles.ts +2 -3
  237. package/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.tsx +25 -24
  238. package/src/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.ts +2 -2
  239. package/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.tsx +89 -241
  240. package/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.ts +3 -72
  241. package/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.tsx +148 -135
  242. package/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.ts +0 -1
  243. package/src/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.tsx +46 -0
  244. package/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.tsx +122 -57
  245. package/src/v4/PublicApi/Pages/AmityViewStoryPage/styles.ts +23 -1
  246. package/src/v4/assets/icons/toast.tsx +12 -9
  247. package/src/v4/component/CommunityStories/index.tsx +26 -17
  248. package/src/v4/component/CommunityStories/styles.ts +7 -2
  249. package/src/v4/component/LivestreamContent/index.tsx +22 -21
  250. package/src/v4/component/LoadingImage/index.tsx +28 -25
  251. package/src/v4/component/LoadingImage/styles.ts +17 -0
  252. package/src/v4/component/LoadingVideo/index.tsx +13 -7
  253. package/src/v4/component/MyStories/StoryCircleItem.tsx +19 -12
  254. package/src/v4/component/MyStories/styles.ts +5 -0
  255. package/src/v4/component/PostContent/index.tsx +8 -6
  256. package/src/v4/component/PostMenu/index.tsx +2 -2
  257. package/src/v4/component/Toast/index.tsx +1 -1
  258. package/src/v4/component/Toast/styles.ts +2 -2
  259. package/src/v4/enum/livestreamStatus.ts +6 -0
  260. package/src/v4/hook/index.ts +0 -2
  261. package/src/v4/hook/useCustomRankingGlobalFeed.ts +1 -1
  262. package/src/v4/index.tsx +1 -1
  263. package/src/v4/routes/RouteParamList.tsx +1 -1
  264. package/src/v4/stores/slices/toast.ts +0 -5
  265. package/uikit.config.json +1 -1
  266. package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js +0 -50
  267. package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js.map +0 -1
  268. package/lib/commonjs/v4/enum/roomStatus.js +0 -14
  269. package/lib/commonjs/v4/enum/roomStatus.js.map +0 -1
  270. package/lib/commonjs/v4/hook/usePostSubscription.js +0 -38
  271. package/lib/commonjs/v4/hook/usePostSubscription.js.map +0 -1
  272. package/lib/commonjs/v4/hook/useRoomSubscription.js +0 -22
  273. package/lib/commonjs/v4/hook/useRoomSubscription.js.map +0 -1
  274. package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js +0 -42
  275. package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js.map +0 -1
  276. package/lib/module/v4/enum/roomStatus.js +0 -8
  277. package/lib/module/v4/enum/roomStatus.js.map +0 -1
  278. package/lib/module/v4/hook/usePostSubscription.js +0 -31
  279. package/lib/module/v4/hook/usePostSubscription.js.map +0 -1
  280. package/lib/module/v4/hook/useRoomSubscription.js +0 -15
  281. package/lib/module/v4/hook/useRoomSubscription.js.map +0 -1
  282. package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.d.ts +0 -8
  283. package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.d.ts.map +0 -1
  284. package/lib/typescript/src/v4/enum/roomStatus.d.ts +0 -8
  285. package/lib/typescript/src/v4/enum/roomStatus.d.ts.map +0 -1
  286. package/lib/typescript/src/v4/hook/usePostSubscription.d.ts +0 -4
  287. package/lib/typescript/src/v4/hook/usePostSubscription.d.ts.map +0 -1
  288. package/lib/typescript/src/v4/hook/useRoomSubscription.d.ts +0 -4
  289. package/lib/typescript/src/v4/hook/useRoomSubscription.d.ts.map +0 -1
  290. package/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.tsx +0 -48
  291. package/src/v4/enum/roomStatus.ts +0 -7
  292. package/src/v4/hook/usePostSubscription.ts +0 -34
  293. package/src/v4/hook/useRoomSubscription.ts +0 -19
@@ -43,6 +43,8 @@ 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';
47
+ import { close as closeIcon } from '../../../../assets/icons';
46
48
 
47
49
  interface IAmityViewStoryItem {
48
50
  communityData: Amity.Community;
@@ -96,7 +98,6 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
96
98
  const [isLiked, setIsLiked] = useState<boolean>(myReactions?.length > 0);
97
99
  const [openCommentSheet, setOpenCommentSheet] = useState(false);
98
100
  const [load, setLoad] = useState(true);
99
- const [error, setError] = useState(false);
100
101
  const [loading, setLoading] = useState(false);
101
102
  const dispatch = useUIKitDispatch();
102
103
  const { showToastMessage } = uiSlice.actions;
@@ -248,10 +249,20 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
248
249
  );
249
250
  if (deleted) {
250
251
  current === 0 && previous();
251
- dispatch(showToastMessage({ toastMessage: 'Story deleted' }));
252
+ dispatch(
253
+ showToastMessage({
254
+ toastMessage: 'Story deleted',
255
+ isSuccessToast: true,
256
+ })
257
+ );
252
258
  }
253
259
  } catch (err) {
254
- dispatch(showToastMessage({ toastMessage: 'Delete Story Error!' }));
260
+ dispatch(
261
+ showToastMessage({
262
+ toastMessage: 'Failed to delete story. Please try again.',
263
+ isSuccessToast: false,
264
+ })
265
+ );
255
266
  } finally {
256
267
  setLoading(false);
257
268
  sheetRef?.current?.close();
@@ -288,6 +299,30 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
288
299
  sheetRef.current?.open();
289
300
  }, [progress]);
290
301
 
302
+ const onPressMenuButtonFailed = useCallback(() => {
303
+ progress.stopAnimation(() => setPressed(true));
304
+ Alert.alert(
305
+ 'Failed to upload story',
306
+ 'Would you like to discard uploading?',
307
+ [
308
+ { text: 'Cancel', onPress: () => sheetRef?.current?.close() },
309
+ { text: 'Delete', style: 'destructive', onPress: deleteStory },
310
+ ]
311
+ );
312
+ }, [deleteStory, progress]);
313
+
314
+ const isFailedImageUpload =
315
+ currentStory?.dataType === 'image' &&
316
+ (currentStory?.syncState === 'error' ||
317
+ currentStory?.syncState === 'syncing' ||
318
+ !currentStory?.imageData?.fileUrl);
319
+
320
+ const isFailedVideoUpload =
321
+ currentStory?.dataType === 'video' &&
322
+ (currentStory?.syncState === 'error' ||
323
+ currentStory?.syncState === 'syncing' ||
324
+ !currentStory?.videoData?.fileUrl);
325
+
291
326
  return (
292
327
  <View style={[styles.container]}>
293
328
  <SafeAreaView>
@@ -296,7 +331,13 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
296
331
  <Video
297
332
  onLoadStart={() => setLoad(true)}
298
333
  onProgress={({ currentTime }) => setCurrentSeek(currentTime)}
299
- source={{ uri: currentStory?.videoData.fileUrl }}
334
+ source={{
335
+ uri:
336
+ currentStory?.videoData?.fileUrl ||
337
+ (typeof currentStory?.data?.fileData === 'string'
338
+ ? currentStory?.data?.fileData
339
+ : ''),
340
+ }}
300
341
  style={styles.video}
301
342
  resizeMode="contain"
302
343
  controls={false}
@@ -308,12 +349,15 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
308
349
  ) : currentStory?.dataType === 'image' ? (
309
350
  <Image
310
351
  onLoadStart={() => setLoad(true)}
311
- onError={({ nativeEvent: { error: err } }) =>
312
- err && setError(true)
313
- }
314
352
  onLoadEnd={() => start()}
315
- source={{ uri: currentStory?.imageData.fileUrl }}
316
- style={[styles.image]}
353
+ source={{
354
+ uri:
355
+ currentStory?.imageData?.fileUrl ||
356
+ (typeof currentStory?.data?.fileData === 'string'
357
+ ? currentStory?.data?.fileData
358
+ : ''),
359
+ }}
360
+ style={[styles.image, isFailedImageUpload && { opacity: 0.6 }]}
317
361
  resizeMode="contain"
318
362
  />
319
363
  ) : null}
@@ -322,11 +366,6 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
322
366
  <ActivityIndicator size="large" color={'white'} />
323
367
  </View>
324
368
  )}
325
- {error && (
326
- <View style={styles.spinnerContainer}>
327
- <Text style={styles.error}>Story load error</Text>
328
- </View>
329
- )}
330
369
  </View>
331
370
  </SafeAreaView>
332
371
  <GestureRecognizer onSwipeUp={onPressComment} style={styles.flexCol}>
@@ -399,7 +438,12 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
399
438
  </TouchableOpacity>
400
439
  )}
401
440
  <TouchableOpacity hitSlop={5} onPress={() => onClose()}>
402
- <Text style={styles.whiteText}>X</Text>
441
+ <SvgXml
442
+ xml={closeIcon()}
443
+ width="28"
444
+ height="28"
445
+ color="white"
446
+ />
403
447
  </TouchableOpacity>
404
448
  </View>
405
449
  </View>
@@ -465,49 +509,70 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
465
509
  </TouchableOpacity>
466
510
  )}
467
511
  </GestureRecognizer>
468
- <View style={styles.footer}>
469
- {hasStoryImpressionPermission ? (
470
- <TouchableOpacity
471
- style={[
472
- styles.seenContainer,
473
- { backgroundColor: storyViewerBgColor },
474
- ]}
475
- >
476
- <SvgXml xml={seenIcon()} width="25" height="25" />
477
- <Text style={styles.seen}>{reachCount}</Text>
478
- </TouchableOpacity>
479
- ) : (
480
- <View style={styles.seenContainer} />
481
- )}
482
- <View style={styles.seenContainer}>
483
- <TouchableOpacity
484
- style={[
485
- styles.iconContainer,
486
- { backgroundColor: storyCommentBgColor },
487
- ]}
488
- onPress={onPressComment}
489
- >
490
- <SvgXml xml={storyCommentIcon()} width="25" height="25" />
491
- <Text style={styles.seen}>{commentsCounts}</Text>
492
- </TouchableOpacity>
493
- <TouchableOpacity
494
- style={[
495
- styles.iconContainer,
496
- {
497
- backgroundColor: storyReactionBgColor,
498
- },
499
- ]}
500
- onPress={onPressReaction}
501
- >
502
- <SvgXml
503
- xml={isLiked ? storyLikedIcon : storyLikeIcon}
504
- width="25"
505
- height="25"
506
- />
507
- <Text style={styles.seen}>{totalReaction}</Text>
508
- </TouchableOpacity>
512
+ {(isFailedImageUpload || isFailedVideoUpload) && hasStoryPermission ? (
513
+ <View style={styles.errorContainer}>
514
+ <View style={styles.errorContainerLeft}>
515
+ <SvgXml xml={informative('white')} width="20" height="20" />
516
+ <Typography.Body style={styles.errorText}>
517
+ Failed to upload story
518
+ </Typography.Body>
519
+ </View>
520
+ {
521
+ <TouchableOpacity
522
+ hitSlop={5}
523
+ style={styles.threeDotsMenu}
524
+ onPress={onPressMenuButtonFailed}
525
+ >
526
+ <SvgXml xml={storyThreedotsMenu()} width="20" height="20" />
527
+ </TouchableOpacity>
528
+ }
509
529
  </View>
510
- </View>
530
+ ) : (
531
+ <View style={styles.footer}>
532
+ {hasStoryImpressionPermission ? (
533
+ <TouchableOpacity
534
+ style={[
535
+ styles.seenContainer,
536
+ { backgroundColor: storyViewerBgColor },
537
+ ]}
538
+ >
539
+ <SvgXml xml={seenIcon()} width="25" height="25" />
540
+ <Text style={styles.seen}>{reachCount}</Text>
541
+ </TouchableOpacity>
542
+ ) : (
543
+ <View style={styles.seenContainer} />
544
+ )}
545
+ <View style={styles.seenContainer}>
546
+ <TouchableOpacity
547
+ style={[
548
+ styles.iconContainer,
549
+ { backgroundColor: storyCommentBgColor },
550
+ ]}
551
+ onPress={onPressComment}
552
+ >
553
+ <SvgXml xml={storyCommentIcon()} width="25" height="25" />
554
+ <Text style={styles.seen}>{commentsCounts}</Text>
555
+ </TouchableOpacity>
556
+ <TouchableOpacity
557
+ style={[
558
+ styles.iconContainer,
559
+ {
560
+ backgroundColor: storyReactionBgColor,
561
+ },
562
+ ]}
563
+ onPress={onPressReaction}
564
+ >
565
+ <SvgXml
566
+ xml={isLiked ? storyLikedIcon : storyLikeIcon}
567
+ width="25"
568
+ height="25"
569
+ />
570
+ <Text style={styles.seen}>{totalReaction}</Text>
571
+ </TouchableOpacity>
572
+ </View>
573
+ </View>
574
+ )}
575
+
511
576
  {openCommentSheet && (
512
577
  <Modal
513
578
  style={styles.bottomSheet}
@@ -14,6 +14,7 @@ export const useStyles = () => {
14
14
  flex: 1,
15
15
  width: width,
16
16
  backgroundColor: '#000',
17
+ position: 'relative',
17
18
  },
18
19
  flex: {
19
20
  flex: 1,
@@ -73,7 +74,7 @@ export const useStyles = () => {
73
74
  fontSize: 14,
74
75
  },
75
76
  avatarSubText: {
76
- color: theme.colors.background,
77
+ color: 'white',
77
78
  fontSize: 12,
78
79
  },
79
80
  closeIconContainer: {
@@ -219,6 +220,27 @@ export const useStyles = () => {
219
220
  color: theme.colors.base,
220
221
  fontSize: 14,
221
222
  },
223
+ errorContainer: {
224
+ width: '100%',
225
+ position: 'absolute',
226
+ bottom: 120,
227
+ left: 0,
228
+ backgroundColor: theme.colors.alert,
229
+ flexDirection: 'row',
230
+ alignItems: 'center',
231
+ justifyContent: 'space-between',
232
+ paddingVertical: 12,
233
+ paddingHorizontal: 16,
234
+ },
235
+ errorContainerLeft: {
236
+ display: 'flex',
237
+ flexDirection: 'row',
238
+ alignItems: 'center',
239
+ gap: 4,
240
+ },
241
+ errorText: {
242
+ color: 'white',
243
+ },
222
244
  });
223
245
 
224
246
  return styles;
@@ -1,18 +1,21 @@
1
- export const failed =
2
- () => `<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <path d="M12 3.53125C16.7812 3.53125 20.7188 7.46875 20.7188 12.25C20.7188 17.0664 16.7812 20.9688 12 20.9688C7.18359 20.9688 3.28125 17.0664 3.28125 12.25C3.28125 7.46875 7.18359 3.53125 12 3.53125ZM12 19.2812C15.8672 19.2812 19.0312 16.1523 19.0312 12.25C19.0312 8.38281 15.8672 5.21875 12 5.21875C8.09766 5.21875 4.96875 8.38281 4.96875 12.25C4.96875 16.1523 8.09766 19.2812 12 19.2812ZM13.4766 15.625C13.4766 16.4688 12.8086 17.1016 12 17.1016C11.1562 17.1016 10.5234 16.4688 10.5234 15.625C10.5234 14.8164 11.1562 14.1484 12 14.1484C12.8086 14.1484 13.4766 14.8164 13.4766 15.625ZM10.5938 8.20703C10.5938 7.96094 10.7695 7.75 11.0156 7.75H12.9492C13.1953 7.75 13.3711 7.96094 13.3711 8.20703L13.125 12.9883C13.125 13.1992 12.9141 13.375 12.7031 13.375H11.2617C11.0508 13.375 10.8398 13.1992 10.8398 12.9883L10.5938 8.20703Z" fill="white"/>
1
+ export const failed = (
2
+ color: string = 'currentColor'
3
+ ) => `<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
4
+ <path d="M12 3.53125C16.7812 3.53125 20.7188 7.46875 20.7188 12.25C20.7188 17.0664 16.7812 20.9688 12 20.9688C7.18359 20.9688 3.28125 17.0664 3.28125 12.25C3.28125 7.46875 7.18359 3.53125 12 3.53125ZM12 19.2812C15.8672 19.2812 19.0312 16.1523 19.0312 12.25C19.0312 8.38281 15.8672 5.21875 12 5.21875C8.09766 5.21875 4.96875 8.38281 4.96875 12.25C4.96875 16.1523 8.09766 19.2812 12 19.2812ZM13.4766 15.625C13.4766 16.4688 12.8086 17.1016 12 17.1016C11.1562 17.1016 10.5234 16.4688 10.5234 15.625C10.5234 14.8164 11.1562 14.1484 12 14.1484C12.8086 14.1484 13.4766 14.8164 13.4766 15.625ZM10.5938 8.20703C10.5938 7.96094 10.7695 7.75 11.0156 7.75H12.9492C13.1953 7.75 13.3711 7.96094 13.3711 8.20703L13.125 12.9883C13.125 13.1992 12.9141 13.375 12.7031 13.375H11.2617C11.0508 13.375 10.8398 13.1992 10.8398 12.9883L10.5938 8.20703Z" fill=${color}/>
4
5
  </svg>
5
6
 
6
7
  `;
7
8
 
8
- export const success =
9
- () => `<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
10
- <path d="M12 3.53125C16.7812 3.53125 20.7188 7.46875 20.7188 12.25C20.7188 17.0664 16.7812 20.9688 12 20.9688C7.18359 20.9688 3.28125 17.0664 3.28125 12.25C3.28125 7.46875 7.18359 3.53125 12 3.53125ZM12 5.21875C8.09766 5.21875 4.96875 8.38281 4.96875 12.25C4.96875 16.1523 8.09766 19.2812 12 19.2812C15.8672 19.2812 19.0312 16.1523 19.0312 12.25C19.0312 8.38281 15.8672 5.21875 12 5.21875ZM16.9219 9.82422C17.0625 9.96484 17.0625 10.2461 16.9219 10.4219L10.8398 16.4336C10.6641 16.6094 10.418 16.6094 10.2422 16.4336L7.04297 13.1992C6.90234 13.0586 6.90234 12.7773 7.04297 12.6016L7.85156 11.8281C8.02734 11.6523 8.27344 11.6523 8.44922 11.8281L10.5586 13.9375L15.5156 9.01562C15.6914 8.83984 15.9727 8.83984 16.1133 9.01562L16.9219 9.82422Z" fill="currentColor"/>
9
+ export const success = (
10
+ color: string = 'currentColor'
11
+ ) => `<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
12
+ <path d="M12 3.53125C16.7812 3.53125 20.7188 7.46875 20.7188 12.25C20.7188 17.0664 16.7812 20.9688 12 20.9688C7.18359 20.9688 3.28125 17.0664 3.28125 12.25C3.28125 7.46875 7.18359 3.53125 12 3.53125ZM12 5.21875C8.09766 5.21875 4.96875 8.38281 4.96875 12.25C4.96875 16.1523 8.09766 19.2812 12 19.2812C15.8672 19.2812 19.0312 16.1523 19.0312 12.25C19.0312 8.38281 15.8672 5.21875 12 5.21875ZM16.9219 9.82422C17.0625 9.96484 17.0625 10.2461 16.9219 10.4219L10.8398 16.4336C10.6641 16.6094 10.418 16.6094 10.2422 16.4336L7.04297 13.1992C6.90234 13.0586 6.90234 12.7773 7.04297 12.6016L7.85156 11.8281C8.02734 11.6523 8.27344 11.6523 8.44922 11.8281L10.5586 13.9375L15.5156 9.01562C15.6914 8.83984 15.9727 8.83984 16.1133 9.01562L16.9219 9.82422Z" fill=${color}/>
11
13
  </svg>
12
14
  `;
13
15
 
14
- export const informative =
15
- () => `<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
16
- <path d="M12 3.53125C16.7812 3.53125 20.7188 7.46875 20.7188 12.25C20.7188 17.0664 16.7812 20.9688 12 20.9688C7.18359 20.9688 3.28125 17.0664 3.28125 12.25C3.28125 7.46875 7.18359 3.53125 12 3.53125ZM12 19.2812C15.8672 19.2812 19.0312 16.1523 19.0312 12.25C19.0312 8.38281 15.8672 5.21875 12 5.21875C8.09766 5.21875 4.96875 8.38281 4.96875 12.25C4.96875 16.1523 8.09766 19.2812 12 19.2812ZM12 7.39844C12.8086 7.39844 13.4766 8.06641 13.4766 8.875C13.4766 9.71875 12.8086 10.3516 12 10.3516C11.1562 10.3516 10.5234 9.71875 10.5234 8.875C10.5234 8.06641 11.1562 7.39844 12 7.39844ZM13.9688 16.3281C13.9688 16.5742 13.7578 16.75 13.5469 16.75H10.4531C10.207 16.75 10.0312 16.5742 10.0312 16.3281V15.4844C10.0312 15.2734 10.207 15.0625 10.4531 15.0625H10.875V12.8125H10.4531C10.207 12.8125 10.0312 12.6367 10.0312 12.3906V11.5469C10.0312 11.3359 10.207 11.125 10.4531 11.125H12.7031C12.9141 11.125 13.125 11.3359 13.125 11.5469V15.0625H13.5469C13.7578 15.0625 13.9688 15.2734 13.9688 15.4844V16.3281Z" fill="white"/>
16
+ export const informative = (
17
+ color: string = 'currentColor'
18
+ ) => `<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
19
+ <path d="M12 3.53125C16.7812 3.53125 20.7188 7.46875 20.7188 12.25C20.7188 17.0664 16.7812 20.9688 12 20.9688C7.18359 20.9688 3.28125 17.0664 3.28125 12.25C3.28125 7.46875 7.18359 3.53125 12 3.53125ZM12 19.2812C15.8672 19.2812 19.0312 16.1523 19.0312 12.25C19.0312 8.38281 15.8672 5.21875 12 5.21875C8.09766 5.21875 4.96875 8.38281 4.96875 12.25C4.96875 16.1523 8.09766 19.2812 12 19.2812ZM12 7.39844C12.8086 7.39844 13.4766 8.06641 13.4766 8.875C13.4766 9.71875 12.8086 10.3516 12 10.3516C11.1562 10.3516 10.5234 9.71875 10.5234 8.875C10.5234 8.06641 11.1562 7.39844 12 7.39844ZM13.9688 16.3281C13.9688 16.5742 13.7578 16.75 13.5469 16.75H10.4531C10.207 16.75 10.0312 16.5742 10.0312 16.3281V15.4844C10.0312 15.2734 10.207 15.0625 10.4531 15.0625H10.875V12.8125H10.4531C10.207 12.8125 10.0312 12.6367 10.0312 12.3906V11.5469C10.0312 11.3359 10.207 11.125 10.4531 11.125H12.7031C12.9141 11.125 13.125 11.3359 13.125 11.5469V15.0625H13.5469C13.7578 15.0625 13.9688 15.2734 13.9688 15.4844V16.3281Z" fill=${color}/>
17
20
  </svg>
18
21
  `;
@@ -5,6 +5,7 @@ import { useStory } from '../../hook/useStory';
5
5
  import { useFocusEffect, useNavigation } from '@react-navigation/native';
6
6
  import { SvgXml } from 'react-native-svg';
7
7
  import {
8
+ errorIcon,
8
9
  storyCircleCreatePlusIcon,
9
10
  storyRing,
10
11
  } from '../../../svg/svg-xml-list';
@@ -34,17 +35,18 @@ const CommunityStories = ({ communityId, community }: ICommunityStories) => {
34
35
  const { getImage } = useFile();
35
36
  const [avatarUrl, setAvatarUrl] = useState(undefined);
36
37
  const [viewStory, setViewStory] = useState(false);
37
- const storyRingColor: string[] = storyTarget?.hasUnseen
38
- ? (getUiKitConfig({
39
- page: PageID.StoryPage,
40
- component: ComponentID.StoryTab,
41
- element: ElementID.StoryRing,
42
- })?.progress_color as string[]) ?? ['#e2e2e2', '#e2e2e2']
43
- : storyTarget?.failedStoriesCount > 0
44
- ? ['#DE1029', '#DE1029']
45
- : stories.length > 0
46
- ? ['#e2e2e2', '#ffffff']
47
- : ['#ffffff', '#ffffff'];
38
+ const storyRingColor: string[] =
39
+ hasStoryPermission && storyTarget?.failedStoriesCount > 0
40
+ ? ['#DE1029', '#DE1029']
41
+ : storyTarget?.hasUnseen
42
+ ? (getUiKitConfig({
43
+ page: PageID.StoryPage,
44
+ component: ComponentID.StoryTab,
45
+ element: ElementID.StoryRing,
46
+ })?.progress_color as string[]) ?? ['#e2e2e2', '#e2e2e2']
47
+ : stories.length > 0
48
+ ? ['#e2e2e2', '#ffffff']
49
+ : ['#ffffff', '#ffffff'];
48
50
 
49
51
  useEffect(() => {
50
52
  (async () => {
@@ -86,6 +88,7 @@ const CommunityStories = ({ communityId, community }: ICommunityStories) => {
86
88
  setViewStory(false);
87
89
  onPressCreateStory();
88
90
  }, [onPressCreateStory]);
91
+
89
92
  const onPressCommunityName = useCallback(() => {
90
93
  setViewStory(false);
91
94
  navigation.navigate('CommunityProfilePage', {
@@ -121,12 +124,18 @@ const CommunityStories = ({ communityId, community }: ICommunityStories) => {
121
124
  height={48}
122
125
  xml={storyRing(storyRingColor[0], storyRingColor[1])}
123
126
  />
124
- {hasStoryPermission && (
125
- <SvgXml
126
- style={styles.storyCreateIcon}
127
- xml={storyCircleCreatePlusIcon()}
128
- />
129
- )}
127
+ {hasStoryPermission ? (
128
+ storyTarget?.failedStoriesCount > 0 ? (
129
+ <SvgXml style={styles.errorIcon} xml={errorIcon()} />
130
+ ) : (
131
+ <TouchableOpacity onPress={() => onPressCreateStory()}>
132
+ <SvgXml
133
+ style={styles.storyCreateIcon}
134
+ xml={storyCircleCreatePlusIcon()}
135
+ />
136
+ </TouchableOpacity>
137
+ )
138
+ ) : null}
130
139
  </TouchableOpacity>
131
140
  <Typography.Caption style={styles.base}>Story</Typography.Caption>
132
141
  </>
@@ -91,10 +91,15 @@ export const useStyles = () => {
91
91
  alignItems: 'center',
92
92
  width: 68,
93
93
  },
94
+ errorIcon: {
95
+ position: 'absolute',
96
+ right: 8,
97
+ bottom: 0,
98
+ },
94
99
  storyCreateIcon: {
95
100
  position: 'absolute',
96
- left: 42,
97
- top: 30,
101
+ left: 8,
102
+ top: -16,
98
103
  },
99
104
  base: {
100
105
  color: theme.colors.base,
@@ -7,14 +7,14 @@ import {
7
7
  ImageStyle,
8
8
  } from 'react-native';
9
9
  import React, { useEffect, useState, useCallback, Fragment } from 'react';
10
- import { FileRepository, RoomRepository } from '@amityco/ts-sdk-react-native';
10
+ import { FileRepository, StreamRepository } from '@amityco/ts-sdk-react-native';
11
11
  import { useStyles } from './styles';
12
12
  import { useNavigation } from '@react-navigation/native';
13
13
  import { SvgXml } from 'react-native-svg';
14
14
  import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
15
15
  import { play } from '../../assets/icons';
16
16
  import { Typography } from '../Typography/Typography';
17
- import { RoomStatus } from '../../enum/roomStatus';
17
+ import { LivestreamStatus } from '../../enum/livestreamStatus';
18
18
  import LiveStreamEndThumbnail from './LivestreamEndedThumbnail';
19
19
  import LiveStreamIdleThumbnail from './LivestreamIdleThumbnail';
20
20
  import RenderTextWithMention from '../RenderTextWithMention/RenderTextWithMention';
@@ -22,14 +22,14 @@ import { RootStackParamList } from '../../routes/RouteParamList';
22
22
  import LiveStreamTerminatedThumbnail from './LivestreamTerminatedThumbnail';
23
23
 
24
24
  interface ILivestreamContent {
25
- roomId: Amity.Room['roomId'];
25
+ streamId: Amity.Stream['streamId'];
26
26
  onPressPost: () => void;
27
27
  post: Amity.Post;
28
28
  }
29
29
 
30
30
  const LivestreamContent: React.FC<ILivestreamContent> = ({
31
31
  post,
32
- roomId,
32
+ streamId,
33
33
  onPressPost,
34
34
  }) => {
35
35
  const { styles, theme } = useStyles();
@@ -39,18 +39,18 @@ const LivestreamContent: React.FC<ILivestreamContent> = ({
39
39
  >();
40
40
 
41
41
  const [error, setError] = useState<boolean>(false);
42
- const [livestream, setLivestream] = useState<Amity.Room>();
42
+ const [livestream, setLivestream] = useState<Amity.Stream>();
43
43
  const [thumbnailUrl, setThumbnailUrl] = useState<ImageSourcePropType>();
44
44
  const [isUpcoming, setIsUpcoming] = useState<boolean>(false);
45
45
 
46
46
  const onPlayLivestream = useCallback(() => {
47
47
  navigation.navigate('LivestreamPlayer', {
48
48
  post,
49
- roomId: livestream.roomId,
49
+ streamId: livestream.streamId,
50
50
  });
51
51
  }, [livestream, navigation, post]);
52
52
 
53
- const getLivestreamThumbnail = async (currentStream: Amity.Room) => {
53
+ const getLivestreamThumbnail = async (currentStream: Amity.Stream) => {
54
54
  const defaultThumbnail = require('../../assets/images/livestream.png');
55
55
 
56
56
  if (currentStream.thumbnailFileId) {
@@ -71,8 +71,8 @@ const LivestreamContent: React.FC<ILivestreamContent> = ({
71
71
 
72
72
  useEffect(() => {
73
73
  setIsUpcoming(true);
74
- const unsubscribe = RoomRepository.getRoom(
75
- roomId,
74
+ const unsubscribe = StreamRepository.getStreamById(
75
+ streamId,
76
76
  ({ data, loading, error: streamError }) => {
77
77
  if (streamError) setError(!!streamError);
78
78
  if (!loading && data) {
@@ -86,13 +86,13 @@ const LivestreamContent: React.FC<ILivestreamContent> = ({
86
86
  return () => {
87
87
  unsubscribe();
88
88
  };
89
- }, [roomId]);
89
+ }, [streamId]);
90
90
 
91
91
  if (!livestream) return null;
92
92
 
93
93
  if (error || livestream?.isDeleted) {
94
94
  return (
95
- <View key={livestream.roomId} style={styles.container}>
95
+ <View key={livestream.streamId} style={styles.container}>
96
96
  <LiveStreamIdleThumbnail />
97
97
  </View>
98
98
  );
@@ -102,12 +102,12 @@ const LivestreamContent: React.FC<ILivestreamContent> = ({
102
102
  livestream?.moderation?.terminateLabels &&
103
103
  livestream?.moderation?.terminateLabels?.length > 0;
104
104
  const isLiveOrEnded =
105
- livestream?.status === RoomStatus.live ||
106
- livestream?.status === RoomStatus.ended;
105
+ livestream?.status === LivestreamStatus.live ||
106
+ livestream?.status === LivestreamStatus.ended;
107
107
 
108
108
  if (isTerminated && isLiveOrEnded) {
109
109
  return (
110
- <View key={livestream.roomId} style={styles.container}>
110
+ <View key={livestream.streamId} style={styles.container}>
111
111
  <LiveStreamTerminatedThumbnail />
112
112
  </View>
113
113
  );
@@ -129,7 +129,7 @@ const LivestreamContent: React.FC<ILivestreamContent> = ({
129
129
  )}
130
130
  </Pressable>
131
131
  <View style={styles.container}>
132
- {(livestream.status === RoomStatus.idle || isUpcoming) &&
132
+ {(livestream.status === LivestreamStatus.idle || isUpcoming) &&
133
133
  thumbnailUrl && (
134
134
  <View style={styles.content}>
135
135
  <Image
@@ -144,10 +144,12 @@ const LivestreamContent: React.FC<ILivestreamContent> = ({
144
144
  </View>
145
145
  )}
146
146
 
147
- {livestream.status === RoomStatus.ended && <LiveStreamEndThumbnail />}
147
+ {livestream.status === LivestreamStatus.ended && (
148
+ <LiveStreamEndThumbnail />
149
+ )}
148
150
 
149
- {(livestream.status === RoomStatus.live ||
150
- livestream.status === RoomStatus.recorded) &&
151
+ {(livestream.status === LivestreamStatus.live ||
152
+ livestream.status === LivestreamStatus.recorded) &&
151
153
  thumbnailUrl &&
152
154
  !isUpcoming && (
153
155
  <View style={styles.content}>
@@ -155,15 +157,14 @@ const LivestreamContent: React.FC<ILivestreamContent> = ({
155
157
  source={thumbnailUrl}
156
158
  style={styles.streamImageCover as ImageStyle}
157
159
  />
158
- {(livestream.status === RoomStatus.live ||
159
- livestream.status === RoomStatus.waiting_reconnect) && (
160
+ {livestream.status === LivestreamStatus.live && (
160
161
  <View style={styles.streamStatusLive}>
161
162
  <Typography.CaptionBold style={styles.streamStatusText}>
162
163
  LIVE
163
164
  </Typography.CaptionBold>
164
165
  </View>
165
166
  )}
166
- {livestream.status === RoomStatus.recorded && (
167
+ {livestream.status === LivestreamStatus.recorded && (
167
168
  <View style={styles.streamStatusRecorded}>
168
169
  <Typography.CaptionBold style={styles.streamStatusText}>
169
170
  RECORDED
@@ -8,10 +8,6 @@ import {
8
8
  } from '../../../providers/file-provider';
9
9
  import { closeIcon, toastIcon } from '../../../svg/svg-xml-list';
10
10
  import { useStyles } from './styles';
11
- import { useTheme } from 'react-native-paper';
12
- import type { MyMD3Theme } from '../../../providers/amity-ui-kit-provider';
13
- import uiSlice from '../../../redux/slices/uiSlice';
14
- import { useUIKitDispatch } from '../../../redux/store';
15
11
 
16
12
  interface OverlayImageProps {
17
13
  source: string;
@@ -23,6 +19,7 @@ interface OverlayImageProps {
23
19
  index: number,
24
20
  originalPath: string
25
21
  ) => void;
22
+ onUploadError?: (hasError: boolean, source: string) => void;
26
23
  index?: number;
27
24
  isUploaded: boolean;
28
25
  fileId?: string;
@@ -36,6 +33,7 @@ const LoadingImage = ({
36
33
  onClose,
37
34
  index,
38
35
  onLoadFinish,
36
+ onUploadError,
39
37
  isUploaded = false,
40
38
  fileId = '',
41
39
  isEditMode = false,
@@ -43,9 +41,6 @@ const LoadingImage = ({
43
41
  postId,
44
42
  setIsUploading,
45
43
  }: OverlayImageProps) => {
46
- const theme = useTheme() as MyMD3Theme;
47
- const dispatch = useUIKitDispatch();
48
- const { showToastMessage } = uiSlice.actions;
49
44
  const [loading, setLoading] = useState(true);
50
45
  const [progress, setProgress] = useState(0);
51
46
  const [isProcess, setIsProcess] = useState<boolean>(false);
@@ -84,33 +79,39 @@ const LoadingImage = ({
84
79
  source
85
80
  );
86
81
  } else {
82
+ setIsUploading(false);
87
83
  handleLoadEnd();
88
- dispatch(showToastMessage({ toastMessage: 'Failed to upload file' }));
84
+ setIsProcess(false);
89
85
  setIsUploadError(true);
86
+ onUploadError?.(true, source);
90
87
  }
91
88
  } catch (error) {
92
89
  handleLoadEnd();
93
- dispatch(showToastMessage({ toastMessage: 'Failed to upload file' }));
90
+ setIsProcess(false);
91
+ setIsUploading(false);
94
92
  setIsUploadError(true);
93
+ onUploadError?.(true, source);
95
94
  }
96
95
  }, [
97
- dispatch,
98
96
  handleLoadEnd,
99
97
  index,
100
98
  onLoadFinish,
99
+ onUploadError,
101
100
  setIsUploading,
102
- showToastMessage,
103
101
  source,
104
102
  ]);
105
103
 
106
104
  const handleDelete = async () => {
107
- if (!fileId) return null;
108
- if (!isEditMode) {
105
+ if (fileId && !isEditMode) {
109
106
  await deleteAmityFile(fileId);
110
107
  }
111
108
  onClose && onClose(source, fileId, postId);
112
109
  };
113
110
  useEffect(() => {
111
+ setIsUploadError(false);
112
+ onUploadError?.(false, source);
113
+ setProgress(0);
114
+ setIsProcess(false);
114
115
  if (isUploaded) {
115
116
  setLoading(false);
116
117
  } else {
@@ -151,19 +152,21 @@ const LoadingImage = ({
151
152
  )}
152
153
  </View>
153
154
  )}
154
- {!loading && isUploadError ? (
155
- <TouchableOpacity style={styles.overlay} onPress={onRetryUpload}>
156
- <SvgXml xml={toastIcon()} width="24" height="24" />
157
- </TouchableOpacity>
158
- ) : (
159
- <TouchableOpacity
160
- style={styles.closeButton}
161
- disabled={loading || isProcess}
162
- onPress={handleDelete}
163
- >
164
- <SvgXml xml={closeIcon(theme.colors.base)} width="12" height="12" />
165
- </TouchableOpacity>
155
+ {!loading && isUploadError && (
156
+ <View style={styles.failedOverlay}>
157
+ <TouchableOpacity style={styles.errorOverlay} onPress={onRetryUpload}>
158
+ <SvgXml xml={toastIcon()} width="28" height="28" />
159
+ </TouchableOpacity>
160
+ </View>
166
161
  )}
162
+
163
+ <TouchableOpacity
164
+ style={styles.closeButton}
165
+ disabled={(loading || isProcess) && !isUploadError}
166
+ onPress={handleDelete}
167
+ >
168
+ <SvgXml xml={closeIcon('white')} width="12" height="12" />
169
+ </TouchableOpacity>
167
170
  </View>
168
171
  );
169
172
  };