@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.
- package/lib/commonjs/core/assets/icons/index.js +0 -8
- package/lib/commonjs/core/assets/icons/index.js.map +1 -1
- package/lib/commonjs/core/constants/index.js +1 -11
- package/lib/commonjs/core/constants/index.js.map +1 -1
- package/lib/commonjs/core/hooks/useAuth.js +2 -6
- package/lib/commonjs/core/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/core/hooks/useUpload.js +6 -7
- package/lib/commonjs/core/hooks/useUpload.js.map +1 -1
- package/lib/commonjs/core/legacy/file.js +4 -19
- package/lib/commonjs/core/legacy/file.js.map +1 -1
- package/lib/commonjs/core/providers/AmityUIKitProvider.js.map +1 -1
- package/lib/commonjs/core/providers/AuthProvider.js +16 -40
- package/lib/commonjs/core/providers/AuthProvider.js.map +1 -1
- package/lib/commonjs/core/routes/AmityUIKitNavigator.js +1 -23
- package/lib/commonjs/core/routes/AmityUIKitNavigator.js.map +1 -1
- package/lib/commonjs/core/utils/fileUpload.js +59 -0
- package/lib/commonjs/core/utils/fileUpload.js.map +1 -0
- package/lib/commonjs/social/components/Social/CommentList/CommentList.js +1 -6
- package/lib/commonjs/social/components/Social/CommentList/CommentList.js.map +1 -1
- package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js +3 -14
- package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js +2 -10
- package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
- package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +1 -6
- package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
- package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +3 -13
- package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js +2 -10
- package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
- package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js +1 -5
- package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
- package/lib/commonjs/social/features/post/Detail/index.js +2 -6
- package/lib/commonjs/social/features/post/Detail/index.js.map +1 -1
- package/lib/commonjs/social/features/post/components/Content/Content.js +1 -5
- package/lib/commonjs/social/features/post/components/Content/Content.js.map +1 -1
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js +10 -16
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js +9 -17
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
- package/lib/commonjs/social/features/story/Draft/Draft.js +2 -5
- package/lib/commonjs/social/features/story/Draft/Draft.js.map +1 -1
- package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js +20 -18
- package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
- package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js +1 -6
- package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
- package/lib/commonjs/social/hooks/index.js +0 -22
- package/lib/commonjs/social/hooks/index.js.map +1 -1
- package/lib/commonjs/social/hooks/usePostPermission.js +2 -4
- package/lib/commonjs/social/hooks/usePostPermission.js.map +1 -1
- package/lib/commonjs/social/hooks/useStoryPermission.js +2 -3
- package/lib/commonjs/social/hooks/useStoryPermission.js.map +1 -1
- package/lib/commonjs/social/providers/BehaviourProvider.js +0 -1
- package/lib/commonjs/social/providers/BehaviourProvider.js.map +1 -1
- package/lib/commonjs/social/screens/SocialHomePage/index.js +5 -12
- package/lib/commonjs/social/screens/SocialHomePage/index.js.map +1 -1
- package/lib/module/core/assets/icons/index.js +0 -1
- package/lib/module/core/assets/icons/index.js.map +1 -1
- package/lib/module/core/constants/index.js +0 -10
- package/lib/module/core/constants/index.js.map +1 -1
- package/lib/module/core/hooks/useAuth.js +2 -6
- package/lib/module/core/hooks/useAuth.js.map +1 -1
- package/lib/module/core/hooks/useUpload.js +7 -8
- package/lib/module/core/hooks/useUpload.js.map +1 -1
- package/lib/module/core/legacy/file.js +4 -19
- package/lib/module/core/legacy/file.js.map +1 -1
- package/lib/module/core/providers/AmityUIKitProvider.js.map +1 -1
- package/lib/module/core/providers/AuthProvider.js +16 -40
- package/lib/module/core/providers/AuthProvider.js.map +1 -1
- package/lib/module/core/routes/AmityUIKitNavigator.js +1 -23
- package/lib/module/core/routes/AmityUIKitNavigator.js.map +1 -1
- package/lib/module/core/utils/fileUpload.js +54 -0
- package/lib/module/core/utils/fileUpload.js.map +1 -0
- package/lib/module/social/components/Social/CommentList/CommentList.js +1 -6
- package/lib/module/social/components/Social/CommentList/CommentList.js.map +1 -1
- package/lib/module/social/components/Social/CommentListItem/CommentListItem.js +3 -14
- package/lib/module/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js +2 -10
- package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
- package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +2 -7
- package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
- package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +4 -14
- package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js +2 -10
- package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
- package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js +1 -5
- package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
- package/lib/module/social/features/post/Detail/index.js +2 -6
- package/lib/module/social/features/post/Detail/index.js.map +1 -1
- package/lib/module/social/features/post/components/Content/Content.js +1 -5
- package/lib/module/social/features/post/components/Content/Content.js.map +1 -1
- package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js +11 -17
- package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
- package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js +10 -18
- package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
- package/lib/module/social/features/story/Draft/Draft.js +2 -5
- package/lib/module/social/features/story/Draft/Draft.js.map +1 -1
- package/lib/module/social/features/story/View/components/AmityViewStoryItem.js +21 -19
- package/lib/module/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
- package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js +2 -7
- package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
- package/lib/module/social/hooks/index.js +0 -2
- package/lib/module/social/hooks/index.js.map +1 -1
- package/lib/module/social/hooks/usePostPermission.js +2 -4
- package/lib/module/social/hooks/usePostPermission.js.map +1 -1
- package/lib/module/social/hooks/useStoryPermission.js +2 -3
- package/lib/module/social/hooks/useStoryPermission.js.map +1 -1
- package/lib/module/social/providers/BehaviourProvider.js +0 -1
- package/lib/module/social/providers/BehaviourProvider.js.map +1 -1
- package/lib/module/social/screens/SocialHomePage/index.js +6 -13
- package/lib/module/social/screens/SocialHomePage/index.js.map +1 -1
- package/lib/typescript/core/assets/icons/index.d.ts +0 -1
- package/lib/typescript/core/assets/icons/index.d.ts.map +1 -1
- package/lib/typescript/core/constants/index.d.ts +0 -10
- package/lib/typescript/core/constants/index.d.ts.map +1 -1
- package/lib/typescript/core/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/core/hooks/useUpload.d.ts.map +1 -1
- package/lib/typescript/core/legacy/file.d.ts.map +1 -1
- package/lib/typescript/core/providers/AmityUIKitProvider.d.ts +1 -2
- package/lib/typescript/core/providers/AmityUIKitProvider.d.ts.map +1 -1
- package/lib/typescript/core/providers/AuthProvider.d.ts.map +1 -1
- package/lib/typescript/core/routes/AmityUIKitNavigator.d.ts.map +1 -1
- package/lib/typescript/core/types/auth.d.ts +0 -2
- package/lib/typescript/core/types/auth.d.ts.map +1 -1
- package/lib/typescript/core/types/behaviour.d.ts +0 -6
- package/lib/typescript/core/types/behaviour.d.ts.map +1 -1
- package/lib/typescript/core/utils/fileUpload.d.ts +39 -0
- package/lib/typescript/core/utils/fileUpload.d.ts.map +1 -0
- package/lib/typescript/social/components/Social/CommentList/CommentList.d.ts.map +1 -1
- package/lib/typescript/social/components/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
- package/lib/typescript/social/components/legacy/Social/ReplyCommentList/index.d.ts.map +1 -1
- package/lib/typescript/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.d.ts.map +1 -1
- package/lib/typescript/social/features/comment/components/PostComment/CommentListItem/CommentListItem.d.ts.map +1 -1
- package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/index.d.ts.map +1 -1
- package/lib/typescript/social/features/feed/components/TopNavigation/TopNavigation.d.ts.map +1 -1
- package/lib/typescript/social/features/post/Detail/index.d.ts.map +1 -1
- package/lib/typescript/social/features/post/components/Content/Content.d.ts.map +1 -1
- package/lib/typescript/social/features/post/components/EngagementActions/Components/DetailStyle.d.ts.map +1 -1
- package/lib/typescript/social/features/post/components/EngagementActions/Components/FeedStyle.d.ts.map +1 -1
- package/lib/typescript/social/features/story/Draft/Draft.d.ts.map +1 -1
- package/lib/typescript/social/features/story/View/components/AmityViewStoryItem.d.ts.map +1 -1
- package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts.map +1 -1
- package/lib/typescript/social/hooks/index.d.ts +0 -2
- package/lib/typescript/social/hooks/index.d.ts.map +1 -1
- package/lib/typescript/social/hooks/usePostPermission.d.ts.map +1 -1
- package/lib/typescript/social/hooks/useStoryPermission.d.ts.map +1 -1
- package/lib/typescript/social/providers/BehaviourProvider.d.ts.map +1 -1
- package/lib/typescript/social/screens/SocialHomePage/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/core/assets/icons/index.ts +0 -1
- package/src/core/constants/index.ts +0 -15
- package/src/core/hooks/useAuth.ts +0 -4
- package/src/core/hooks/useUpload.ts +6 -8
- package/src/core/legacy/file.tsx +16 -22
- package/src/core/providers/AmityUIKitProvider.tsx +1 -2
- package/src/core/providers/AuthProvider.tsx +11 -35
- package/src/core/routes/AmityUIKitNavigator.tsx +1 -26
- package/src/core/types/auth.ts +0 -2
- package/src/core/types/behaviour.ts +0 -6
- package/src/core/utils/fileUpload.ts +60 -0
- package/src/social/components/Social/CommentList/CommentList.tsx +1 -4
- package/src/social/components/Social/CommentListItem/CommentListItem.tsx +12 -20
- package/src/social/components/legacy/Social/ReplyCommentList/index.tsx +11 -18
- package/src/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +2 -10
- package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx +16 -23
- package/src/social/features/comment/components/PostComment/ReplyCommentList/index.tsx +11 -17
- package/src/social/features/feed/components/TopNavigation/TopNavigation.tsx +1 -3
- package/src/social/features/post/Detail/index.tsx +2 -5
- package/src/social/features/post/components/Content/Content.tsx +4 -7
- package/src/social/features/post/components/EngagementActions/Components/DetailStyle.tsx +14 -19
- package/src/social/features/post/components/EngagementActions/Components/FeedStyle.tsx +12 -20
- package/src/social/features/story/Draft/Draft.tsx +9 -5
- package/src/social/features/story/View/components/AmityViewStoryItem.tsx +22 -20
- package/src/social/features/user/Profile/components/Header/hooks/useHeader.ts +2 -5
- package/src/social/hooks/index.ts +0 -2
- package/src/social/hooks/usePostPermission.ts +1 -3
- package/src/social/hooks/useStoryPermission.ts +6 -8
- package/src/social/providers/BehaviourProvider.tsx +0 -1
- package/src/social/screens/SocialHomePage/index.tsx +11 -24
- package/lib/commonjs/core/assets/icons/visitorLimit.js +0 -26
- package/lib/commonjs/core/assets/icons/visitorLimit.js.map +0 -1
- package/lib/commonjs/social/features/visitor/UsageLimit/UsageLimit.js +0 -46
- package/lib/commonjs/social/features/visitor/UsageLimit/UsageLimit.js.map +0 -1
- package/lib/commonjs/social/features/visitor/UsageLimit/hooks/index.js +0 -13
- package/lib/commonjs/social/features/visitor/UsageLimit/hooks/index.js.map +0 -1
- package/lib/commonjs/social/features/visitor/UsageLimit/hooks/useUsageLimit.js +0 -54
- package/lib/commonjs/social/features/visitor/UsageLimit/hooks/useUsageLimit.js.map +0 -1
- package/lib/commonjs/social/features/visitor/UsageLimit/index.js +0 -13
- package/lib/commonjs/social/features/visitor/UsageLimit/index.js.map +0 -1
- package/lib/commonjs/social/features/visitor/UsageLimit/styles.js +0 -52
- package/lib/commonjs/social/features/visitor/UsageLimit/styles.js.map +0 -1
- package/lib/commonjs/social/hooks/useGlobalBehavior.js +0 -44
- package/lib/commonjs/social/hooks/useGlobalBehavior.js.map +0 -1
- package/lib/commonjs/social/hooks/useInteractionBehavior.js +0 -50
- package/lib/commonjs/social/hooks/useInteractionBehavior.js.map +0 -1
- package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +0 -11
- package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +0 -1
- package/lib/commonjs/social/screens/VisitorUsageLimit/index.js +0 -13
- package/lib/commonjs/social/screens/VisitorUsageLimit/index.js.map +0 -1
- package/lib/module/core/assets/icons/visitorLimit.js +0 -19
- package/lib/module/core/assets/icons/visitorLimit.js.map +0 -1
- package/lib/module/social/features/visitor/UsageLimit/UsageLimit.js +0 -40
- package/lib/module/social/features/visitor/UsageLimit/UsageLimit.js.map +0 -1
- package/lib/module/social/features/visitor/UsageLimit/hooks/index.js +0 -2
- package/lib/module/social/features/visitor/UsageLimit/hooks/index.js.map +0 -1
- package/lib/module/social/features/visitor/UsageLimit/hooks/useUsageLimit.js +0 -47
- package/lib/module/social/features/visitor/UsageLimit/hooks/useUsageLimit.js.map +0 -1
- package/lib/module/social/features/visitor/UsageLimit/index.js +0 -2
- package/lib/module/social/features/visitor/UsageLimit/index.js.map +0 -1
- package/lib/module/social/features/visitor/UsageLimit/styles.js +0 -45
- package/lib/module/social/features/visitor/UsageLimit/styles.js.map +0 -1
- package/lib/module/social/hooks/useGlobalBehavior.js +0 -36
- package/lib/module/social/hooks/useGlobalBehavior.js.map +0 -1
- package/lib/module/social/hooks/useInteractionBehavior.js +0 -43
- package/lib/module/social/hooks/useInteractionBehavior.js.map +0 -1
- package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +0 -5
- package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +0 -1
- package/lib/module/social/screens/VisitorUsageLimit/index.js +0 -2
- package/lib/module/social/screens/VisitorUsageLimit/index.js.map +0 -1
- package/lib/typescript/core/assets/icons/visitorLimit.d.ts +0 -3
- package/lib/typescript/core/assets/icons/visitorLimit.d.ts.map +0 -1
- package/lib/typescript/social/features/visitor/UsageLimit/UsageLimit.d.ts +0 -2
- package/lib/typescript/social/features/visitor/UsageLimit/UsageLimit.d.ts.map +0 -1
- package/lib/typescript/social/features/visitor/UsageLimit/hooks/index.d.ts +0 -2
- package/lib/typescript/social/features/visitor/UsageLimit/hooks/index.d.ts.map +0 -1
- package/lib/typescript/social/features/visitor/UsageLimit/hooks/useUsageLimit.d.ts +0 -40
- package/lib/typescript/social/features/visitor/UsageLimit/hooks/useUsageLimit.d.ts.map +0 -1
- package/lib/typescript/social/features/visitor/UsageLimit/index.d.ts +0 -2
- package/lib/typescript/social/features/visitor/UsageLimit/index.d.ts.map +0 -1
- package/lib/typescript/social/features/visitor/UsageLimit/styles.d.ts +0 -40
- package/lib/typescript/social/features/visitor/UsageLimit/styles.d.ts.map +0 -1
- package/lib/typescript/social/hooks/useGlobalBehavior.d.ts +0 -16
- package/lib/typescript/social/hooks/useGlobalBehavior.d.ts.map +0 -1
- package/lib/typescript/social/hooks/useInteractionBehavior.d.ts +0 -11
- package/lib/typescript/social/hooks/useInteractionBehavior.d.ts.map +0 -1
- package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts +0 -2
- package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts.map +0 -1
- package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts +0 -2
- package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts.map +0 -1
- package/src/core/assets/icons/visitorLimit.tsx +0 -19
- package/src/social/features/visitor/UsageLimit/UsageLimit.tsx +0 -43
- package/src/social/features/visitor/UsageLimit/hooks/index.ts +0 -1
- package/src/social/features/visitor/UsageLimit/hooks/useUsageLimit.ts +0 -46
- package/src/social/features/visitor/UsageLimit/index.ts +0 -1
- package/src/social/features/visitor/UsageLimit/styles.ts +0 -45
- package/src/social/hooks/useGlobalBehavior.ts +0 -33
- package/src/social/hooks/useInteractionBehavior.ts +0 -47
- package/src/social/screens/VisitorUsageLimit/VisitorUsageLimit.tsx +0 -5
- 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 +0,0 @@
|
|
|
1
|
-
export { VisitorUsageLimit } from './VisitorUsageLimit';
|