@amityco/react-native-social-uikit 4.0.0 → 4.0.1-183811fd.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/core/assets/icons/index.js +8 -0
- package/lib/commonjs/core/assets/icons/index.js.map +1 -1
- package/lib/commonjs/core/assets/icons/visitorLimit.js +26 -0
- package/lib/commonjs/core/assets/icons/visitorLimit.js.map +1 -0
- package/lib/commonjs/core/constants/index.js +11 -1
- package/lib/commonjs/core/constants/index.js.map +1 -1
- package/lib/commonjs/core/hooks/useAuth.js +6 -2
- package/lib/commonjs/core/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/core/providers/AmityUIKitProvider.js.map +1 -1
- package/lib/commonjs/core/providers/AuthProvider.js +40 -16
- package/lib/commonjs/core/providers/AuthProvider.js.map +1 -1
- package/lib/commonjs/core/routes/AmityUIKitNavigator.js +23 -1
- package/lib/commonjs/core/routes/AmityUIKitNavigator.js.map +1 -1
- package/lib/commonjs/social/components/Social/CommentList/CommentList.js +6 -1
- package/lib/commonjs/social/components/Social/CommentList/CommentList.js.map +1 -1
- package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js +14 -3
- package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js +10 -2
- package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
- package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +6 -1
- package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
- package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +13 -3
- 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 +10 -2
- package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
- package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js +5 -1
- package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
- package/lib/commonjs/social/features/post/Detail/index.js +6 -2
- package/lib/commonjs/social/features/post/Detail/index.js.map +1 -1
- package/lib/commonjs/social/features/post/components/Content/Content.js +5 -1
- package/lib/commonjs/social/features/post/components/Content/Content.js.map +1 -1
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js +16 -10
- 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 +17 -9
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
- package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js +6 -1
- package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
- package/lib/commonjs/social/features/visitor/UsageLimit/UsageLimit.js +46 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/UsageLimit.js.map +1 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/hooks/index.js +13 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/hooks/index.js.map +1 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/hooks/useUsageLimit.js +54 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/hooks/useUsageLimit.js.map +1 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/index.js +13 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/index.js.map +1 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/styles.js +52 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/styles.js.map +1 -0
- package/lib/commonjs/social/hooks/index.js +22 -0
- package/lib/commonjs/social/hooks/index.js.map +1 -1
- package/lib/commonjs/social/hooks/useCommunityEngagementBehavior.js +57 -0
- package/lib/commonjs/social/hooks/useCommunityEngagementBehavior.js.map +1 -0
- package/lib/commonjs/social/hooks/useGlobalBehavior.js +44 -0
- package/lib/commonjs/social/hooks/useGlobalBehavior.js.map +1 -0
- package/lib/commonjs/social/hooks/usePostPermission.js +4 -2
- package/lib/commonjs/social/hooks/usePostPermission.js.map +1 -1
- package/lib/commonjs/social/hooks/useStoryPermission.js +3 -2
- package/lib/commonjs/social/hooks/useStoryPermission.js.map +1 -1
- package/lib/commonjs/social/providers/BehaviourProvider.js +1 -0
- package/lib/commonjs/social/providers/BehaviourProvider.js.map +1 -1
- package/lib/commonjs/social/screens/SocialHomePage/index.js +12 -5
- package/lib/commonjs/social/screens/SocialHomePage/index.js.map +1 -1
- package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +11 -0
- package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +1 -0
- package/lib/commonjs/social/screens/VisitorUsageLimit/index.js +13 -0
- package/lib/commonjs/social/screens/VisitorUsageLimit/index.js.map +1 -0
- package/lib/module/core/assets/icons/index.js +1 -0
- package/lib/module/core/assets/icons/index.js.map +1 -1
- package/lib/module/core/assets/icons/visitorLimit.js +19 -0
- package/lib/module/core/assets/icons/visitorLimit.js.map +1 -0
- package/lib/module/core/constants/index.js +10 -0
- package/lib/module/core/constants/index.js.map +1 -1
- package/lib/module/core/hooks/useAuth.js +6 -2
- package/lib/module/core/hooks/useAuth.js.map +1 -1
- package/lib/module/core/providers/AmityUIKitProvider.js.map +1 -1
- package/lib/module/core/providers/AuthProvider.js +40 -16
- package/lib/module/core/providers/AuthProvider.js.map +1 -1
- package/lib/module/core/routes/AmityUIKitNavigator.js +23 -1
- package/lib/module/core/routes/AmityUIKitNavigator.js.map +1 -1
- package/lib/module/social/components/Social/CommentList/CommentList.js +6 -1
- package/lib/module/social/components/Social/CommentList/CommentList.js.map +1 -1
- package/lib/module/social/components/Social/CommentListItem/CommentListItem.js +14 -3
- package/lib/module/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js +10 -2
- package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
- package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +7 -2
- package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
- package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +14 -4
- 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 +10 -2
- package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
- package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js +5 -1
- package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
- package/lib/module/social/features/post/Detail/index.js +6 -2
- package/lib/module/social/features/post/Detail/index.js.map +1 -1
- package/lib/module/social/features/post/components/Content/Content.js +5 -1
- package/lib/module/social/features/post/components/Content/Content.js.map +1 -1
- package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js +17 -11
- 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 +18 -10
- package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
- package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js +7 -2
- package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
- package/lib/module/social/features/visitor/UsageLimit/UsageLimit.js +40 -0
- package/lib/module/social/features/visitor/UsageLimit/UsageLimit.js.map +1 -0
- package/lib/module/social/features/visitor/UsageLimit/hooks/index.js +2 -0
- package/lib/module/social/features/visitor/UsageLimit/hooks/index.js.map +1 -0
- package/lib/module/social/features/visitor/UsageLimit/hooks/useUsageLimit.js +47 -0
- package/lib/module/social/features/visitor/UsageLimit/hooks/useUsageLimit.js.map +1 -0
- package/lib/module/social/features/visitor/UsageLimit/index.js +2 -0
- package/lib/module/social/features/visitor/UsageLimit/index.js.map +1 -0
- package/lib/module/social/features/visitor/UsageLimit/styles.js +45 -0
- package/lib/module/social/features/visitor/UsageLimit/styles.js.map +1 -0
- package/lib/module/social/hooks/index.js +2 -0
- package/lib/module/social/hooks/index.js.map +1 -1
- package/lib/module/social/hooks/useCommunityEngagementBehavior.js +50 -0
- package/lib/module/social/hooks/useCommunityEngagementBehavior.js.map +1 -0
- package/lib/module/social/hooks/useGlobalBehavior.js +36 -0
- package/lib/module/social/hooks/useGlobalBehavior.js.map +1 -0
- package/lib/module/social/hooks/usePostPermission.js +4 -2
- package/lib/module/social/hooks/usePostPermission.js.map +1 -1
- package/lib/module/social/hooks/useStoryPermission.js +3 -2
- package/lib/module/social/hooks/useStoryPermission.js.map +1 -1
- package/lib/module/social/providers/BehaviourProvider.js +1 -0
- package/lib/module/social/providers/BehaviourProvider.js.map +1 -1
- package/lib/module/social/screens/SocialHomePage/index.js +13 -6
- package/lib/module/social/screens/SocialHomePage/index.js.map +1 -1
- package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +5 -0
- package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +1 -0
- package/lib/module/social/screens/VisitorUsageLimit/index.js +2 -0
- package/lib/module/social/screens/VisitorUsageLimit/index.js.map +1 -0
- package/lib/typescript/core/assets/icons/index.d.ts +1 -0
- package/lib/typescript/core/assets/icons/index.d.ts.map +1 -1
- package/lib/typescript/core/assets/icons/visitorLimit.d.ts +3 -0
- package/lib/typescript/core/assets/icons/visitorLimit.d.ts.map +1 -0
- package/lib/typescript/core/constants/index.d.ts +10 -0
- 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/providers/AmityUIKitProvider.d.ts +2 -1
- 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 +2 -0
- package/lib/typescript/core/types/auth.d.ts.map +1 -1
- package/lib/typescript/core/types/behaviour.d.ts +6 -0
- package/lib/typescript/core/types/behaviour.d.ts.map +1 -1
- 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/user/Profile/components/Header/hooks/useHeader.d.ts.map +1 -1
- package/lib/typescript/social/features/visitor/UsageLimit/UsageLimit.d.ts +2 -0
- package/lib/typescript/social/features/visitor/UsageLimit/UsageLimit.d.ts.map +1 -0
- package/lib/typescript/social/features/visitor/UsageLimit/hooks/index.d.ts +2 -0
- package/lib/typescript/social/features/visitor/UsageLimit/hooks/index.d.ts.map +1 -0
- package/lib/typescript/social/features/visitor/UsageLimit/hooks/useUsageLimit.d.ts +40 -0
- package/lib/typescript/social/features/visitor/UsageLimit/hooks/useUsageLimit.d.ts.map +1 -0
- package/lib/typescript/social/features/visitor/UsageLimit/index.d.ts +2 -0
- package/lib/typescript/social/features/visitor/UsageLimit/index.d.ts.map +1 -0
- package/lib/typescript/social/features/visitor/UsageLimit/styles.d.ts +40 -0
- package/lib/typescript/social/features/visitor/UsageLimit/styles.d.ts.map +1 -0
- package/lib/typescript/social/hooks/index.d.ts +2 -0
- package/lib/typescript/social/hooks/index.d.ts.map +1 -1
- package/lib/typescript/social/hooks/useCommunityEngagementBehavior.d.ts +18 -0
- package/lib/typescript/social/hooks/useCommunityEngagementBehavior.d.ts.map +1 -0
- package/lib/typescript/social/hooks/useGlobalBehavior.d.ts +16 -0
- package/lib/typescript/social/hooks/useGlobalBehavior.d.ts.map +1 -0
- 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/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts +2 -0
- package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts.map +1 -0
- package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts +2 -0
- package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/core/assets/icons/index.ts +1 -0
- package/src/core/assets/icons/visitorLimit.tsx +19 -0
- package/src/core/constants/index.ts +15 -0
- package/src/core/hooks/useAuth.ts +4 -0
- package/src/core/providers/AmityUIKitProvider.tsx +2 -1
- package/src/core/providers/AuthProvider.tsx +35 -11
- package/src/core/routes/AmityUIKitNavigator.tsx +26 -1
- package/src/core/types/auth.ts +2 -0
- package/src/core/types/behaviour.ts +6 -0
- package/src/social/components/Social/CommentList/CommentList.tsx +4 -1
- package/src/social/components/Social/CommentListItem/CommentListItem.tsx +20 -12
- package/src/social/components/legacy/Social/ReplyCommentList/index.tsx +18 -11
- package/src/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +10 -2
- package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx +23 -16
- package/src/social/features/comment/components/PostComment/ReplyCommentList/index.tsx +17 -11
- package/src/social/features/feed/components/TopNavigation/TopNavigation.tsx +3 -1
- package/src/social/features/post/Detail/index.tsx +5 -2
- package/src/social/features/post/components/Content/Content.tsx +7 -4
- package/src/social/features/post/components/EngagementActions/Components/DetailStyle.tsx +19 -14
- package/src/social/features/post/components/EngagementActions/Components/FeedStyle.tsx +20 -12
- package/src/social/features/user/Profile/components/Header/hooks/useHeader.ts +5 -2
- package/src/social/features/visitor/UsageLimit/UsageLimit.tsx +43 -0
- package/src/social/features/visitor/UsageLimit/hooks/index.ts +1 -0
- package/src/social/features/visitor/UsageLimit/hooks/useUsageLimit.ts +46 -0
- package/src/social/features/visitor/UsageLimit/index.ts +1 -0
- package/src/social/features/visitor/UsageLimit/styles.ts +45 -0
- package/src/social/hooks/index.ts +2 -0
- package/src/social/hooks/useCommunityEngagementBehavior.ts +57 -0
- package/src/social/hooks/useGlobalBehavior.ts +33 -0
- package/src/social/hooks/usePostPermission.ts +3 -1
- package/src/social/hooks/useStoryPermission.ts +8 -6
- package/src/social/providers/BehaviourProvider.tsx +1 -0
- package/src/social/screens/SocialHomePage/index.tsx +24 -11
- package/src/social/screens/VisitorUsageLimit/VisitorUsageLimit.tsx +5 -0
- package/src/social/screens/VisitorUsageLimit/index.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UsageLimit.d.ts","sourceRoot":"","sources":["../../../../../../src/social/features/visitor/UsageLimit/UsageLimit.tsx"],"names":[],"mappings":"AAQA,wBAAgB,UAAU,4CAkCzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/social/features/visitor/UsageLimit/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const useUsageLimit: () => {
|
|
2
|
+
styles: {
|
|
3
|
+
container: {
|
|
4
|
+
flex: number;
|
|
5
|
+
backgroundColor: string;
|
|
6
|
+
};
|
|
7
|
+
contentContainer: {
|
|
8
|
+
flex: number;
|
|
9
|
+
alignItems: "center";
|
|
10
|
+
paddingHorizontal: number;
|
|
11
|
+
flexDirection: "column";
|
|
12
|
+
justifyContent: "center";
|
|
13
|
+
};
|
|
14
|
+
icon: {
|
|
15
|
+
marginBottom: number;
|
|
16
|
+
};
|
|
17
|
+
title: {
|
|
18
|
+
maxWidth: number;
|
|
19
|
+
textAlign: "center";
|
|
20
|
+
color: string;
|
|
21
|
+
};
|
|
22
|
+
subtitle: {
|
|
23
|
+
maxWidth: number;
|
|
24
|
+
textAlign: "center";
|
|
25
|
+
color: string;
|
|
26
|
+
};
|
|
27
|
+
signInButton: {
|
|
28
|
+
marginTop: number;
|
|
29
|
+
borderRadius: number;
|
|
30
|
+
paddingVertical: number;
|
|
31
|
+
paddingHorizontal: number;
|
|
32
|
+
};
|
|
33
|
+
signInText: {
|
|
34
|
+
color: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
theme: import("../../../../../core/providers/AmityUIKitProvider").MyMD3Theme;
|
|
38
|
+
onPressSignIn: () => void;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=useUsageLimit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUsageLimit.d.ts","sourceRoot":"","sources":["../../../../../../../src/social/features/visitor/UsageLimit/hooks/useUsageLimit.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/social/features/visitor/UsageLimit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { MyMD3Theme } from '../../../../core/providers/AmityUIKitProvider';
|
|
2
|
+
export declare const useStyles: () => {
|
|
3
|
+
styles: {
|
|
4
|
+
container: {
|
|
5
|
+
flex: number;
|
|
6
|
+
backgroundColor: string;
|
|
7
|
+
};
|
|
8
|
+
contentContainer: {
|
|
9
|
+
flex: number;
|
|
10
|
+
alignItems: "center";
|
|
11
|
+
paddingHorizontal: number;
|
|
12
|
+
flexDirection: "column";
|
|
13
|
+
justifyContent: "center";
|
|
14
|
+
};
|
|
15
|
+
icon: {
|
|
16
|
+
marginBottom: number;
|
|
17
|
+
};
|
|
18
|
+
title: {
|
|
19
|
+
maxWidth: number;
|
|
20
|
+
textAlign: "center";
|
|
21
|
+
color: string;
|
|
22
|
+
};
|
|
23
|
+
subtitle: {
|
|
24
|
+
maxWidth: number;
|
|
25
|
+
textAlign: "center";
|
|
26
|
+
color: string;
|
|
27
|
+
};
|
|
28
|
+
signInButton: {
|
|
29
|
+
marginTop: number;
|
|
30
|
+
borderRadius: number;
|
|
31
|
+
paddingVertical: number;
|
|
32
|
+
paddingHorizontal: number;
|
|
33
|
+
};
|
|
34
|
+
signInText: {
|
|
35
|
+
color: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
theme: MyMD3Theme;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/social/features/visitor/UsageLimit/styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAEhF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCrB,CAAC"}
|
|
@@ -35,4 +35,6 @@ 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 './useCommunityEngagementBehavior';
|
|
38
40
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/social/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uDAAuD,CAAC;AACtE,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/social/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uDAAuD,CAAC;AACtE,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type HandleCommunityEngagementParams = {
|
|
2
|
+
defaultBehavior?: () => void;
|
|
3
|
+
allowNonMember?: boolean;
|
|
4
|
+
isJoined?: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Engagement gate for community posts, mirroring the Web UIKit's
|
|
8
|
+
* useCommunityProfileGlobalBehavior. Layers two checks on top of an action:
|
|
9
|
+
* - visitor/bot -> visitor toast / handleVisitorUserAction (via useGlobalBehavior)
|
|
10
|
+
* - signed-in non-member (community && !isJoined) -> join toast / handleNonMemberAction
|
|
11
|
+
* - member / allowNonMember / non-community post -> run the action
|
|
12
|
+
*/
|
|
13
|
+
export declare const useCommunityEngagementBehavior: () => {
|
|
14
|
+
handleCommunityEngagement: ({ defaultBehavior, allowNonMember, isJoined, }: HandleCommunityEngagementParams) => void;
|
|
15
|
+
isVisitorOrBot: boolean;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=useCommunityEngagementBehavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCommunityEngagementBehavior.d.ts","sourceRoot":"","sources":["../../../../src/social/hooks/useCommunityEngagementBehavior.ts"],"names":[],"mappings":"AASA,KAAK,+BAA+B,GAAG;IACrC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAI7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;gFAUpC,+BAA+B;;CAqBrC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const useGlobalBehavior: () => {
|
|
2
|
+
handleGlobalBehavior: ({ defaultBehavior }: {
|
|
3
|
+
defaultBehavior?: () => void;
|
|
4
|
+
}) => void | {
|
|
5
|
+
payload: {
|
|
6
|
+
visible?: boolean;
|
|
7
|
+
message: string;
|
|
8
|
+
type: "failed" | "success" | "informative" | "loading";
|
|
9
|
+
duration?: number;
|
|
10
|
+
bottomPosition?: number;
|
|
11
|
+
};
|
|
12
|
+
type: "toast/showToast";
|
|
13
|
+
};
|
|
14
|
+
isVisitorOrBot: boolean;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useGlobalBehavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGlobalBehavior.d.ts","sourceRoot":"","sources":["../../../../src/social/hooks/useGlobalBehavior.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,iBAAiB;gDAMJ;QAAE,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE;;;;;;;;;;;CAiBzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePostPermission.d.ts","sourceRoot":"","sources":["../../../../src/social/hooks/usePostPermission.ts"],"names":[],"mappings":"AASA,KAAK,uBAAuB,GAAG;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"usePostPermission.d.ts","sourceRoot":"","sources":["../../../../src/social/hooks/usePostPermission.ts"],"names":[],"mappings":"AASA,KAAK,uBAAuB,GAAG;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,EAAE,uBAAuB,WAmCvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStoryPermission.d.ts","sourceRoot":"","sources":["../../../../src/social/hooks/useStoryPermission.ts"],"names":[],"mappings":"AAKA,wBAAgB,kBAAkB,CAAC,WAAW,CAAC,EAAE,MAAM;;
|
|
1
|
+
{"version":3,"file":"useStoryPermission.d.ts","sourceRoot":"","sources":["../../../../src/social/hooks/useStoryPermission.ts"],"names":[],"mappings":"AAKA,wBAAgB,kBAAkB,CAAC,WAAW,CAAC,EAAE,MAAM;;EAgBtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BehaviourProvider.d.ts","sourceRoot":"","sources":["../../../../src/social/providers/BehaviourProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsC,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAIxD,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,EAAE,UAAU,CAAC;CACvB;AAED,eAAO,MAAM,iBAAiB,GAAI,0BAG/B,uBAAuB,
|
|
1
|
+
{"version":3,"file":"BehaviourProvider.d.ts","sourceRoot":"","sources":["../../../../src/social/providers/BehaviourProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsC,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAIxD,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,EAAE,UAAU,CAAC;CACvB;AAED,eAAO,MAAM,iBAAiB,GAAI,0BAG/B,uBAAuB,4CA6CzB,CAAC;AAEF,eAAO,MAAM,YAAY,kBAMxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/social/screens/SocialHomePage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/social/screens/SocialHomePage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;;AAkI/B,wBAA+C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisitorUsageLimit.d.ts","sourceRoot":"","sources":["../../../../../src/social/screens/VisitorUsageLimit/VisitorUsageLimit.tsx"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,4CAEhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/social/screens/VisitorUsageLimit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amityco/react-native-social-uikit",
|
|
3
|
-
"version": "4.0.0",
|
|
3
|
+
"version": "4.0.1-183811fd.0",
|
|
4
4
|
"description": "Social UIKit",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"registry": "https://registry.npmjs.org/"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@amityco/ts-sdk-react-native": "7.
|
|
60
|
+
"@amityco/ts-sdk-react-native": "7.22.1-f15e84ea.0",
|
|
61
61
|
"@babel/plugin-transform-export-namespace-from": "^7.27.1",
|
|
62
62
|
"@commitlint/config-conventional": "^17.0.2",
|
|
63
63
|
"@evilmartians/lefthook": "^1.2.2",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"@types/react": "^19.1.0"
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
122
|
-
"@amityco/ts-sdk-react-native": "7.
|
|
122
|
+
"@amityco/ts-sdk-react-native": "7.22.1-f15e84ea.0",
|
|
123
123
|
"@livekit/react-native": "^2.9.6",
|
|
124
124
|
"@livekit/react-native-webrtc": "^137.0.2",
|
|
125
125
|
"@react-native-async-storage/async-storage": "^1.19.3",
|
|
@@ -34,6 +34,7 @@ export { default as pause } from './pause';
|
|
|
34
34
|
export { default as resume } from './resume';
|
|
35
35
|
export { default as terminated } from './terminated';
|
|
36
36
|
export { default as warning } from './warning';
|
|
37
|
+
export { default as visitorLimit } from './visitorLimit';
|
|
37
38
|
export { default as ban } from './ban';
|
|
38
39
|
export { default as arrowLeft } from './arrowLeft';
|
|
39
40
|
export { default as poll } from './poll';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const icon = () => `<svg
|
|
2
|
+
width="100%"
|
|
3
|
+
height="100%"
|
|
4
|
+
viewBox="0 0 60 40"
|
|
5
|
+
fill="none"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
8
|
+
<path
|
|
9
|
+
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"
|
|
10
|
+
fill="currentColor"
|
|
11
|
+
/>
|
|
12
|
+
<path
|
|
13
|
+
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"
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export default icon;
|
|
@@ -88,11 +88,26 @@ export const ERROR_CODE = {
|
|
|
88
88
|
ONLY_ONE_MODERATOR: '400317',
|
|
89
89
|
ONLY_ONE_MEMBER: '400318',
|
|
90
90
|
GLOBAL_BAN: '400312',
|
|
91
|
+
VISITOR_USAGE_LIMIT_EXCEEDED: '400323',
|
|
91
92
|
INVALID_IMAGE:
|
|
92
93
|
'Amity SDK (500000): Image uploading failed: Request has invalid image format',
|
|
93
94
|
DISPLAY_NAME_UPDATE: '400301',
|
|
94
95
|
};
|
|
95
96
|
|
|
97
|
+
export const VISITOR_USAGE_LIMIT_MESSAGE = {
|
|
98
|
+
TITLE: "You've reached your daily limit.",
|
|
99
|
+
SUBTITLE: 'Create an account or sign in to keep exploring the community.',
|
|
100
|
+
SIGN_IN: 'Sign in',
|
|
101
|
+
TOAST: 'Create an account or sign in to continue.',
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const VISITOR_USER_ACTION_TOAST =
|
|
105
|
+
'Create an account or sign in to continue.';
|
|
106
|
+
|
|
107
|
+
export const NON_MEMBER_ACTION_TOAST = 'Join community to interact.';
|
|
108
|
+
|
|
109
|
+
export const VISITOR_TOAST_DURATION = 3000;
|
|
110
|
+
|
|
96
111
|
export const COMMENT_ERROR_MESSAGE = {
|
|
97
112
|
BLOCKED_WORD:
|
|
98
113
|
'Your comment contains inappropriate word. Please review and delete it.',
|
|
@@ -14,6 +14,8 @@ const useAuth = (): AuthContextInterface => {
|
|
|
14
14
|
sessionState,
|
|
15
15
|
apiRegion,
|
|
16
16
|
isGlobalBan,
|
|
17
|
+
isVisitorUsageLimitReached,
|
|
18
|
+
isVisitorOrBot,
|
|
17
19
|
} = useContext(AuthContext);
|
|
18
20
|
|
|
19
21
|
return {
|
|
@@ -26,6 +28,8 @@ const useAuth = (): AuthContextInterface => {
|
|
|
26
28
|
sessionState,
|
|
27
29
|
apiRegion,
|
|
28
30
|
isGlobalBan,
|
|
31
|
+
isVisitorUsageLimitReached,
|
|
32
|
+
isVisitorOrBot,
|
|
29
33
|
};
|
|
30
34
|
};
|
|
31
35
|
|
|
@@ -21,7 +21,8 @@ import { ErrorBoundary } from '../components/ErrorBoundary';
|
|
|
21
21
|
|
|
22
22
|
export type CusTomTheme = typeof DefaultTheme;
|
|
23
23
|
export interface IAmityUIkitProvider {
|
|
24
|
-
|
|
24
|
+
/** Omit to connect as a visitor (read-only session). */
|
|
25
|
+
userId?: string;
|
|
25
26
|
displayName?: string;
|
|
26
27
|
apiKey: string;
|
|
27
28
|
apiRegion?: string;
|
|
@@ -24,6 +24,8 @@ export const AuthContext = createContext<AuthContextInterface>({
|
|
|
24
24
|
authToken: '',
|
|
25
25
|
fcmToken: undefined,
|
|
26
26
|
isGlobalBan: false,
|
|
27
|
+
isVisitorUsageLimitReached: false,
|
|
28
|
+
isVisitorOrBot: false,
|
|
27
29
|
});
|
|
28
30
|
|
|
29
31
|
export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
|
|
@@ -44,6 +46,9 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
|
|
|
44
46
|
apiEndpoint: { http: apiEndpoint },
|
|
45
47
|
});
|
|
46
48
|
const [isGlobalBan, setIsGlobalBan] = useState(false);
|
|
49
|
+
const [isVisitorUsageLimitReached, setIsVisitorUsageLimitReached] =
|
|
50
|
+
useState(false);
|
|
51
|
+
const [isVisitorOrBot, setIsVisitorOrBot] = useState(false);
|
|
47
52
|
|
|
48
53
|
const sessionHandler: Amity.SessionHandler = {
|
|
49
54
|
sessionWillRenewAccessToken(renewal) {
|
|
@@ -64,29 +69,44 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
|
|
|
64
69
|
if (sessionState === 'established') {
|
|
65
70
|
setIsConnected(true);
|
|
66
71
|
onSdkReady();
|
|
72
|
+
setIsVisitorOrBot(Client.getCurrentUserType() !== 'signed-in');
|
|
67
73
|
}
|
|
68
74
|
}, [sessionState]);
|
|
69
75
|
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
const unsubscribe = Client.onVisitorUsageLimitReached(() => {
|
|
78
|
+
setIsVisitorUsageLimitReached(true);
|
|
79
|
+
});
|
|
72
80
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
displayName: displayName,
|
|
81
|
+
return () => {
|
|
82
|
+
unsubscribe();
|
|
76
83
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
}, []);
|
|
85
|
+
|
|
86
|
+
const handleConnect = useCallback(async () => {
|
|
80
87
|
try {
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
if (userId) {
|
|
89
|
+
let loginParam: Amity.ConnectClientParams = {
|
|
90
|
+
userId: userId,
|
|
91
|
+
displayName: displayName,
|
|
92
|
+
};
|
|
93
|
+
if (authToken?.length > 0) {
|
|
94
|
+
loginParam = { ...loginParam, authToken: authToken };
|
|
95
|
+
}
|
|
96
|
+
const response = await Client.login(loginParam, sessionHandler);
|
|
97
|
+
if (!response) return;
|
|
98
|
+
} else {
|
|
99
|
+
const response = await Client.loginAsVisitor({ sessionHandler });
|
|
100
|
+
if (!response) return;
|
|
101
|
+
}
|
|
83
102
|
} catch (err) {
|
|
84
103
|
if (err?.message?.includes(ERROR_CODE.GLOBAL_BAN)) {
|
|
85
104
|
setIsGlobalBan(true);
|
|
86
105
|
}
|
|
87
106
|
}
|
|
88
107
|
|
|
89
|
-
|
|
108
|
+
// Visitors/bots are GET-only with no MQTT — skip push registration for them.
|
|
109
|
+
if (fcmToken && userId) {
|
|
90
110
|
try {
|
|
91
111
|
await Client.registerPushNotification(fcmToken);
|
|
92
112
|
} catch (err) {
|
|
@@ -110,7 +130,9 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
|
|
|
110
130
|
setLoading(false);
|
|
111
131
|
}
|
|
112
132
|
};
|
|
133
|
+
|
|
113
134
|
useEffect(() => {
|
|
135
|
+
setIsVisitorUsageLimitReached(false);
|
|
114
136
|
login();
|
|
115
137
|
}, [userId]);
|
|
116
138
|
|
|
@@ -138,6 +160,8 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
|
|
|
138
160
|
sessionState,
|
|
139
161
|
apiRegion: apiRegion.toLowerCase(),
|
|
140
162
|
isGlobalBan,
|
|
163
|
+
isVisitorUsageLimitReached,
|
|
164
|
+
isVisitorOrBot,
|
|
141
165
|
}}
|
|
142
166
|
>
|
|
143
167
|
{children}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
NavigationContainer,
|
|
3
4
|
NavigationIndependentTree,
|
|
@@ -43,6 +44,8 @@ import { CommunityStoriesNotificationSettingScreen } from '../../social/screens/
|
|
|
43
44
|
import { CommunityLivestreamsNotificationSettingScreen } from '../../social/screens/CommunityLivestreamsNotificationSetting';
|
|
44
45
|
import CommunityPendingRequest from '../../social/screens/CommunityPendingRequest';
|
|
45
46
|
import { GlobalBan } from '../../social/screens/GlobalBan';
|
|
47
|
+
import { VisitorUsageLimit } from '../../social/screens/VisitorUsageLimit';
|
|
48
|
+
import { useBehaviour } from '../../social/providers/BehaviourProvider';
|
|
46
49
|
import {
|
|
47
50
|
ImageViewerScreen,
|
|
48
51
|
VideoPlayerScreen,
|
|
@@ -60,10 +63,32 @@ const Stack = createNativeStackNavigator<
|
|
|
60
63
|
|
|
61
64
|
export default function AmitySocialUIKitV4Navigator() {
|
|
62
65
|
const theme = useTheme<MyMD3Theme>();
|
|
63
|
-
const { isGlobalBan } = useAuth();
|
|
66
|
+
const { isGlobalBan, isVisitorUsageLimitReached } = useAuth();
|
|
67
|
+
const { AmityGlobalBehaviour } = useBehaviour();
|
|
68
|
+
|
|
69
|
+
const handleVisitorUsageLimitReached =
|
|
70
|
+
AmityGlobalBehaviour?.handleVisitorUsageLimitReached;
|
|
71
|
+
|
|
72
|
+
const hasHandledUsageLimit = useRef(false);
|
|
73
|
+
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (!isVisitorUsageLimitReached) {
|
|
76
|
+
hasHandledUsageLimit.current = false;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (handleVisitorUsageLimitReached && !hasHandledUsageLimit.current) {
|
|
81
|
+
hasHandledUsageLimit.current = true;
|
|
82
|
+
handleVisitorUsageLimitReached();
|
|
83
|
+
}
|
|
84
|
+
}, [isVisitorUsageLimitReached, handleVisitorUsageLimitReached]);
|
|
64
85
|
|
|
65
86
|
if (isGlobalBan) return <GlobalBan />;
|
|
66
87
|
|
|
88
|
+
if (isVisitorUsageLimitReached && !handleVisitorUsageLimitReached) {
|
|
89
|
+
return <VisitorUsageLimit />;
|
|
90
|
+
}
|
|
91
|
+
|
|
67
92
|
return (
|
|
68
93
|
<NavigationIndependentTree>
|
|
69
94
|
<NavigationContainer ref={navigationRef} onReady={onNavigationReady}>
|
package/src/core/types/auth.ts
CHANGED
|
@@ -17,6 +17,12 @@ export type CommunitySettingPageContext = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export interface IBehaviour {
|
|
20
|
+
AmityGlobalBehaviour?: {
|
|
21
|
+
handleVisitorUserAction?: () => void;
|
|
22
|
+
handleNonMemberAction?: () => void;
|
|
23
|
+
handleVisitorUsageLimitReached?: () => void;
|
|
24
|
+
handleVisitorUsageLimitSignIn?: () => void;
|
|
25
|
+
};
|
|
20
26
|
AmitySocialHomePageBehaviour?: {
|
|
21
27
|
onChooseTab?: (arg?: string) => void;
|
|
22
28
|
};
|
|
@@ -31,6 +31,7 @@ import { useToast } from '../../../../core/stores/slices/toastSlice';
|
|
|
31
31
|
import { lock } from '../../../../core/assets/icons';
|
|
32
32
|
import { Typography } from '../../../../core/components/Typography/Typography';
|
|
33
33
|
import { MAX_MENTION_USERS } from '../../../../core/constants';
|
|
34
|
+
import useAuth from '../../../../core/hooks/useAuth';
|
|
34
35
|
|
|
35
36
|
interface ICommentListProp {
|
|
36
37
|
postId: string;
|
|
@@ -68,6 +69,8 @@ const CommentList: FC<ICommentListProp> = ({
|
|
|
68
69
|
withAvatar,
|
|
69
70
|
disabledComment,
|
|
70
71
|
}) => {
|
|
72
|
+
const { isVisitorOrBot } = useAuth();
|
|
73
|
+
const hideComposer = disabledInteraction || isVisitorOrBot;
|
|
71
74
|
const styles = useStyles();
|
|
72
75
|
const theme = useTheme() as MyMD3Theme;
|
|
73
76
|
const onNextPageRef = useRef<() => void | null>(null);
|
|
@@ -284,7 +287,7 @@ const CommentList: FC<ICommentListProp> = ({
|
|
|
284
287
|
</TouchableOpacity>
|
|
285
288
|
</View>
|
|
286
289
|
)}
|
|
287
|
-
{!
|
|
290
|
+
{!hideComposer &&
|
|
288
291
|
(disabledComment ? (
|
|
289
292
|
<View style={styles.disabledCommentWrap}>
|
|
290
293
|
<SvgXml
|
|
@@ -44,6 +44,7 @@ import ReplyCommentList from '../../legacy/Social/ReplyCommentList';
|
|
|
44
44
|
import AmityReactionListComponent from '../../../features/reaction/components/List';
|
|
45
45
|
import { CommentRepository } from '@amityco/ts-sdk-react-native';
|
|
46
46
|
import { useTimeDifference } from '../../../hooks/useTimeDifference';
|
|
47
|
+
import { useGlobalBehavior } from '../../../hooks/useGlobalBehavior';
|
|
47
48
|
import { LinkPreview } from '../../PreviewLink';
|
|
48
49
|
import { Typography } from '../../../../core/components/Typography/Typography';
|
|
49
50
|
import { pen, report, trash, unreport } from '../../../../core/assets/icons';
|
|
@@ -290,6 +291,14 @@ const CommentListItem = ({
|
|
|
290
291
|
onClickReply && onClickReply(user, commentId);
|
|
291
292
|
};
|
|
292
293
|
|
|
294
|
+
const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
|
|
295
|
+
|
|
296
|
+
const onPressLike = () =>
|
|
297
|
+
handleGlobalBehavior({ defaultBehavior: addReactionToComment });
|
|
298
|
+
|
|
299
|
+
const onPressReply = () =>
|
|
300
|
+
handleGlobalBehavior({ defaultBehavior: onHandleReply });
|
|
301
|
+
|
|
293
302
|
const onPressCommentReaction = () => {
|
|
294
303
|
setIsReactionListVisible(true);
|
|
295
304
|
};
|
|
@@ -348,10 +357,7 @@ const CommentListItem = ({
|
|
|
348
357
|
</Typography.Caption>
|
|
349
358
|
)}
|
|
350
359
|
</View>
|
|
351
|
-
<TouchableOpacity
|
|
352
|
-
onPress={() => addReactionToComment()}
|
|
353
|
-
style={styles.likeBtn}
|
|
354
|
-
>
|
|
360
|
+
<TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
|
|
355
361
|
<Typography.CaptionBold
|
|
356
362
|
style={isLike ? styles.likedText : styles.btnText}
|
|
357
363
|
>
|
|
@@ -359,20 +365,22 @@ const CommentListItem = ({
|
|
|
359
365
|
</Typography.CaptionBold>
|
|
360
366
|
</TouchableOpacity>
|
|
361
367
|
<TouchableOpacity
|
|
362
|
-
onPress={disabledComment ? undefined :
|
|
368
|
+
onPress={disabledComment ? undefined : onPressReply}
|
|
363
369
|
style={styles.likeBtn}
|
|
364
370
|
>
|
|
365
371
|
<Typography.CaptionBold style={styles.btnText}>
|
|
366
372
|
Reply
|
|
367
373
|
</Typography.CaptionBold>
|
|
368
374
|
</TouchableOpacity>
|
|
369
|
-
|
|
370
|
-
<
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
375
|
+
{!isVisitorOrBot && (
|
|
376
|
+
<TouchableOpacity onPress={openModal}>
|
|
377
|
+
<SvgXml
|
|
378
|
+
xml={threeDots(theme.colors.baseShade2)}
|
|
379
|
+
width="20"
|
|
380
|
+
height="20"
|
|
381
|
+
/>
|
|
382
|
+
</TouchableOpacity>
|
|
383
|
+
)}
|
|
376
384
|
</View>
|
|
377
385
|
|
|
378
386
|
{likeReaction > 0 && (
|
|
@@ -44,6 +44,7 @@ import { useNavigation } from '@react-navigation/native';
|
|
|
44
44
|
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
45
45
|
import { RootStackParamList } from '../../../../../core/routes/RouteParamList';
|
|
46
46
|
import { useTimeDifference } from '../../../../hooks';
|
|
47
|
+
import { useGlobalBehavior } from '../../../../hooks/useGlobalBehavior';
|
|
47
48
|
import { useToast } from '../../../../../core/stores/slices/toastSlice';
|
|
48
49
|
import AmityReactionListComponent from '../../../../features/reaction/components/List';
|
|
49
50
|
|
|
@@ -155,6 +156,12 @@ export default function ReplyCommentList({
|
|
|
155
156
|
await addCommentReaction(commentId, 'like');
|
|
156
157
|
}
|
|
157
158
|
};
|
|
159
|
+
|
|
160
|
+
const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
|
|
161
|
+
|
|
162
|
+
const onPressLike = () =>
|
|
163
|
+
handleGlobalBehavior({ defaultBehavior: addReactionToComment });
|
|
164
|
+
|
|
158
165
|
const deletePostObject = () => {
|
|
159
166
|
Alert.alert('Delete reply', `This reply will be permanently deleted.`, [
|
|
160
167
|
{
|
|
@@ -169,6 +176,7 @@ export default function ReplyCommentList({
|
|
|
169
176
|
]);
|
|
170
177
|
setIsVisible(false);
|
|
171
178
|
};
|
|
179
|
+
|
|
172
180
|
const reportCommentObject = async () => {
|
|
173
181
|
if (isReportByMe) {
|
|
174
182
|
const unReportPost = await unReportTargetById('comment', commentId);
|
|
@@ -267,10 +275,7 @@ export default function ReplyCommentList({
|
|
|
267
275
|
</Typography.Caption>
|
|
268
276
|
)}
|
|
269
277
|
</View>
|
|
270
|
-
<TouchableOpacity
|
|
271
|
-
onPress={() => addReactionToComment()}
|
|
272
|
-
style={styles.likeBtn}
|
|
273
|
-
>
|
|
278
|
+
<TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
|
|
274
279
|
<Typography.CaptionBold
|
|
275
280
|
style={isLike ? styles.likedText : styles.btnText}
|
|
276
281
|
>
|
|
@@ -278,13 +283,15 @@ export default function ReplyCommentList({
|
|
|
278
283
|
</Typography.CaptionBold>
|
|
279
284
|
</TouchableOpacity>
|
|
280
285
|
|
|
281
|
-
|
|
282
|
-
<
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
{!isVisitorOrBot && (
|
|
287
|
+
<TouchableOpacity onPress={openModal} style={styles.threeDots}>
|
|
288
|
+
<SvgXml
|
|
289
|
+
xml={threeDots(theme.colors.base)}
|
|
290
|
+
width="20"
|
|
291
|
+
height="16"
|
|
292
|
+
/>
|
|
293
|
+
</TouchableOpacity>
|
|
294
|
+
)}
|
|
288
295
|
</View>
|
|
289
296
|
{likeReaction > 0 && (
|
|
290
297
|
<TouchableOpacity
|