@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
@@ -29,6 +29,7 @@ import { useFile } from '../../../hooks/useFile';
29
29
  import { getMediaTypeFromUrl } from '../../../../core/utils/url';
30
30
  import { LoadingOverlay } from '../../../components/legacy/LoadingOverlay';
31
31
  import mime from 'mime';
32
+ import { appendFileToFormData } from '../../../../core/utils/fileUpload';
32
33
  import { useToast } from '../../../../core/stores/slices/toastSlice';
33
34
  import { SafeAreaView } from 'react-native-safe-area-context';
34
35
 
@@ -119,11 +120,14 @@ const AmityDraftStoryPage: FC<IAmityDraftStoryPage> = ({
119
120
  const isImage = type === StoryType.image;
120
121
  const mimeType =
121
122
  mime.getType(mediaType.uri) ?? (isImage ? 'image/jpeg' : 'video/mp4');
122
- formData.append('files', {
123
- uri: mediaType.uri,
124
- name: mediaType.name,
125
- type: mimeType,
126
- } as unknown as Blob);
123
+
124
+ await appendFileToFormData(
125
+ formData,
126
+ 'files',
127
+ mediaType.uri,
128
+ mediaType.name,
129
+ mimeType
130
+ );
127
131
 
128
132
  try {
129
133
  setLoading(true);
@@ -13,11 +13,7 @@ import {
13
13
  } from 'react-native';
14
14
  import LinearGradient from 'react-native-linear-gradient';
15
15
  import { FC, memo, useCallback, useRef, useState } from 'react';
16
- import {
17
- useConfigImageUri,
18
- useInteractionBehavior,
19
- useStory,
20
- } from '../../../../hooks';
16
+ import { useConfigImageUri, useStory } from '../../../../hooks';
21
17
  import { useStyles } from '../styles';
22
18
  import Video, { OnLoadData } from 'react-native-video';
23
19
  import {
@@ -44,7 +40,6 @@ import GestureRecognizer from 'react-native-swipe-gestures';
44
40
  import uiSlice from '../../../../../core/stores/slices/uiSlice';
45
41
  import { LoadingOverlay } from '../../../../components/legacy/LoadingOverlay';
46
42
  import Toast from '../../../../components/legacy/Toast/Toast';
47
- import GlobalToast from '../../../../components/Toast';
48
43
  import { Typography } from '../../../../../core/components/Typography/Typography';
49
44
  import { useTheme } from 'react-native-paper';
50
45
  import { MyMD3Theme } from '../../../../../core/providers/AmityUIKitProvider';
@@ -92,7 +87,6 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
92
87
  const progress = useRef(new Animated.Value(0)).current;
93
88
  const sheetRef = useRef<BottomSheetMethods>(null);
94
89
  const { handleReaction } = useStory();
95
- const { handleInteraction } = useInteractionBehavior();
96
90
  const currentStory = storyData[current];
97
91
  const storyHyperLink = currentStory?.items[0]?.data || undefined;
98
92
  const timeDifference = useTimeDifference(currentStory?.createdAt, true);
@@ -210,24 +204,33 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
210
204
  }, [progress]);
211
205
 
212
206
  const onPressReaction = useCallback(() => {
213
- handleInteraction({
214
- defaultBehavior: () => {
215
- handleReaction({
216
- targetId: currentStory?.storyId,
217
- reactionName: 'like',
218
- isLiked,
219
- });
220
- setTotalReaction((prev) => (isLiked ? prev - 1 : prev + 1));
221
- setIsLiked((prev) => !prev);
207
+ if (communityData?.isJoined) {
208
+ handleReaction({
209
+ targetId: currentStory?.storyId,
210
+ reactionName: 'like',
211
+ isLiked,
212
+ });
213
+ setTotalReaction((prev) => (isLiked ? prev - 1 : prev + 1));
214
+ setIsLiked((prev) => !prev);
215
+ return;
216
+ }
217
+ progress.stopAnimation(() => setPressed(true));
218
+ Alert.alert('Join community to interact with all stories', null, [
219
+ {
220
+ text: 'OK',
221
+ onPress: () => {
222
+ startAnimation();
223
+ setPressed(false);
224
+ },
222
225
  },
223
- isJoined: communityData?.isJoined,
224
- });
226
+ ]);
225
227
  }, [
226
228
  communityData?.isJoined,
227
229
  currentStory?.storyId,
228
- handleInteraction,
229
230
  handleReaction,
230
231
  isLiked,
232
+ progress,
233
+ startAnimation,
231
234
  ]);
232
235
 
233
236
  const onCloseBottomSheet = useCallback(() => {
@@ -672,7 +675,6 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
672
675
  </BottomSheet>
673
676
  <LoadingOverlay isLoading={loading} />
674
677
  <Toast />
675
- <GlobalToast />
676
678
  </View>
677
679
  );
678
680
  };
@@ -8,7 +8,7 @@ import { NativeStackNavigationProp } from '@react-navigation/native-stack';
8
8
  import { RootStackParamList } from '../../../../../../../core/routes/RouteParamList';
9
9
  import { UserRelationshipTab } from '../../../../../../types';
10
10
  import { useBehaviour } from '../../../../../../providers/BehaviourProvider';
11
- import { useBlockUser, useGlobalBehavior } from '../../../../../../hooks';
11
+ import { useBlockUser } from '../../../../../../hooks';
12
12
  import useAuth from '../../../../../../../core/hooks/useAuth';
13
13
  import { useFollowUser } from '../../../../../../hooks/queries/useFollowUser';
14
14
  import useSocialSettings from '../../../../../../../core/hooks/useSocialSettings';
@@ -31,7 +31,6 @@ export function useHeader(user?: Amity.User) {
31
31
  const { openBottomSheet, closeBottomSheet, bottomSheetHeight } =
32
32
  useBottomSheet();
33
33
  const { showToast } = useToast();
34
- const { handleGlobalBehavior } = useGlobalBehavior();
35
34
  const {
36
35
  followUser,
37
36
  unfollowUser,
@@ -57,9 +56,7 @@ export function useHeader(user?: Amity.User) {
57
56
 
58
57
  const handleFollow = () => {
59
58
  if (!user?.userId) return;
60
- handleGlobalBehavior({
61
- defaultBehavior: () => followUser(user.userId),
62
- });
59
+ followUser(user.userId);
63
60
  };
64
61
 
65
62
  const handleUnfollow = () => {
@@ -35,5 +35,3 @@ export * from './usePostSubscription';
35
35
  export * from './useRoomSubscription';
36
36
  export * from './queries/useFlagPost';
37
37
  export * from './queries/useClosePoll';
38
- export * from './useGlobalBehavior';
39
- export * from './useInteractionBehavior';
@@ -12,14 +12,13 @@ type UsePostPermissionParams = {
12
12
  };
13
13
 
14
14
  export function usePostPermission({ community }: UsePostPermissionParams) {
15
- const { client, isVisitorOrBot } = useAuth();
15
+ const { client } = useAuth();
16
16
  const [hasPostPermission, setHasPostPermission] = useState(false);
17
17
 
18
18
  const isOnlyAdminCanPost =
19
19
  community?.postSetting === CommunityPostSettings.ONLY_ADMIN_CAN_POST;
20
20
 
21
21
  useEffect(() => {
22
- if (isVisitorOrBot) return;
23
22
  if (!community?.communityId || !client?.userId) return;
24
23
 
25
24
  CommunityRepository.Membership.getMembers(
@@ -42,7 +41,6 @@ export function usePostPermission({ community }: UsePostPermissionParams) {
42
41
  client?.userId,
43
42
  isOnlyAdminCanPost,
44
43
  community?.isJoined,
45
- isVisitorOrBot,
46
44
  ]);
47
45
 
48
46
  return hasPostPermission;
@@ -4,19 +4,17 @@ import useSocialSettings from '../../core/hooks/useSocialSettings';
4
4
  import { checkStoryPermission, isAdmin } from '../utils/permissions';
5
5
 
6
6
  export function useStoryPermission(communityId?: string) {
7
- const { client, isVisitorOrBot } = useAuth();
7
+ const { client } = useAuth();
8
8
  const { socialSettings } = useSocialSettings();
9
9
  const user = useUser(client?.userId || '');
10
10
 
11
11
  const isGlobalAdmin = isAdmin(user?.roles);
12
12
 
13
- const hasStoryPermission =
14
- !isVisitorOrBot &&
15
- (!communityId
16
- ? socialSettings?.story?.allowAllUserToCreateStory
17
- : socialSettings?.story?.allowAllUserToCreateStory ||
18
- isGlobalAdmin ||
19
- checkStoryPermission(client, communityId));
13
+ const hasStoryPermission = !communityId
14
+ ? socialSettings?.story?.allowAllUserToCreateStory
15
+ : socialSettings?.story?.allowAllUserToCreateStory ||
16
+ isGlobalAdmin ||
17
+ checkStoryPermission(client, communityId);
20
18
 
21
19
  return { hasStoryPermission };
22
20
  }
@@ -14,7 +14,6 @@ export const BehaviourProvider = ({
14
14
  }: IBehavioudProviderProps) => {
15
15
  const defaultBehaviour = useMemo(
16
16
  () => ({
17
- AmityGlobalBehaviour: {},
18
17
  AmitySocialHomePageBehaviour: {},
19
18
  AmityGlobalFeedComponentBehavior: {},
20
19
  AmityPostContentComponentBehavior: {},
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { useCallback, useEffect, useRef, useState } from 'react';
2
+ import { useCallback, useRef, useState } from 'react';
3
3
  import { StyleSheet, View } from 'react-native';
4
4
  import CustomSocialTab from '../../components/CustomSocialTab/CustomSocialTab';
5
5
  import { useUiKitConfig } from '../../hooks';
@@ -20,7 +20,7 @@ const PROFILE_TAB = 'Profile';
20
20
 
21
21
  const AmitySocialHomePage = () => {
22
22
  const theme = useTheme() as MyMD3Theme;
23
- const { client, isVisitorOrBot } = useAuth();
23
+ const { client } = useAuth();
24
24
 
25
25
  const styles = StyleSheet.create({
26
26
  container: {
@@ -55,13 +55,6 @@ const AmitySocialHomePage = () => {
55
55
  const [activeTab, setActiveTab] = useState<string>(newsFeedTab);
56
56
  const visitedTabs = useRef<Set<string>>(new Set([newsFeedTab]));
57
57
 
58
- useEffect(() => {
59
- if (isVisitorOrBot) {
60
- visitedTabs.current.add(exploreTab);
61
- setActiveTab(exploreTab);
62
- }
63
- }, [isVisitorOrBot, exploreTab]);
64
-
65
58
  const onTabChange = useCallback(
66
59
  (tabName: string) => {
67
60
  if (AmitySocialHomePageBehaviour?.onChooseTab)
@@ -92,27 +85,21 @@ const AmitySocialHomePage = () => {
92
85
  <CustomSocialTab
93
86
  activeTab={activeTab}
94
87
  onTabChange={onTabChange}
95
- tabNames={
96
- isVisitorOrBot
97
- ? [exploreTab]
98
- : [newsFeedTab, exploreTab, myCommunitiesTab, PROFILE_TAB]
99
- }
88
+ tabNames={[newsFeedTab, exploreTab, myCommunitiesTab, PROFILE_TAB]}
100
89
  />
101
90
  <Divider />
102
- {!isVisitorOrBot && (
103
- <View style={tabStyle(newsFeedTab)}>
104
- <AmityNewsFeedComponent
105
- pageId={PageID.social_home_page}
106
- onPressExploreCommunity={onPressExploreCommunity}
107
- />
108
- </View>
109
- )}
91
+ <View style={tabStyle(newsFeedTab)}>
92
+ <AmityNewsFeedComponent
93
+ pageId={PageID.social_home_page}
94
+ onPressExploreCommunity={onPressExploreCommunity}
95
+ />
96
+ </View>
110
97
  {visitedTabs.current.has(exploreTab) && (
111
98
  <View style={tabStyle(exploreTab)}>
112
99
  <AmityExploreComponent pageId={PageID.social_home_page} />
113
100
  </View>
114
101
  )}
115
- {!isVisitorOrBot && visitedTabs.current.has(myCommunitiesTab) && (
102
+ {visitedTabs.current.has(myCommunitiesTab) && (
116
103
  <View style={tabStyle(myCommunitiesTab)}>
117
104
  <AmityMyCommunitiesComponent
118
105
  pageId={PageID.social_home_page}
@@ -120,7 +107,7 @@ const AmitySocialHomePage = () => {
120
107
  />
121
108
  </View>
122
109
  )}
123
- {!isVisitorOrBot && visitedTabs.current.has(PROFILE_TAB) && (
110
+ {visitedTabs.current.has(PROFILE_TAB) && (
124
111
  <View style={tabStyle(PROFILE_TAB)}>
125
112
  <UserProfile inline stickyTab={false} userId={client?.userId ?? ''} />
126
113
  </View>
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.icon = exports.default = void 0;
7
- const icon = () => `<svg
8
- width="100%"
9
- height="100%"
10
- viewBox="0 0 60 40"
11
- fill="none"
12
- xmlns="http://www.w3.org/2000/svg"
13
- >
14
- <path
15
- d="M57.5 0C58.8542 0 60 1.14583 60 2.5V37.5C60 38.9583 58.8542 40 57.5 40H5C2.1875 40 0 37.8125 0 35V5.83333C0 4.47917 1.04167 3.33333 2.5 3.33333H6.66667V2.5C6.66667 1.14583 7.70833 0 9.16667 0H57.5ZM3.33333 35C3.33333 35.9375 4.0625 36.6667 5 36.6667C5.83333 36.6667 6.66667 35.9375 6.66667 35V6.66667H3.33333V35ZM56.6667 36.6667V3.33333H10V35V35.1042C10 35.5208 9.79167 36.25 9.6875 36.6667H56.6667Z"
16
- fill="currentColor"
17
- />
18
- <path
19
- d="M36.0494 25.4322C36.0494 26.8211 34.9383 27.9013 33.5803 27.9013C32.1914 27.9013 31.1111 26.8211 31.1111 25.4322C31.1111 24.0742 32.1914 22.9631 33.5803 22.9631C34.9383 22.9631 36.0494 24.0742 36.0494 25.4322ZM31.3889 12.9013C31.358 12.4692 31.6975 12.0989 32.1296 12.0989H35C35.4321 12.0989 35.7716 12.4692 35.7407 12.9013L35.3395 21.2964C35.3086 21.6668 34.9691 21.9754 34.5988 21.9754H32.5309C32.1605 21.9754 31.821 21.6668 31.7901 21.2964L31.3889 12.9013Z"
20
- fill="currentColor"
21
- />
22
- </svg>
23
- `;
24
- exports.icon = icon;
25
- var _default = exports.default = icon;
26
- //# sourceMappingURL=visitorLimit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["icon","exports","_default","default"],"sourceRoot":"../../../../../src","sources":["core/assets/icons/visitorLimit.tsx"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAGA,CAAA,KAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAACC,OAAA,CAAAD,IAAA,GAAAA,IAAA;AAAA,IAAAE,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEaH,IAAI","ignoreList":[]}
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UsageLimit = UsageLimit;
7
- var _reactNative = require("react-native");
8
- var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
9
- var _reactNativeSvg = require("react-native-svg");
10
- var _Typography = require("../../../../core/components/Typography/Typography");
11
- var _icons = require("../../../../core/assets/icons");
12
- var _constants = require("../../../../core/constants");
13
- var _hooks = require("./hooks");
14
- function UsageLimit() {
15
- const {
16
- styles,
17
- theme,
18
- onPressSignIn
19
- } = (0, _hooks.useUsageLimit)();
20
- return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView, {
21
- style: styles.container,
22
- edges: ['top', 'left']
23
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
24
- style: styles.contentContainer
25
- }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgXml, {
26
- accessible: true,
27
- accessibilityLabel: "Usage limit reached",
28
- width: 60,
29
- height: 40,
30
- style: styles.icon,
31
- xml: (0, _icons.visitorLimit)(),
32
- color: theme.colors.secondaryShade4
33
- }), /*#__PURE__*/React.createElement(_Typography.Typography.TitleBold, {
34
- style: styles.title
35
- }, _constants.VISITOR_USAGE_LIMIT_MESSAGE.TITLE), /*#__PURE__*/React.createElement(_Typography.Typography.Caption, {
36
- style: styles.subtitle
37
- }, _constants.VISITOR_USAGE_LIMIT_MESSAGE.SUBTITLE), /*#__PURE__*/React.createElement(_reactNative.TouchableOpacity, {
38
- style: styles.signInButton,
39
- onPress: onPressSignIn,
40
- accessibilityRole: "button",
41
- accessibilityLabel: _constants.VISITOR_USAGE_LIMIT_MESSAGE.SIGN_IN
42
- }, /*#__PURE__*/React.createElement(_Typography.Typography.BodyBold, {
43
- style: styles.signInText
44
- }, _constants.VISITOR_USAGE_LIMIT_MESSAGE.SIGN_IN))));
45
- }
46
- //# sourceMappingURL=UsageLimit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_reactNativeSafeAreaContext","_reactNativeSvg","_Typography","_icons","_constants","_hooks","UsageLimit","styles","theme","onPressSignIn","useUsageLimit","React","createElement","SafeAreaView","style","container","edges","View","contentContainer","SvgXml","accessible","accessibilityLabel","width","height","icon","xml","visitorLimit","color","colors","secondaryShade4","Typography","TitleBold","title","VISITOR_USAGE_LIMIT_MESSAGE","TITLE","Caption","subtitle","SUBTITLE","TouchableOpacity","signInButton","onPress","accessibilityRole","SIGN_IN","BodyBold","signInText"],"sourceRoot":"../../../../../../src","sources":["social/features/visitor/UsageLimit/UsageLimit.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,2BAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAEO,SAASO,UAAUA,CAAA,EAAG;EAC3B,MAAM;IAAEC,MAAM;IAAEC,KAAK;IAAEC;EAAc,CAAC,GAAG,IAAAC,oBAAa,EAAC,CAAC;EAExD,oBACEC,KAAA,CAAAC,aAAA,CAACZ,2BAAA,CAAAa,YAAY;IAACC,KAAK,EAAEP,MAAM,CAACQ,SAAU;IAACC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM;EAAE,gBAC5DL,KAAA,CAAAC,aAAA,CAACd,YAAA,CAAAmB,IAAI;IAACH,KAAK,EAAEP,MAAM,CAACW;EAAiB,gBACnCP,KAAA,CAAAC,aAAA,CAACX,eAAA,CAAAkB,MAAM;IACLC,UAAU;IACVC,kBAAkB,EAAC,qBAAqB;IACxCC,KAAK,EAAE,EAAG;IACVC,MAAM,EAAE,EAAG;IACXT,KAAK,EAAEP,MAAM,CAACiB,IAAK;IACnBC,GAAG,EAAE,IAAAC,mBAAY,EAAC,CAAE;IACpBC,KAAK,EAAEnB,KAAK,CAACoB,MAAM,CAACC;EAAgB,CACrC,CAAC,eACFlB,KAAA,CAAAC,aAAA,CAACV,WAAA,CAAA4B,UAAU,CAACC,SAAS;IAACjB,KAAK,EAAEP,MAAM,CAACyB;EAAM,GACvCC,sCAA2B,CAACC,KACT,CAAC,eACvBvB,KAAA,CAAAC,aAAA,CAACV,WAAA,CAAA4B,UAAU,CAACK,OAAO;IAACrB,KAAK,EAAEP,MAAM,CAAC6B;EAAS,GACxCH,sCAA2B,CAACI,QACX,CAAC,eACrB1B,KAAA,CAAAC,aAAA,CAACd,YAAA,CAAAwC,gBAAgB;IACfxB,KAAK,EAAEP,MAAM,CAACgC,YAAa;IAC3BC,OAAO,EAAE/B,aAAc;IACvBgC,iBAAiB,EAAC,QAAQ;IAC1BpB,kBAAkB,EAAEY,sCAA2B,CAACS;EAAQ,gBAExD/B,KAAA,CAAAC,aAAA,CAACV,WAAA,CAAA4B,UAAU,CAACa,QAAQ;IAAC7B,KAAK,EAAEP,MAAM,CAACqC;EAAW,GAC3CX,sCAA2B,CAACS,OACV,CACL,CACd,CACM,CAAC;AAEnB","ignoreList":[]}
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "useUsageLimit", {
7
- enumerable: true,
8
- get: function () {
9
- return _useUsageLimit.useUsageLimit;
10
- }
11
- });
12
- var _useUsageLimit = require("./useUsageLimit");
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_useUsageLimit","require"],"sourceRoot":"../../../../../../../src","sources":["social/features/visitor/UsageLimit/hooks/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA","ignoreList":[]}
@@ -1,54 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useUsageLimit = void 0;
7
- var _react = require("react");
8
- var _reactNative = require("react-native");
9
- var _styles = require("../styles");
10
- var _toastSlice = require("../../../../../core/stores/slices/toastSlice");
11
- var _BehaviourProvider = require("../../../../providers/BehaviourProvider");
12
- var _constants = require("../../../../../core/constants");
13
- const useUsageLimit = () => {
14
- const {
15
- styles,
16
- theme
17
- } = (0, _styles.useStyles)();
18
- const {
19
- showToast
20
- } = (0, _toastSlice.useToast)();
21
- const {
22
- AmityGlobalBehaviour
23
- } = (0, _BehaviourProvider.useBehaviour)();
24
- const showSignInToast = (0, _react.useCallback)(() => {
25
- showToast({
26
- message: _constants.VISITOR_USAGE_LIMIT_MESSAGE.TOAST,
27
- type: 'informative',
28
- duration: _constants.VISITOR_TOAST_DURATION
29
- });
30
- }, []);
31
- (0, _react.useEffect)(() => {
32
- showSignInToast();
33
- }, [showSignInToast]);
34
-
35
- // Dead-end page: swallow the Android hardware back press so the user
36
- // cannot navigate away from the error state.
37
- (0, _react.useEffect)(() => {
38
- const subscription = _reactNative.BackHandler.addEventListener('hardwareBackPress', () => true);
39
- return () => subscription.remove();
40
- }, []);
41
- const onPressSignIn = (0, _react.useCallback)(() => {
42
- if (AmityGlobalBehaviour !== null && AmityGlobalBehaviour !== void 0 && AmityGlobalBehaviour.handleVisitorUsageLimitSignIn) {
43
- return AmityGlobalBehaviour.handleVisitorUsageLimitSignIn();
44
- }
45
- showSignInToast();
46
- }, [AmityGlobalBehaviour, showSignInToast]);
47
- return {
48
- styles,
49
- theme,
50
- onPressSignIn
51
- };
52
- };
53
- exports.useUsageLimit = useUsageLimit;
54
- //# sourceMappingURL=useUsageLimit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_reactNative","_styles","_toastSlice","_BehaviourProvider","_constants","useUsageLimit","styles","theme","useStyles","showToast","useToast","AmityGlobalBehaviour","useBehaviour","showSignInToast","useCallback","message","VISITOR_USAGE_LIMIT_MESSAGE","TOAST","type","duration","VISITOR_TOAST_DURATION","useEffect","subscription","BackHandler","addEventListener","remove","onPressSignIn","handleVisitorUsageLimitSignIn","exports"],"sourceRoot":"../../../../../../../src","sources":["social/features/visitor/UsageLimit/hooks/useUsageLimit.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAKO,MAAMM,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC,MAAM;IAAEC;EAAM,CAAC,GAAG,IAAAC,iBAAS,EAAC,CAAC;EACrC,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,oBAAQ,EAAC,CAAC;EAChC,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAC,+BAAY,EAAC,CAAC;EAE/C,MAAMC,eAAe,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACxCL,SAAS,CAAC;MACRM,OAAO,EAAEC,sCAA2B,CAACC,KAAK;MAC1CC,IAAI,EAAE,aAAa;MACnBC,QAAQ,EAAEC;IACZ,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,IAAAC,gBAAS,EAAC,MAAM;IACdR,eAAe,CAAC,CAAC;EACnB,CAAC,EAAE,CAACA,eAAe,CAAC,CAAC;;EAErB;EACA;EACA,IAAAQ,gBAAS,EAAC,MAAM;IACd,MAAMC,YAAY,GAAGC,wBAAW,CAACC,gBAAgB,CAC/C,mBAAmB,EACnB,MAAM,IACR,CAAC;IACD,OAAO,MAAMF,YAAY,CAACG,MAAM,CAAC,CAAC;EACpC,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,aAAa,GAAG,IAAAZ,kBAAW,EAAC,MAAM;IACtC,IAAIH,oBAAoB,aAApBA,oBAAoB,eAApBA,oBAAoB,CAAEgB,6BAA6B,EAAE;MACvD,OAAOhB,oBAAoB,CAACgB,6BAA6B,CAAC,CAAC;IAC7D;IACAd,eAAe,CAAC,CAAC;EACnB,CAAC,EAAE,CAACF,oBAAoB,EAAEE,eAAe,CAAC,CAAC;EAE3C,OAAO;IAAEP,MAAM;IAAEC,KAAK;IAAEmB;EAAc,CAAC;AACzC,CAAC;AAACE,OAAA,CAAAvB,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "UsageLimit", {
7
- enumerable: true,
8
- get: function () {
9
- return _UsageLimit.UsageLimit;
10
- }
11
- });
12
- var _UsageLimit = require("./UsageLimit");
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_UsageLimit","require"],"sourceRoot":"../../../../../../src","sources":["social/features/visitor/UsageLimit/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA","ignoreList":[]}
@@ -1,52 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useStyles = void 0;
7
- var _reactNative = require("react-native");
8
- var _reactNativePaper = require("react-native-paper");
9
- const useStyles = () => {
10
- const theme = (0, _reactNativePaper.useTheme)();
11
- const styles = _reactNative.StyleSheet.create({
12
- container: {
13
- flex: 1,
14
- backgroundColor: theme.colors.background
15
- },
16
- contentContainer: {
17
- flex: 1,
18
- alignItems: 'center',
19
- paddingHorizontal: 32,
20
- flexDirection: 'column',
21
- justifyContent: 'center'
22
- },
23
- icon: {
24
- marginBottom: 16
25
- },
26
- title: {
27
- maxWidth: 252,
28
- textAlign: 'center',
29
- color: theme.colors.baseShade3
30
- },
31
- subtitle: {
32
- maxWidth: 252,
33
- textAlign: 'center',
34
- color: theme.colors.baseShade3
35
- },
36
- signInButton: {
37
- marginTop: 16,
38
- borderRadius: 8,
39
- paddingVertical: 10,
40
- paddingHorizontal: 16
41
- },
42
- signInText: {
43
- color: theme.colors.primary
44
- }
45
- });
46
- return {
47
- styles,
48
- theme
49
- };
50
- };
51
- exports.useStyles = useStyles;
52
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_reactNativePaper","useStyles","theme","useTheme","styles","StyleSheet","create","container","flex","backgroundColor","colors","background","contentContainer","alignItems","paddingHorizontal","flexDirection","justifyContent","icon","marginBottom","title","maxWidth","textAlign","color","baseShade3","subtitle","signInButton","marginTop","borderRadius","paddingVertical","signInText","primary","exports"],"sourceRoot":"../../../../../../src","sources":["social/features/visitor/UsageLimit/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAGO,MAAME,SAAS,GAAGA,CAAA,KAAM;EAC7B,MAAMC,KAAK,GAAG,IAAAC,0BAAQ,EAAa,CAAC;EAEpC,MAAMC,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;IAC/BC,SAAS,EAAE;MACTC,IAAI,EAAE,CAAC;MACPC,eAAe,EAAEP,KAAK,CAACQ,MAAM,CAACC;IAChC,CAAC;IACDC,gBAAgB,EAAE;MAChBJ,IAAI,EAAE,CAAC;MACPK,UAAU,EAAE,QAAQ;MACpBC,iBAAiB,EAAE,EAAE;MACrBC,aAAa,EAAE,QAAQ;MACvBC,cAAc,EAAE;IAClB,CAAC;IACDC,IAAI,EAAE;MACJC,YAAY,EAAE;IAChB,CAAC;IACDC,KAAK,EAAE;MACLC,QAAQ,EAAE,GAAG;MACbC,SAAS,EAAE,QAAQ;MACnBC,KAAK,EAAEpB,KAAK,CAACQ,MAAM,CAACa;IACtB,CAAC;IACDC,QAAQ,EAAE;MACRJ,QAAQ,EAAE,GAAG;MACbC,SAAS,EAAE,QAAQ;MACnBC,KAAK,EAAEpB,KAAK,CAACQ,MAAM,CAACa;IACtB,CAAC;IACDE,YAAY,EAAE;MACZC,SAAS,EAAE,EAAE;MACbC,YAAY,EAAE,CAAC;MACfC,eAAe,EAAE,EAAE;MACnBd,iBAAiB,EAAE;IACrB,CAAC;IACDe,UAAU,EAAE;MACVP,KAAK,EAAEpB,KAAK,CAACQ,MAAM,CAACoB;IACtB;EACF,CAAC,CAAC;EAEF,OAAO;IAAE1B,MAAM;IAAEF;EAAM,CAAC;AAC1B,CAAC;AAAC6B,OAAA,CAAA9B,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useGlobalBehavior = void 0;
7
- var _react = require("react");
8
- var _useAuth = _interopRequireDefault(require("../../core/hooks/useAuth"));
9
- var _BehaviourProvider = require("../providers/BehaviourProvider");
10
- var _toastSlice = require("../../core/stores/slices/toastSlice");
11
- var _constants = require("../../core/constants");
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- const useGlobalBehavior = () => {
14
- const {
15
- showToast
16
- } = (0, _toastSlice.useToast)();
17
- const {
18
- isVisitorOrBot
19
- } = (0, _useAuth.default)();
20
- const {
21
- AmityGlobalBehaviour
22
- } = (0, _BehaviourProvider.useBehaviour)();
23
- const handleGlobalBehavior = (0, _react.useCallback)(({
24
- defaultBehavior
25
- }) => {
26
- if (isVisitorOrBot) {
27
- if (AmityGlobalBehaviour !== null && AmityGlobalBehaviour !== void 0 && AmityGlobalBehaviour.handleVisitorUserAction) {
28
- return AmityGlobalBehaviour.handleVisitorUserAction();
29
- }
30
- return showToast({
31
- message: _constants.VISITOR_USER_ACTION_TOAST,
32
- type: 'informative',
33
- duration: _constants.VISITOR_TOAST_DURATION
34
- });
35
- }
36
- return defaultBehavior === null || defaultBehavior === void 0 ? void 0 : defaultBehavior();
37
- }, [isVisitorOrBot, AmityGlobalBehaviour, showToast]);
38
- return {
39
- handleGlobalBehavior,
40
- isVisitorOrBot
41
- };
42
- };
43
- exports.useGlobalBehavior = useGlobalBehavior;
44
- //# sourceMappingURL=useGlobalBehavior.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_useAuth","_interopRequireDefault","_BehaviourProvider","_toastSlice","_constants","e","__esModule","default","useGlobalBehavior","showToast","useToast","isVisitorOrBot","useAuth","AmityGlobalBehaviour","useBehaviour","handleGlobalBehavior","useCallback","defaultBehavior","handleVisitorUserAction","message","VISITOR_USER_ACTION_TOAST","type","duration","VISITOR_TOAST_DURATION","exports"],"sourceRoot":"../../../../src","sources":["social/hooks/useGlobalBehavior.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAG8B,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEvB,MAAMG,iBAAiB,GAAGA,CAAA,KAAM;EACrC,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,oBAAQ,EAAC,CAAC;EAChC,MAAM;IAAEC;EAAe,CAAC,GAAG,IAAAC,gBAAO,EAAC,CAAC;EACpC,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAC,+BAAY,EAAC,CAAC;EAE/C,MAAMC,oBAAoB,GAAG,IAAAC,kBAAW,EACtC,CAAC;IAAEC;EAAkD,CAAC,KAAK;IACzD,IAAIN,cAAc,EAAE;MAClB,IAAIE,oBAAoB,aAApBA,oBAAoB,eAApBA,oBAAoB,CAAEK,uBAAuB,EAAE;QACjD,OAAOL,oBAAoB,CAACK,uBAAuB,CAAC,CAAC;MACvD;MACA,OAAOT,SAAS,CAAC;QACfU,OAAO,EAAEC,oCAAyB;QAClCC,IAAI,EAAE,aAAa;QACnBC,QAAQ,EAAEC;MACZ,CAAC,CAAC;IACJ;IACA,OAAON,eAAe,aAAfA,eAAe,uBAAfA,eAAe,CAAG,CAAC;EAC5B,CAAC,EACD,CAACN,cAAc,EAAEE,oBAAoB,EAAEJ,SAAS,CAClD,CAAC;EAED,OAAO;IAAEM,oBAAoB;IAAEJ;EAAe,CAAC;AACjD,CAAC;AAACa,OAAA,CAAAhB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1,50 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useInteractionBehavior = void 0;
7
- var _react = require("react");
8
- var _BehaviourProvider = require("../providers/BehaviourProvider");
9
- var _toastSlice = require("../../core/stores/slices/toastSlice");
10
- var _useGlobalBehavior = require("./useGlobalBehavior");
11
- var _constants = require("../../core/constants");
12
- const useInteractionBehavior = () => {
13
- const {
14
- showToast
15
- } = (0, _toastSlice.useToast)();
16
- const {
17
- AmityGlobalBehaviour
18
- } = (0, _BehaviourProvider.useBehaviour)();
19
- const {
20
- handleGlobalBehavior,
21
- isVisitorOrBot
22
- } = (0, _useGlobalBehavior.useGlobalBehavior)();
23
- const handleInteraction = (0, _react.useCallback)(({
24
- defaultBehavior,
25
- allowNonMember,
26
- isJoined
27
- }) => {
28
- handleGlobalBehavior({
29
- defaultBehavior: () => {
30
- if (allowNonMember || isJoined) {
31
- return defaultBehavior === null || defaultBehavior === void 0 ? void 0 : defaultBehavior();
32
- }
33
- if (AmityGlobalBehaviour !== null && AmityGlobalBehaviour !== void 0 && AmityGlobalBehaviour.handleNonMemberAction) {
34
- return AmityGlobalBehaviour.handleNonMemberAction();
35
- }
36
- return showToast({
37
- message: _constants.NON_MEMBER_ACTION_TOAST,
38
- type: 'informative',
39
- duration: _constants.VISITOR_TOAST_DURATION
40
- });
41
- }
42
- });
43
- }, [handleGlobalBehavior, AmityGlobalBehaviour, showToast]);
44
- return {
45
- handleInteraction,
46
- isVisitorOrBot
47
- };
48
- };
49
- exports.useInteractionBehavior = useInteractionBehavior;
50
- //# sourceMappingURL=useInteractionBehavior.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_BehaviourProvider","_toastSlice","_useGlobalBehavior","_constants","useInteractionBehavior","showToast","useToast","AmityGlobalBehaviour","useBehaviour","handleGlobalBehavior","isVisitorOrBot","useGlobalBehavior","handleInteraction","useCallback","defaultBehavior","allowNonMember","isJoined","handleNonMemberAction","message","NON_MEMBER_ACTION_TOAST","type","duration","VISITOR_TOAST_DURATION","exports"],"sourceRoot":"../../../../src","sources":["social/hooks/useInteractionBehavior.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAWO,MAAMK,sBAAsB,GAAGA,CAAA,KAAM;EAC1C,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,oBAAQ,EAAC,CAAC;EAChC,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAC,+BAAY,EAAC,CAAC;EAC/C,MAAM;IAAEC,oBAAoB;IAAEC;EAAe,CAAC,GAAG,IAAAC,oCAAiB,EAAC,CAAC;EAEpE,MAAMC,iBAAiB,GAAG,IAAAC,kBAAW,EACnC,CAAC;IACCC,eAAe;IACfC,cAAc;IACdC;EACuB,CAAC,KAAK;IAC7BP,oBAAoB,CAAC;MACnBK,eAAe,EAAEA,CAAA,KAAM;QACrB,IAAIC,cAAc,IAAIC,QAAQ,EAAE;UAC9B,OAAOF,eAAe,aAAfA,eAAe,uBAAfA,eAAe,CAAG,CAAC;QAC5B;QACA,IAAIP,oBAAoB,aAApBA,oBAAoB,eAApBA,oBAAoB,CAAEU,qBAAqB,EAAE;UAC/C,OAAOV,oBAAoB,CAACU,qBAAqB,CAAC,CAAC;QACrD;QACA,OAAOZ,SAAS,CAAC;UACfa,OAAO,EAAEC,kCAAuB;UAChCC,IAAI,EAAE,aAAa;UACnBC,QAAQ,EAAEC;QACZ,CAAC,CAAC;MACJ;IACF,CAAC,CAAC;EACJ,CAAC,EACD,CAACb,oBAAoB,EAAEF,oBAAoB,EAAEF,SAAS,CACxD,CAAC;EAED,OAAO;IAAEO,iBAAiB;IAAEF;EAAe,CAAC;AAC9C,CAAC;AAACa,OAAA,CAAAnB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.VisitorUsageLimit = VisitorUsageLimit;
7
- var _UsageLimit = require("../../features/visitor/UsageLimit");
8
- function VisitorUsageLimit() {
9
- return /*#__PURE__*/React.createElement(_UsageLimit.UsageLimit, null);
10
- }
11
- //# sourceMappingURL=VisitorUsageLimit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_UsageLimit","require","VisitorUsageLimit","React","createElement","UsageLimit"],"sourceRoot":"../../../../../src","sources":["social/screens/VisitorUsageLimit/VisitorUsageLimit.tsx"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEO,SAASC,iBAAiBA,CAAA,EAAG;EAClC,oBAAOC,KAAA,CAAAC,aAAA,CAACJ,WAAA,CAAAK,UAAU,MAAE,CAAC;AACvB","ignoreList":[]}