@amityco/react-native-social-uikit 4.0.1-fd53cf63.0 → 4.0.1

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 (248) hide show
  1. package/lib/commonjs/core/assets/icons/index.js +0 -8
  2. package/lib/commonjs/core/assets/icons/index.js.map +1 -1
  3. package/lib/commonjs/core/constants/index.js +1 -11
  4. package/lib/commonjs/core/constants/index.js.map +1 -1
  5. package/lib/commonjs/core/hooks/useAuth.js +2 -6
  6. package/lib/commonjs/core/hooks/useAuth.js.map +1 -1
  7. package/lib/commonjs/core/hooks/useUpload.js +6 -7
  8. package/lib/commonjs/core/hooks/useUpload.js.map +1 -1
  9. package/lib/commonjs/core/legacy/file.js +4 -19
  10. package/lib/commonjs/core/legacy/file.js.map +1 -1
  11. package/lib/commonjs/core/providers/AmityUIKitProvider.js.map +1 -1
  12. package/lib/commonjs/core/providers/AuthProvider.js +16 -40
  13. package/lib/commonjs/core/providers/AuthProvider.js.map +1 -1
  14. package/lib/commonjs/core/routes/AmityUIKitNavigator.js +1 -23
  15. package/lib/commonjs/core/routes/AmityUIKitNavigator.js.map +1 -1
  16. package/lib/commonjs/core/utils/fileUpload.js +59 -0
  17. package/lib/commonjs/core/utils/fileUpload.js.map +1 -0
  18. package/lib/commonjs/social/components/Social/CommentList/CommentList.js +1 -6
  19. package/lib/commonjs/social/components/Social/CommentList/CommentList.js.map +1 -1
  20. package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js +3 -14
  21. package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
  22. package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js +2 -10
  23. package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
  24. package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +1 -6
  25. package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  26. package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +3 -13
  27. package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
  28. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js +2 -10
  29. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
  30. package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js +1 -5
  31. package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
  32. package/lib/commonjs/social/features/post/Detail/index.js +2 -6
  33. package/lib/commonjs/social/features/post/Detail/index.js.map +1 -1
  34. package/lib/commonjs/social/features/post/components/Content/Content.js +1 -5
  35. package/lib/commonjs/social/features/post/components/Content/Content.js.map +1 -1
  36. package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js +10 -16
  37. package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
  38. package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js +9 -17
  39. package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
  40. package/lib/commonjs/social/features/story/Draft/Draft.js +2 -5
  41. package/lib/commonjs/social/features/story/Draft/Draft.js.map +1 -1
  42. package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js +20 -18
  43. package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
  44. package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js +1 -6
  45. package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
  46. package/lib/commonjs/social/hooks/index.js +0 -22
  47. package/lib/commonjs/social/hooks/index.js.map +1 -1
  48. package/lib/commonjs/social/hooks/usePostPermission.js +2 -4
  49. package/lib/commonjs/social/hooks/usePostPermission.js.map +1 -1
  50. package/lib/commonjs/social/hooks/useStoryPermission.js +2 -3
  51. package/lib/commonjs/social/hooks/useStoryPermission.js.map +1 -1
  52. package/lib/commonjs/social/providers/BehaviourProvider.js +0 -1
  53. package/lib/commonjs/social/providers/BehaviourProvider.js.map +1 -1
  54. package/lib/commonjs/social/screens/SocialHomePage/index.js +5 -12
  55. package/lib/commonjs/social/screens/SocialHomePage/index.js.map +1 -1
  56. package/lib/module/core/assets/icons/index.js +0 -1
  57. package/lib/module/core/assets/icons/index.js.map +1 -1
  58. package/lib/module/core/constants/index.js +0 -10
  59. package/lib/module/core/constants/index.js.map +1 -1
  60. package/lib/module/core/hooks/useAuth.js +2 -6
  61. package/lib/module/core/hooks/useAuth.js.map +1 -1
  62. package/lib/module/core/hooks/useUpload.js +7 -8
  63. package/lib/module/core/hooks/useUpload.js.map +1 -1
  64. package/lib/module/core/legacy/file.js +4 -19
  65. package/lib/module/core/legacy/file.js.map +1 -1
  66. package/lib/module/core/providers/AmityUIKitProvider.js.map +1 -1
  67. package/lib/module/core/providers/AuthProvider.js +16 -40
  68. package/lib/module/core/providers/AuthProvider.js.map +1 -1
  69. package/lib/module/core/routes/AmityUIKitNavigator.js +1 -23
  70. package/lib/module/core/routes/AmityUIKitNavigator.js.map +1 -1
  71. package/lib/module/core/utils/fileUpload.js +54 -0
  72. package/lib/module/core/utils/fileUpload.js.map +1 -0
  73. package/lib/module/social/components/Social/CommentList/CommentList.js +1 -6
  74. package/lib/module/social/components/Social/CommentList/CommentList.js.map +1 -1
  75. package/lib/module/social/components/Social/CommentListItem/CommentListItem.js +3 -14
  76. package/lib/module/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
  77. package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js +2 -10
  78. package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
  79. package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +2 -7
  80. package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
  81. package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +4 -14
  82. package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
  83. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js +2 -10
  84. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
  85. package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js +1 -5
  86. package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
  87. package/lib/module/social/features/post/Detail/index.js +2 -6
  88. package/lib/module/social/features/post/Detail/index.js.map +1 -1
  89. package/lib/module/social/features/post/components/Content/Content.js +1 -5
  90. package/lib/module/social/features/post/components/Content/Content.js.map +1 -1
  91. package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js +11 -17
  92. package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
  93. package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js +10 -18
  94. package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
  95. package/lib/module/social/features/story/Draft/Draft.js +2 -5
  96. package/lib/module/social/features/story/Draft/Draft.js.map +1 -1
  97. package/lib/module/social/features/story/View/components/AmityViewStoryItem.js +21 -19
  98. package/lib/module/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
  99. package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js +2 -7
  100. package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
  101. package/lib/module/social/hooks/index.js +0 -2
  102. package/lib/module/social/hooks/index.js.map +1 -1
  103. package/lib/module/social/hooks/usePostPermission.js +2 -4
  104. package/lib/module/social/hooks/usePostPermission.js.map +1 -1
  105. package/lib/module/social/hooks/useStoryPermission.js +2 -3
  106. package/lib/module/social/hooks/useStoryPermission.js.map +1 -1
  107. package/lib/module/social/providers/BehaviourProvider.js +0 -1
  108. package/lib/module/social/providers/BehaviourProvider.js.map +1 -1
  109. package/lib/module/social/screens/SocialHomePage/index.js +6 -13
  110. package/lib/module/social/screens/SocialHomePage/index.js.map +1 -1
  111. package/lib/typescript/core/assets/icons/index.d.ts +0 -1
  112. package/lib/typescript/core/assets/icons/index.d.ts.map +1 -1
  113. package/lib/typescript/core/constants/index.d.ts +0 -10
  114. package/lib/typescript/core/constants/index.d.ts.map +1 -1
  115. package/lib/typescript/core/hooks/useAuth.d.ts.map +1 -1
  116. package/lib/typescript/core/hooks/useUpload.d.ts.map +1 -1
  117. package/lib/typescript/core/legacy/file.d.ts.map +1 -1
  118. package/lib/typescript/core/providers/AmityUIKitProvider.d.ts +1 -2
  119. package/lib/typescript/core/providers/AmityUIKitProvider.d.ts.map +1 -1
  120. package/lib/typescript/core/providers/AuthProvider.d.ts.map +1 -1
  121. package/lib/typescript/core/routes/AmityUIKitNavigator.d.ts.map +1 -1
  122. package/lib/typescript/core/types/auth.d.ts +0 -2
  123. package/lib/typescript/core/types/auth.d.ts.map +1 -1
  124. package/lib/typescript/core/types/behaviour.d.ts +0 -6
  125. package/lib/typescript/core/types/behaviour.d.ts.map +1 -1
  126. package/lib/typescript/core/utils/fileUpload.d.ts +39 -0
  127. package/lib/typescript/core/utils/fileUpload.d.ts.map +1 -0
  128. package/lib/typescript/social/components/Social/CommentList/CommentList.d.ts.map +1 -1
  129. package/lib/typescript/social/components/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
  130. package/lib/typescript/social/components/legacy/Social/ReplyCommentList/index.d.ts.map +1 -1
  131. package/lib/typescript/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.d.ts.map +1 -1
  132. package/lib/typescript/social/features/comment/components/PostComment/CommentListItem/CommentListItem.d.ts.map +1 -1
  133. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/index.d.ts.map +1 -1
  134. package/lib/typescript/social/features/feed/components/TopNavigation/TopNavigation.d.ts.map +1 -1
  135. package/lib/typescript/social/features/post/Detail/index.d.ts.map +1 -1
  136. package/lib/typescript/social/features/post/components/Content/Content.d.ts.map +1 -1
  137. package/lib/typescript/social/features/post/components/EngagementActions/Components/DetailStyle.d.ts.map +1 -1
  138. package/lib/typescript/social/features/post/components/EngagementActions/Components/FeedStyle.d.ts.map +1 -1
  139. package/lib/typescript/social/features/story/Draft/Draft.d.ts.map +1 -1
  140. package/lib/typescript/social/features/story/View/components/AmityViewStoryItem.d.ts.map +1 -1
  141. package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts.map +1 -1
  142. package/lib/typescript/social/hooks/index.d.ts +0 -2
  143. package/lib/typescript/social/hooks/index.d.ts.map +1 -1
  144. package/lib/typescript/social/hooks/usePostPermission.d.ts.map +1 -1
  145. package/lib/typescript/social/hooks/useStoryPermission.d.ts.map +1 -1
  146. package/lib/typescript/social/providers/BehaviourProvider.d.ts.map +1 -1
  147. package/lib/typescript/social/screens/SocialHomePage/index.d.ts.map +1 -1
  148. package/package.json +3 -3
  149. package/src/core/assets/icons/index.ts +0 -1
  150. package/src/core/constants/index.ts +0 -15
  151. package/src/core/hooks/useAuth.ts +0 -4
  152. package/src/core/hooks/useUpload.ts +6 -8
  153. package/src/core/legacy/file.tsx +16 -22
  154. package/src/core/providers/AmityUIKitProvider.tsx +1 -2
  155. package/src/core/providers/AuthProvider.tsx +11 -35
  156. package/src/core/routes/AmityUIKitNavigator.tsx +1 -26
  157. package/src/core/types/auth.ts +0 -2
  158. package/src/core/types/behaviour.ts +0 -6
  159. package/src/core/utils/fileUpload.ts +60 -0
  160. package/src/social/components/Social/CommentList/CommentList.tsx +1 -4
  161. package/src/social/components/Social/CommentListItem/CommentListItem.tsx +12 -20
  162. package/src/social/components/legacy/Social/ReplyCommentList/index.tsx +11 -18
  163. package/src/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +2 -10
  164. package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx +16 -23
  165. package/src/social/features/comment/components/PostComment/ReplyCommentList/index.tsx +11 -17
  166. package/src/social/features/feed/components/TopNavigation/TopNavigation.tsx +1 -3
  167. package/src/social/features/post/Detail/index.tsx +2 -5
  168. package/src/social/features/post/components/Content/Content.tsx +4 -7
  169. package/src/social/features/post/components/EngagementActions/Components/DetailStyle.tsx +14 -19
  170. package/src/social/features/post/components/EngagementActions/Components/FeedStyle.tsx +12 -20
  171. package/src/social/features/story/Draft/Draft.tsx +9 -5
  172. package/src/social/features/story/View/components/AmityViewStoryItem.tsx +22 -20
  173. package/src/social/features/user/Profile/components/Header/hooks/useHeader.ts +2 -5
  174. package/src/social/hooks/index.ts +0 -2
  175. package/src/social/hooks/usePostPermission.ts +1 -3
  176. package/src/social/hooks/useStoryPermission.ts +6 -8
  177. package/src/social/providers/BehaviourProvider.tsx +0 -1
  178. package/src/social/screens/SocialHomePage/index.tsx +11 -24
  179. package/lib/commonjs/core/assets/icons/visitorLimit.js +0 -26
  180. package/lib/commonjs/core/assets/icons/visitorLimit.js.map +0 -1
  181. package/lib/commonjs/social/features/visitor/UsageLimit/UsageLimit.js +0 -46
  182. package/lib/commonjs/social/features/visitor/UsageLimit/UsageLimit.js.map +0 -1
  183. package/lib/commonjs/social/features/visitor/UsageLimit/hooks/index.js +0 -13
  184. package/lib/commonjs/social/features/visitor/UsageLimit/hooks/index.js.map +0 -1
  185. package/lib/commonjs/social/features/visitor/UsageLimit/hooks/useUsageLimit.js +0 -54
  186. package/lib/commonjs/social/features/visitor/UsageLimit/hooks/useUsageLimit.js.map +0 -1
  187. package/lib/commonjs/social/features/visitor/UsageLimit/index.js +0 -13
  188. package/lib/commonjs/social/features/visitor/UsageLimit/index.js.map +0 -1
  189. package/lib/commonjs/social/features/visitor/UsageLimit/styles.js +0 -52
  190. package/lib/commonjs/social/features/visitor/UsageLimit/styles.js.map +0 -1
  191. package/lib/commonjs/social/hooks/useGlobalBehavior.js +0 -44
  192. package/lib/commonjs/social/hooks/useGlobalBehavior.js.map +0 -1
  193. package/lib/commonjs/social/hooks/useInteractionBehavior.js +0 -50
  194. package/lib/commonjs/social/hooks/useInteractionBehavior.js.map +0 -1
  195. package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +0 -11
  196. package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +0 -1
  197. package/lib/commonjs/social/screens/VisitorUsageLimit/index.js +0 -13
  198. package/lib/commonjs/social/screens/VisitorUsageLimit/index.js.map +0 -1
  199. package/lib/module/core/assets/icons/visitorLimit.js +0 -19
  200. package/lib/module/core/assets/icons/visitorLimit.js.map +0 -1
  201. package/lib/module/social/features/visitor/UsageLimit/UsageLimit.js +0 -40
  202. package/lib/module/social/features/visitor/UsageLimit/UsageLimit.js.map +0 -1
  203. package/lib/module/social/features/visitor/UsageLimit/hooks/index.js +0 -2
  204. package/lib/module/social/features/visitor/UsageLimit/hooks/index.js.map +0 -1
  205. package/lib/module/social/features/visitor/UsageLimit/hooks/useUsageLimit.js +0 -47
  206. package/lib/module/social/features/visitor/UsageLimit/hooks/useUsageLimit.js.map +0 -1
  207. package/lib/module/social/features/visitor/UsageLimit/index.js +0 -2
  208. package/lib/module/social/features/visitor/UsageLimit/index.js.map +0 -1
  209. package/lib/module/social/features/visitor/UsageLimit/styles.js +0 -45
  210. package/lib/module/social/features/visitor/UsageLimit/styles.js.map +0 -1
  211. package/lib/module/social/hooks/useGlobalBehavior.js +0 -36
  212. package/lib/module/social/hooks/useGlobalBehavior.js.map +0 -1
  213. package/lib/module/social/hooks/useInteractionBehavior.js +0 -43
  214. package/lib/module/social/hooks/useInteractionBehavior.js.map +0 -1
  215. package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +0 -5
  216. package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +0 -1
  217. package/lib/module/social/screens/VisitorUsageLimit/index.js +0 -2
  218. package/lib/module/social/screens/VisitorUsageLimit/index.js.map +0 -1
  219. package/lib/typescript/core/assets/icons/visitorLimit.d.ts +0 -3
  220. package/lib/typescript/core/assets/icons/visitorLimit.d.ts.map +0 -1
  221. package/lib/typescript/social/features/visitor/UsageLimit/UsageLimit.d.ts +0 -2
  222. package/lib/typescript/social/features/visitor/UsageLimit/UsageLimit.d.ts.map +0 -1
  223. package/lib/typescript/social/features/visitor/UsageLimit/hooks/index.d.ts +0 -2
  224. package/lib/typescript/social/features/visitor/UsageLimit/hooks/index.d.ts.map +0 -1
  225. package/lib/typescript/social/features/visitor/UsageLimit/hooks/useUsageLimit.d.ts +0 -40
  226. package/lib/typescript/social/features/visitor/UsageLimit/hooks/useUsageLimit.d.ts.map +0 -1
  227. package/lib/typescript/social/features/visitor/UsageLimit/index.d.ts +0 -2
  228. package/lib/typescript/social/features/visitor/UsageLimit/index.d.ts.map +0 -1
  229. package/lib/typescript/social/features/visitor/UsageLimit/styles.d.ts +0 -40
  230. package/lib/typescript/social/features/visitor/UsageLimit/styles.d.ts.map +0 -1
  231. package/lib/typescript/social/hooks/useGlobalBehavior.d.ts +0 -16
  232. package/lib/typescript/social/hooks/useGlobalBehavior.d.ts.map +0 -1
  233. package/lib/typescript/social/hooks/useInteractionBehavior.d.ts +0 -11
  234. package/lib/typescript/social/hooks/useInteractionBehavior.d.ts.map +0 -1
  235. package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts +0 -2
  236. package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts.map +0 -1
  237. package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts +0 -2
  238. package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts.map +0 -1
  239. package/src/core/assets/icons/visitorLimit.tsx +0 -19
  240. package/src/social/features/visitor/UsageLimit/UsageLimit.tsx +0 -43
  241. package/src/social/features/visitor/UsageLimit/hooks/index.ts +0 -1
  242. package/src/social/features/visitor/UsageLimit/hooks/useUsageLimit.ts +0 -46
  243. package/src/social/features/visitor/UsageLimit/index.ts +0 -1
  244. package/src/social/features/visitor/UsageLimit/styles.ts +0 -45
  245. package/src/social/hooks/useGlobalBehavior.ts +0 -33
  246. package/src/social/hooks/useInteractionBehavior.ts +0 -47
  247. package/src/social/screens/VisitorUsageLimit/VisitorUsageLimit.tsx +0 -5
  248. package/src/social/screens/VisitorUsageLimit/index.ts +0 -1
@@ -1,4 +1,3 @@
1
- import { useEffect, useRef } from 'react';
2
1
  import {
3
2
  NavigationContainer,
4
3
  NavigationIndependentTree,
@@ -44,8 +43,6 @@ import { CommunityStoriesNotificationSettingScreen } from '../../social/screens/
44
43
  import { CommunityLivestreamsNotificationSettingScreen } from '../../social/screens/CommunityLivestreamsNotificationSetting';
45
44
  import CommunityPendingRequest from '../../social/screens/CommunityPendingRequest';
46
45
  import { GlobalBan } from '../../social/screens/GlobalBan';
47
- import { VisitorUsageLimit } from '../../social/screens/VisitorUsageLimit';
48
- import { useBehaviour } from '../../social/providers/BehaviourProvider';
49
46
  import {
50
47
  ImageViewerScreen,
51
48
  VideoPlayerScreen,
@@ -63,32 +60,10 @@ const Stack = createNativeStackNavigator<
63
60
 
64
61
  export default function AmitySocialUIKitV4Navigator() {
65
62
  const theme = useTheme<MyMD3Theme>();
66
- const { isGlobalBan, isVisitorUsageLimitReached } = useAuth();
67
- const { AmityGlobalBehaviour } = useBehaviour();
68
-
69
- const handleVisitorUsageLimitReached =
70
- AmityGlobalBehaviour?.handleVisitorUsageLimitReached;
71
-
72
- const hasHandledUsageLimit = useRef(false);
73
-
74
- useEffect(() => {
75
- if (!isVisitorUsageLimitReached) {
76
- hasHandledUsageLimit.current = false;
77
- return;
78
- }
79
-
80
- if (handleVisitorUsageLimitReached && !hasHandledUsageLimit.current) {
81
- hasHandledUsageLimit.current = true;
82
- handleVisitorUsageLimitReached();
83
- }
84
- }, [isVisitorUsageLimitReached, handleVisitorUsageLimitReached]);
63
+ const { isGlobalBan } = useAuth();
85
64
 
86
65
  if (isGlobalBan) return <GlobalBan />;
87
66
 
88
- if (isVisitorUsageLimitReached && !handleVisitorUsageLimitReached) {
89
- return <VisitorUsageLimit />;
90
- }
91
-
92
67
  return (
93
68
  <NavigationIndependentTree>
94
69
  <NavigationContainer ref={navigationRef} onReady={onNavigationReady}>
@@ -10,6 +10,4 @@ export type AuthContextInterface = {
10
10
  authToken?: string;
11
11
  fcmToken?: string;
12
12
  isGlobalBan: boolean;
13
- isVisitorUsageLimitReached: boolean;
14
- isVisitorOrBot: boolean;
15
13
  };
@@ -17,12 +17,6 @@ export type CommunitySettingPageContext = {
17
17
  };
18
18
 
19
19
  export interface IBehaviour {
20
- AmityGlobalBehaviour?: {
21
- handleVisitorUserAction?: () => void;
22
- handleNonMemberAction?: () => void;
23
- handleVisitorUsageLimitReached?: () => void;
24
- handleVisitorUsageLimitSignIn?: () => void;
25
- };
26
20
  AmitySocialHomePageBehaviour?: {
27
21
  onChooseTab?: (arg?: string) => void;
28
22
  };
@@ -0,0 +1,60 @@
1
+ /**
2
+ * fileUpload.ts
3
+ *
4
+ * Helper for attaching a local file to a FormData for upload to the Amity SDK.
5
+ *
6
+ * Why the `{ uri, name, type }` object (and NOT a Blob)
7
+ * -----------------------------------------------------
8
+ * React Native's `FormData.getParts()` only turns a value into a multipart
9
+ * *file* part when that value is an object carrying a `uri`:
10
+ *
11
+ * • `name` → the `filename` in the `Content-Disposition` header
12
+ * • `type` → the part's `Content-Type`
13
+ * • `uri` → the local path the native networking layer streams bytes from
14
+ *
15
+ * This is the canonical React Native upload pattern and works on BOTH the Old
16
+ * and the New (Bridgeless / JSI) Architecture — RN 0.83 did not change this JS
17
+ * API. The Amity SDK's `uploadImage` is built around it too: it calls
18
+ * `formData.getAll('files')` and reads `files[0].name` to set
19
+ * `preferredFilename`.
20
+ *
21
+ * Do NOT append a Blob here. A Blob produced by `fetch(uri).blob()` has:
22
+ * • no `uri` → RN attaches no file body, so the request carries no
23
+ * bytes and the server responds `400 "No files
24
+ * uploaded."`
25
+ * • no top-level `name` → `files[0].name` is `null`, so `preferredFilename`
26
+ * is sent as `null`.
27
+ * That combination is exactly the failure seen in PDT-3461.
28
+ */
29
+
30
+ import { Platform } from 'react-native';
31
+
32
+ /**
33
+ * Append a local file to `formData` as a React-Native multipart file part.
34
+ *
35
+ * @param formData The FormData instance to mutate.
36
+ * @param fieldName The multipart field name (e.g. `'files'`).
37
+ * @param fileUri Local file URI (`file://…` or `content://…`).
38
+ * @param fileName The filename sent in the Content-Disposition header.
39
+ * @param mimeType MIME type for the part (e.g. `'image/jpeg'`).
40
+ */
41
+ export function appendFileToFormData(
42
+ formData: FormData,
43
+ fieldName: string,
44
+ fileUri: string,
45
+ fileName: string,
46
+ mimeType: string
47
+ ): void {
48
+ // Android keeps the URI as-is (`content://` / `file://` are both streamable);
49
+ // iOS expects the `file://` scheme stripped to a bare path.
50
+ const uri =
51
+ Platform.OS === 'android' ? fileUri : fileUri.replace('file://', '');
52
+
53
+ // RN's FormData.append is typed for the legacy `{ uri, name, type }` object
54
+ // but its TS types don't expose that overload, so we cast to `any`.
55
+ formData.append(fieldName, {
56
+ uri,
57
+ name: fileName,
58
+ type: mimeType,
59
+ } as any);
60
+ }
@@ -31,7 +31,6 @@ import { useToast } from '../../../../core/stores/slices/toastSlice';
31
31
  import { lock } from '../../../../core/assets/icons';
32
32
  import { Typography } from '../../../../core/components/Typography/Typography';
33
33
  import { MAX_MENTION_USERS } from '../../../../core/constants';
34
- import useAuth from '../../../../core/hooks/useAuth';
35
34
 
36
35
  interface ICommentListProp {
37
36
  postId: string;
@@ -69,8 +68,6 @@ const CommentList: FC<ICommentListProp> = ({
69
68
  withAvatar,
70
69
  disabledComment,
71
70
  }) => {
72
- const { isVisitorOrBot } = useAuth();
73
- const hideComposer = disabledInteraction || isVisitorOrBot;
74
71
  const styles = useStyles();
75
72
  const theme = useTheme() as MyMD3Theme;
76
73
  const onNextPageRef = useRef<() => void | null>(null);
@@ -287,7 +284,7 @@ const CommentList: FC<ICommentListProp> = ({
287
284
  </TouchableOpacity>
288
285
  </View>
289
286
  )}
290
- {!hideComposer &&
287
+ {!disabledInteraction &&
291
288
  (disabledComment ? (
292
289
  <View style={styles.disabledCommentWrap}>
293
290
  <SvgXml
@@ -44,7 +44,6 @@ import ReplyCommentList from '../../legacy/Social/ReplyCommentList';
44
44
  import AmityReactionListComponent from '../../../features/reaction/components/List';
45
45
  import { CommentRepository } from '@amityco/ts-sdk-react-native';
46
46
  import { useTimeDifference } from '../../../hooks/useTimeDifference';
47
- import { useGlobalBehavior } from '../../../hooks/useGlobalBehavior';
48
47
  import { LinkPreview } from '../../PreviewLink';
49
48
  import { Typography } from '../../../../core/components/Typography/Typography';
50
49
  import { pen, report, trash, unreport } from '../../../../core/assets/icons';
@@ -291,14 +290,6 @@ const CommentListItem = ({
291
290
  onClickReply && onClickReply(user, commentId);
292
291
  };
293
292
 
294
- const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
295
-
296
- const onPressLike = () =>
297
- handleGlobalBehavior({ defaultBehavior: addReactionToComment });
298
-
299
- const onPressReply = () =>
300
- handleGlobalBehavior({ defaultBehavior: onHandleReply });
301
-
302
293
  const onPressCommentReaction = () => {
303
294
  setIsReactionListVisible(true);
304
295
  };
@@ -357,7 +348,10 @@ const CommentListItem = ({
357
348
  </Typography.Caption>
358
349
  )}
359
350
  </View>
360
- <TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
351
+ <TouchableOpacity
352
+ onPress={() => addReactionToComment()}
353
+ style={styles.likeBtn}
354
+ >
361
355
  <Typography.CaptionBold
362
356
  style={isLike ? styles.likedText : styles.btnText}
363
357
  >
@@ -365,22 +359,20 @@ const CommentListItem = ({
365
359
  </Typography.CaptionBold>
366
360
  </TouchableOpacity>
367
361
  <TouchableOpacity
368
- onPress={disabledComment ? undefined : onPressReply}
362
+ onPress={disabledComment ? undefined : onHandleReply}
369
363
  style={styles.likeBtn}
370
364
  >
371
365
  <Typography.CaptionBold style={styles.btnText}>
372
366
  Reply
373
367
  </Typography.CaptionBold>
374
368
  </TouchableOpacity>
375
- {!isVisitorOrBot && (
376
- <TouchableOpacity onPress={openModal}>
377
- <SvgXml
378
- xml={threeDots(theme.colors.baseShade2)}
379
- width="20"
380
- height="20"
381
- />
382
- </TouchableOpacity>
383
- )}
369
+ <TouchableOpacity onPress={openModal}>
370
+ <SvgXml
371
+ xml={threeDots(theme.colors.baseShade2)}
372
+ width="20"
373
+ height="20"
374
+ />
375
+ </TouchableOpacity>
384
376
  </View>
385
377
 
386
378
  {likeReaction > 0 && (
@@ -44,7 +44,6 @@ import { useNavigation } from '@react-navigation/native';
44
44
  import { NativeStackNavigationProp } from '@react-navigation/native-stack';
45
45
  import { RootStackParamList } from '../../../../../core/routes/RouteParamList';
46
46
  import { useTimeDifference } from '../../../../hooks';
47
- import { useGlobalBehavior } from '../../../../hooks/useGlobalBehavior';
48
47
  import { useToast } from '../../../../../core/stores/slices/toastSlice';
49
48
  import AmityReactionListComponent from '../../../../features/reaction/components/List';
50
49
 
@@ -156,12 +155,6 @@ export default function ReplyCommentList({
156
155
  await addCommentReaction(commentId, 'like');
157
156
  }
158
157
  };
159
-
160
- const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
161
-
162
- const onPressLike = () =>
163
- handleGlobalBehavior({ defaultBehavior: addReactionToComment });
164
-
165
158
  const deletePostObject = () => {
166
159
  Alert.alert('Delete reply', `This reply will be permanently deleted.`, [
167
160
  {
@@ -176,7 +169,6 @@ export default function ReplyCommentList({
176
169
  ]);
177
170
  setIsVisible(false);
178
171
  };
179
-
180
172
  const reportCommentObject = async () => {
181
173
  if (isReportByMe) {
182
174
  const unReportPost = await unReportTargetById('comment', commentId);
@@ -275,7 +267,10 @@ export default function ReplyCommentList({
275
267
  </Typography.Caption>
276
268
  )}
277
269
  </View>
278
- <TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
270
+ <TouchableOpacity
271
+ onPress={() => addReactionToComment()}
272
+ style={styles.likeBtn}
273
+ >
279
274
  <Typography.CaptionBold
280
275
  style={isLike ? styles.likedText : styles.btnText}
281
276
  >
@@ -283,15 +278,13 @@ export default function ReplyCommentList({
283
278
  </Typography.CaptionBold>
284
279
  </TouchableOpacity>
285
280
 
286
- {!isVisitorOrBot && (
287
- <TouchableOpacity onPress={openModal} style={styles.threeDots}>
288
- <SvgXml
289
- xml={threeDots(theme.colors.base)}
290
- width="20"
291
- height="16"
292
- />
293
- </TouchableOpacity>
294
- )}
281
+ <TouchableOpacity onPress={openModal} style={styles.threeDots}>
282
+ <SvgXml
283
+ xml={threeDots(theme.colors.base)}
284
+ width="20"
285
+ height="16"
286
+ />
287
+ </TouchableOpacity>
295
288
  </View>
296
289
  {likeReaction > 0 && (
297
290
  <TouchableOpacity
@@ -1,11 +1,7 @@
1
1
  import { FC, memo } from 'react';
2
2
  import { TouchableOpacityProps } from 'react-native';
3
3
  import { ComponentID, ElementID, PageID } from '../../enums/enumUIKitID';
4
- import {
5
- useAmityElement,
6
- useGlobalBehavior,
7
- useJoinCommunity,
8
- } from '../../hooks';
4
+ import { useAmityElement, useJoinCommunity } from '../../hooks';
9
5
  import { Button, BUTTON_SIZE } from '../../components/Button/Button';
10
6
  import { plus } from '../../../core/assets/icons';
11
7
  import { useCustomRankingGlobalFeed } from '../../hooks/useCustomRankingGlobalFeed';
@@ -40,13 +36,9 @@ const CommunityJoinButton: FC<CommunityJoinButtonType> = ({
40
36
  },
41
37
  });
42
38
 
43
- const { handleGlobalBehavior } = useGlobalBehavior();
44
-
45
39
  const handleJoinCommunity = () => {
46
40
  if (!communityId) return;
47
- handleGlobalBehavior({
48
- defaultBehavior: () => joinCommunity(communityId),
49
- });
41
+ joinCommunity(communityId);
50
42
  };
51
43
 
52
44
  if (isExcluded) return null;
@@ -43,7 +43,7 @@ import { useTheme } from 'react-native-paper';
43
43
  import type { MyMD3Theme } from '../../../../../../core/providers/AmityUIKitProvider';
44
44
  import ReplyCommentList from '../ReplyCommentList/index';
45
45
  import { CommentRepository } from '@amityco/ts-sdk-react-native';
46
- import { useGlobalBehavior, useTimeDifference } from '../../../../../hooks';
46
+ import { useTimeDifference } from '../../../../../hooks';
47
47
  import ModeratorBadgeElement from '../../../../../elements/ModeratorBadgeElement/ModeratorBadgeElement';
48
48
  import { BrandBadge } from '../../../../../elements/BrandBadge';
49
49
  import { ComponentID, PageID } from '../../../../../enums';
@@ -315,14 +315,6 @@ const CommentListItem = ({
315
315
  onClickReply && onClickReply(user, commentId);
316
316
  };
317
317
 
318
- const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
319
-
320
- const onPressLike = () =>
321
- handleGlobalBehavior({ defaultBehavior: addReactionToComment });
322
-
323
- const onPressReply = () =>
324
- handleGlobalBehavior({ defaultBehavior: onHandleReply });
325
-
326
318
  const onPressCommentReaction = () => {
327
319
  onNavigate && onNavigate();
328
320
  setIsReactionListVisible(true);
@@ -407,26 +399,27 @@ const CommentListItem = ({
407
399
  )}
408
400
  </View>
409
401
 
410
- <TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
402
+ <TouchableOpacity
403
+ onPress={() => addReactionToComment()}
404
+ style={styles.likeBtn}
405
+ >
411
406
  <Text style={isLike ? styles.likedText : styles.btnText}>
412
407
  {!isLike ? 'Like' : 'Liked'}
413
408
  </Text>
414
409
  </TouchableOpacity>
415
- <TouchableOpacity onPress={onPressReply} style={styles.likeBtn}>
410
+ <TouchableOpacity
411
+ onPress={onHandleReply}
412
+ style={styles.likeBtn}
413
+ >
416
414
  <Text style={styles.btnText}>Reply</Text>
417
415
  </TouchableOpacity>
418
- {!isVisitorOrBot && (
419
- <TouchableOpacity
420
- onPress={openModal}
421
- style={styles.threeDots}
422
- >
423
- <SvgXml
424
- xml={threeDots(theme.colors.base)}
425
- width="20"
426
- height="16"
427
- />
428
- </TouchableOpacity>
429
- )}
416
+ <TouchableOpacity onPress={openModal} style={styles.threeDots}>
417
+ <SvgXml
418
+ xml={threeDots(theme.colors.base)}
419
+ width="20"
420
+ height="16"
421
+ />
422
+ </TouchableOpacity>
430
423
  </View>
431
424
 
432
425
  {likeReaction > 0 && (
@@ -27,7 +27,6 @@ import {
27
27
  import { Pressable } from 'react-native';
28
28
  import useAuth from '../../../../../../core/hooks/useAuth';
29
29
  import { useTimeDifference } from '../../../../../hooks/useTimeDifference';
30
- import { useGlobalBehavior } from '../../../../../hooks/useGlobalBehavior';
31
30
  import {
32
31
  isReportTarget,
33
32
  reportTargetById,
@@ -145,12 +144,6 @@ const ReplyCommentList = ({
145
144
  await addCommentReaction(commentId, 'like');
146
145
  }
147
146
  };
148
-
149
- const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
150
-
151
- const onPressLike = () =>
152
- handleGlobalBehavior({ defaultBehavior: addReactionToComment });
153
-
154
147
  const deleteReplyComment = () => {
155
148
  Alert.alert('Delete reply', 'This reply will be permanently deleted.', [
156
149
  {
@@ -299,20 +292,21 @@ const ReplyCommentList = ({
299
292
  )}
300
293
  </View>
301
294
 
302
- <TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
295
+ <TouchableOpacity
296
+ onPress={() => addReactionToComment()}
297
+ style={styles.likeBtn}
298
+ >
303
299
  <Text style={isLike ? styles.likedText : styles.btnText}>
304
300
  {!isLike ? 'Like' : 'Liked'}
305
301
  </Text>
306
302
  </TouchableOpacity>
307
- {!isVisitorOrBot && (
308
- <TouchableOpacity onPress={openModal} style={styles.threeDots}>
309
- <SvgXml
310
- xml={threeDots(theme.colors.base)}
311
- width="20"
312
- height="16"
313
- />
314
- </TouchableOpacity>
315
- )}
303
+ <TouchableOpacity onPress={openModal} style={styles.threeDots}>
304
+ <SvgXml
305
+ xml={threeDots(theme.colors.base)}
306
+ width="20"
307
+ height="16"
308
+ />
309
+ </TouchableOpacity>
316
310
  </View>
317
311
 
318
312
  {likeReaction > 0 && (
@@ -15,7 +15,6 @@ import AmityCreatePostMenuComponent from '../CreatePostMenu';
15
15
  import TextKeyElement from '../../../../elements/TextKeyElement/TextKeyElement';
16
16
  import { usePopup } from '../../../../hooks/usePopup';
17
17
  import Popup from '../../../../components/PopupMenu/PopupMenu';
18
- import useAuth from '../../../../../core/hooks/useAuth';
19
18
 
20
19
  type AmitySocialHomeTopNavigationComponentType = {
21
20
  activeTab: string;
@@ -30,7 +29,6 @@ const AmitySocialHomeTopNavigationComponent: FC<
30
29
  const theme = componentConfig.themeStyles;
31
30
  const { AmitySocialHomeTopNavigationComponentBehaviour } = useBehaviour();
32
31
  const { isOpen, setIsOpen, toggle } = usePopup();
33
- const { isVisitorOrBot } = useAuth();
34
32
 
35
33
  const [myCommunitiesTab] = useUiKitConfig({
36
34
  page: PageID.social_home_page,
@@ -171,7 +169,7 @@ const AmitySocialHomeTopNavigationComponent: FC<
171
169
  >
172
170
  <Image source={searchIcon} style={styles.icon} />
173
171
  </TouchableOpacity>
174
- {!isVisitorOrBot && activeTab !== exploreTab && (
172
+ {activeTab !== exploreTab && (
175
173
  <TouchableOpacity
176
174
  style={styles.iconBtn}
177
175
  onPress={onPressCreate}
@@ -43,7 +43,6 @@ import NetInfo from '@react-native-community/netinfo';
43
43
  import { useToast } from '../../../../core/stores/slices/toastSlice';
44
44
  import MyAvatar from '../../../components/MyAvatar/MyAvatar';
45
45
  import { MAX_MENTION_USERS } from '../../../../core/constants';
46
- import useAuth from '../../../../core/hooks/useAuth';
47
46
 
48
47
  import { SafeAreaView } from 'react-native-safe-area-context';
49
48
  import ErrorComponent from '../../../components/ErrorComponent/ErrorComponent';
@@ -74,8 +73,6 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
74
73
  }) => {
75
74
  const pageId = PageID.post_detail_page;
76
75
  const componentId = ComponentID.WildCardComponent;
77
-
78
- const { isVisitorOrBot } = useAuth();
79
76
  const disabledInteraction = false;
80
77
  const navigation =
81
78
  useNavigation<NativeStackNavigationProp<RootStackParamList>>();
@@ -288,7 +285,7 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
288
285
  </TouchableOpacity>
289
286
  </View>
290
287
  )}
291
- {!disabledInteraction && !isVisitorOrBot && (
288
+ {!disabledInteraction && (
292
289
  <View style={styles.InputWrap}>
293
290
  <MyAvatar style={styles.myAvatar} />
294
291
  <View style={styles.inputContainer}>
@@ -401,7 +398,7 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
401
398
  postData?.targetType === 'community' && postData?.targetId
402
399
  }
403
400
  postType="post"
404
- disabledInteraction={disabledInteraction}
401
+ disabledInteraction={false}
405
402
  ListHeaderComponent={
406
403
  postData && (
407
404
  <AmityPostContentComponent
@@ -35,7 +35,6 @@ import { PostMenu } from '../../../../components/PostMenu';
35
35
  import PinBadge from '../../../../elements/PinBadge';
36
36
  import AnnouncementBadge from '../../../../elements/AnnouncementBadge';
37
37
  import { Typography } from '../../../../../core/components/Typography/Typography';
38
- import useAuth from '../../../../../core/hooks/useAuth';
39
38
 
40
39
  type AmityPostContentComponentProps = {
41
40
  post: Amity.Post;
@@ -75,7 +74,6 @@ const AmityPostContentComponent: FC<AmityPostContentComponentProps> = ({
75
74
  componentId: componentId,
76
75
  });
77
76
  const styles = useStyles(themeStyles);
78
- const { isVisitorOrBot } = useAuth();
79
77
  const [textPost, setTextPost] = useState<string>('');
80
78
  const [communityData, setCommunityData] = useState<Amity.Community>(null);
81
79
  const navigation =
@@ -294,11 +292,10 @@ const AmityPostContentComponent: FC<AmityPostContentComponentProps> = ({
294
292
  category === AmityPostCategory.PIN_AND_ANNOUNCEMENT) && (
295
293
  <PinBadge componentId={ComponentID.post_content} />
296
294
  )}
297
- {!isVisitorOrBot &&
298
- AmityPostContentComponentStyle ===
299
- AmityPostContentComponentStyleEnum.feed && (
300
- <PostMenu post={post} pageId={pageId} componentId={componentId} />
301
- )}
295
+ {AmityPostContentComponentStyle ===
296
+ AmityPostContentComponentStyleEnum.feed && (
297
+ <PostMenu post={post} pageId={pageId} componentId={componentId} />
298
+ )}
302
299
  </Pressable>
303
300
  <View>
304
301
  <View style={styles.bodySection}>
@@ -8,10 +8,7 @@ import {
8
8
  } from '@amityco/ts-sdk-react-native';
9
9
  import { AmityPostEngagementActionsSubComponentType } from './type';
10
10
  import { useStyles } from './styles';
11
- import {
12
- useAmityComponent,
13
- useInteractionBehavior,
14
- } from '../../../../../hooks';
11
+ import { useAmityComponent } from '../../../../../hooks';
15
12
  import { PageID, ComponentID } from '../../../../../enums';
16
13
  import { SvgXml } from 'react-native-svg';
17
14
  import { likeReaction } from '../../../../../../core/assets/icons/xml';
@@ -37,7 +34,6 @@ const DetailStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
37
34
  componentId: ComponentID.post_content,
38
35
  });
39
36
  const styles = useStyles(themeStyles);
40
- const { handleInteraction } = useInteractionBehavior();
41
37
  const [postData, setPostData] = useState<Amity.Post>(null);
42
38
 
43
39
  const { shareLink, handleSharePress } = usePostShareAction({
@@ -99,20 +95,19 @@ const DetailStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
99
95
  }
100
96
  }, [isLike, postId]);
101
97
 
102
- const onPressReaction = useCallback(() => {
103
- handleInteraction({
104
- defaultBehavior: addReactionToPost,
105
- isJoined: community ? community.isJoined : true,
106
- });
107
- }, [addReactionToPost, handleInteraction, community]);
108
-
109
98
  const onClickReactions = useCallback(() => {
110
- handleInteraction({
111
- defaultBehavior: () => setIsReactionListVisible(true),
112
- allowNonMember: true,
113
- isJoined: community?.isJoined,
114
- });
115
- }, [handleInteraction, community]);
99
+ setIsReactionListVisible(true);
100
+ }, []);
101
+
102
+ if (community && community.isJoined === false) {
103
+ return (
104
+ <View style={styles.actionSection}>
105
+ <Text style={styles.btnText}>
106
+ Join community to interact with all posts
107
+ </Text>
108
+ </View>
109
+ );
110
+ }
116
111
 
117
112
  return (
118
113
  <>
@@ -141,7 +136,7 @@ const DetailStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
141
136
  </View>
142
137
  <View style={[styles.actionSection, styles.detailActionSection]}>
143
138
  <View style={styles.row}>
144
- <TouchableOpacity onPress={onPressReaction} style={styles.likeBtn}>
139
+ <TouchableOpacity onPress={addReactionToPost} style={styles.likeBtn}>
145
140
  {isLike ? (
146
141
  <SvgXml
147
142
  xml={likeReaction(themeStyles.colors.background)}
@@ -8,10 +8,7 @@ import {
8
8
  subscribeTopic,
9
9
  } from '@amityco/ts-sdk-react-native';
10
10
  import { useStyles } from './styles';
11
- import {
12
- useAmityComponent,
13
- useInteractionBehavior,
14
- } from '../../../../../hooks';
11
+ import { useAmityComponent } from '../../../../../hooks';
15
12
  import { PageID, ComponentID } from '../../../../../enums';
16
13
  import { SvgXml } from 'react-native-svg';
17
14
  import { likeReaction } from '../../../../../../core/assets/icons/xml';
@@ -41,7 +38,6 @@ const FeedStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
41
38
  });
42
39
  const styles = useStyles(themeStyles);
43
40
  const { AmityGlobalFeedComponentBehavior } = useBehaviour();
44
- const { handleInteraction } = useInteractionBehavior();
45
41
  const navigation =
46
42
  useNavigation<NativeStackNavigationProp<RootStackParamList>>();
47
43
  const [postData, setPostData] = useState<Amity.Post>(null);
@@ -85,14 +81,7 @@ const FeedStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
85
81
  }
86
82
  }, [isLike, postData, postId]);
87
83
 
88
- const onPressReaction = useCallback(() => {
89
- handleInteraction({
90
- defaultBehavior: addReactionToPost,
91
- isJoined: community ? community.isJoined : true,
92
- });
93
- }, [addReactionToPost, handleInteraction, community]);
94
-
95
- const goToPostDetail = useCallback(() => {
84
+ const onPressComment = useCallback(() => {
96
85
  if (AmityGlobalFeedComponentBehavior.goToPostDetailPage) {
97
86
  return AmityGlobalFeedComponentBehavior.goToPostDetailPage();
98
87
  }
@@ -101,17 +90,20 @@ const FeedStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
101
90
  });
102
91
  }, [AmityGlobalFeedComponentBehavior, navigation, postId]);
103
92
 
104
- const onPressComment = useCallback(() => {
105
- handleInteraction({
106
- defaultBehavior: goToPostDetail,
107
- isJoined: community ? community.isJoined : true,
108
- });
109
- }, [goToPostDetail, handleInteraction, community]);
93
+ if (community && community.isJoined === false) {
94
+ return (
95
+ <View style={styles.actionSection}>
96
+ <Text style={styles.btnText}>
97
+ Join community to interact with all posts
98
+ </Text>
99
+ </View>
100
+ );
101
+ }
110
102
 
111
103
  return (
112
104
  <Pressable onPress={onPressComment} style={styles.actionSection}>
113
105
  <View style={styles.row}>
114
- <TouchableOpacity onPress={onPressReaction} style={styles.likeBtn}>
106
+ <TouchableOpacity onPress={addReactionToPost} style={styles.likeBtn}>
115
107
  {isLike ? (
116
108
  <SvgXml
117
109
  xml={likeReaction(themeStyles.colors.background)}