@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,45 +0,0 @@
1
- import { StyleSheet } from 'react-native';
2
- import { useTheme } from 'react-native-paper';
3
- import type { MyMD3Theme } from '../../../../core/providers/AmityUIKitProvider';
4
-
5
- export const useStyles = () => {
6
- const theme = useTheme<MyMD3Theme>();
7
-
8
- const styles = StyleSheet.create({
9
- container: {
10
- flex: 1,
11
- backgroundColor: theme.colors.background,
12
- },
13
- contentContainer: {
14
- flex: 1,
15
- alignItems: 'center',
16
- paddingHorizontal: 32,
17
- flexDirection: 'column',
18
- justifyContent: 'center',
19
- },
20
- icon: {
21
- marginBottom: 16,
22
- },
23
- title: {
24
- maxWidth: 252,
25
- textAlign: 'center',
26
- color: theme.colors.baseShade3,
27
- },
28
- subtitle: {
29
- maxWidth: 252,
30
- textAlign: 'center',
31
- color: theme.colors.baseShade3,
32
- },
33
- signInButton: {
34
- marginTop: 16,
35
- borderRadius: 8,
36
- paddingVertical: 10,
37
- paddingHorizontal: 16,
38
- },
39
- signInText: {
40
- color: theme.colors.primary,
41
- },
42
- });
43
-
44
- return { styles, theme };
45
- };
@@ -1,33 +0,0 @@
1
- import { useCallback } from 'react';
2
- import useAuth from '../../core/hooks/useAuth';
3
- import { useBehaviour } from '../providers/BehaviourProvider';
4
- import { useToast } from '../../core/stores/slices/toastSlice';
5
- import {
6
- VISITOR_USER_ACTION_TOAST,
7
- VISITOR_TOAST_DURATION,
8
- } from '../../core/constants';
9
-
10
- export const useGlobalBehavior = () => {
11
- const { showToast } = useToast();
12
- const { isVisitorOrBot } = useAuth();
13
- const { AmityGlobalBehaviour } = useBehaviour();
14
-
15
- const handleGlobalBehavior = useCallback(
16
- ({ defaultBehavior }: { defaultBehavior?: () => void }) => {
17
- if (isVisitorOrBot) {
18
- if (AmityGlobalBehaviour?.handleVisitorUserAction) {
19
- return AmityGlobalBehaviour.handleVisitorUserAction();
20
- }
21
- return showToast({
22
- message: VISITOR_USER_ACTION_TOAST,
23
- type: 'informative',
24
- duration: VISITOR_TOAST_DURATION,
25
- });
26
- }
27
- return defaultBehavior?.();
28
- },
29
- [isVisitorOrBot, AmityGlobalBehaviour, showToast]
30
- );
31
-
32
- return { handleGlobalBehavior, isVisitorOrBot };
33
- };
@@ -1,47 +0,0 @@
1
- import { useCallback } from 'react';
2
- import { useBehaviour } from '../providers/BehaviourProvider';
3
- import { useToast } from '../../core/stores/slices/toastSlice';
4
- import { useGlobalBehavior } from './useGlobalBehavior';
5
- import {
6
- NON_MEMBER_ACTION_TOAST,
7
- VISITOR_TOAST_DURATION,
8
- } from '../../core/constants';
9
-
10
- type HandleInteractionParams = {
11
- defaultBehavior?: () => void;
12
- allowNonMember?: boolean;
13
- isJoined?: boolean;
14
- };
15
-
16
- export const useInteractionBehavior = () => {
17
- const { showToast } = useToast();
18
- const { AmityGlobalBehaviour } = useBehaviour();
19
- const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
20
-
21
- const handleInteraction = useCallback(
22
- ({
23
- defaultBehavior,
24
- allowNonMember,
25
- isJoined,
26
- }: HandleInteractionParams) => {
27
- handleGlobalBehavior({
28
- defaultBehavior: () => {
29
- if (allowNonMember || isJoined) {
30
- return defaultBehavior?.();
31
- }
32
- if (AmityGlobalBehaviour?.handleNonMemberAction) {
33
- return AmityGlobalBehaviour.handleNonMemberAction();
34
- }
35
- return showToast({
36
- message: NON_MEMBER_ACTION_TOAST,
37
- type: 'informative',
38
- duration: VISITOR_TOAST_DURATION,
39
- });
40
- },
41
- });
42
- },
43
- [handleGlobalBehavior, AmityGlobalBehaviour, showToast]
44
- );
45
-
46
- return { handleInteraction, isVisitorOrBot };
47
- };
@@ -1,5 +0,0 @@
1
- import { UsageLimit } from '../../features/visitor/UsageLimit';
2
-
3
- export function VisitorUsageLimit() {
4
- return <UsageLimit />;
5
- }
@@ -1 +0,0 @@
1
- export { VisitorUsageLimit } from './VisitorUsageLimit';