@amityco/react-native-social-uikit 4.0.2-8e4d4f3a.0 → 4.0.2-a91dab2.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 +10 -3
- package/lib/commonjs/core/providers/AmityUIKitProvider.js.map +1 -1
- package/lib/commonjs/core/providers/AuthProvider.js +44 -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/PollContent/PollOption.js +12 -12
- package/lib/commonjs/social/components/PollContent/PollOption.js.map +1 -1
- package/lib/commonjs/social/components/PostMenu/index.js +9 -2
- package/lib/commonjs/social/components/PostMenu/index.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 +24 -6
- package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/commonjs/social/components/Social/CommentListItem/styles.js +3 -2
- package/lib/commonjs/social/components/Social/CommentListItem/styles.js.map +1 -1
- package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js +14 -2
- package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
- package/lib/commonjs/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js +3 -1
- package/lib/commonjs/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.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 +17 -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 +17 -3
- package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
- package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/styles.js +8 -0
- package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/styles.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/livestream/Player/Player.js +9 -6
- package/lib/commonjs/social/features/livestream/Player/Player.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/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/story/View/components/AmityViewStoryItem.js +19 -21
- 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 +28 -19
- package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
- package/lib/commonjs/social/features/user/Profile/components/Header/styles.js +2 -0
- package/lib/commonjs/social/features/user/Profile/components/Header/styles.js.map +1 -1
- package/lib/commonjs/social/features/user/Profile/elements/Menu/hooks/useMenu.js +15 -4
- package/lib/commonjs/social/features/user/Profile/elements/Menu/hooks/useMenu.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/useGlobalBehavior.js +44 -0
- package/lib/commonjs/social/hooks/useGlobalBehavior.js.map +1 -0
- package/lib/commonjs/social/hooks/useInteractionBehavior.js +50 -0
- package/lib/commonjs/social/hooks/useInteractionBehavior.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/CommunityProfile/components/Header/Header.js +9 -2
- package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
- package/lib/commonjs/social/screens/SocialHomePage/index.js +23 -6
- 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 +10 -3
- package/lib/module/core/providers/AmityUIKitProvider.js.map +1 -1
- package/lib/module/core/providers/AuthProvider.js +44 -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/PollContent/PollOption.js +12 -12
- package/lib/module/social/components/PollContent/PollOption.js.map +1 -1
- package/lib/module/social/components/PostMenu/index.js +10 -3
- package/lib/module/social/components/PostMenu/index.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 +24 -6
- package/lib/module/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/module/social/components/Social/CommentListItem/styles.js +3 -2
- package/lib/module/social/components/Social/CommentListItem/styles.js.map +1 -1
- package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js +14 -2
- package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
- package/lib/module/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js +3 -1
- package/lib/module/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.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 +18 -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 +17 -3
- package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
- package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/styles.js +8 -0
- package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/styles.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/livestream/Player/Player.js +9 -6
- package/lib/module/social/features/livestream/Player/Player.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/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/story/View/components/AmityViewStoryItem.js +20 -22
- 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 +29 -20
- package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
- package/lib/module/social/features/user/Profile/components/Header/styles.js +2 -0
- package/lib/module/social/features/user/Profile/components/Header/styles.js.map +1 -1
- package/lib/module/social/features/user/Profile/elements/Menu/hooks/useMenu.js +16 -4
- package/lib/module/social/features/user/Profile/elements/Menu/hooks/useMenu.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/useGlobalBehavior.js +36 -0
- package/lib/module/social/hooks/useGlobalBehavior.js.map +1 -0
- package/lib/module/social/hooks/useInteractionBehavior.js +43 -0
- package/lib/module/social/hooks/useInteractionBehavior.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/CommunityProfile/components/Header/Header.js +10 -3
- package/lib/module/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
- package/lib/module/social/screens/SocialHomePage/index.js +25 -8
- 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 +7 -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 +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/PollContent/PollOption.d.ts.map +1 -1
- package/lib/typescript/social/components/PostMenu/index.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/Social/CommentListItem/styles.d.ts +2 -1
- package/lib/typescript/social/components/Social/CommentListItem/styles.d.ts.map +1 -1
- package/lib/typescript/social/components/legacy/Social/ReplyCommentList/index.d.ts.map +1 -1
- package/lib/typescript/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.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/comment/components/PostComment/ReplyCommentList/styles.d.ts +8 -0
- package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/styles.d.ts.map +1 -1
- package/lib/typescript/social/features/feed/components/TopNavigation/TopNavigation.d.ts.map +1 -1
- package/lib/typescript/social/features/livestream/Player/Player.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/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/View/components/AmityViewStoryItem.d.ts.map +1 -1
- package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts +2 -0
- package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts.map +1 -1
- package/lib/typescript/social/features/user/Profile/components/Header/styles.d.ts +2 -0
- package/lib/typescript/social/features/user/Profile/components/Header/styles.d.ts.map +1 -1
- package/lib/typescript/social/features/user/Profile/elements/Menu/hooks/useMenu.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/useGlobalBehavior.d.ts +16 -0
- package/lib/typescript/social/hooks/useGlobalBehavior.d.ts.map +1 -0
- package/lib/typescript/social/hooks/useInteractionBehavior.d.ts +11 -0
- package/lib/typescript/social/hooks/useInteractionBehavior.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/CommunityProfile/components/Header/Header.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 +28 -3
- package/src/core/providers/AuthProvider.tsx +34 -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/PollContent/PollOption.tsx +13 -19
- package/src/social/components/PostMenu/index.tsx +6 -3
- package/src/social/components/Social/CommentList/CommentList.tsx +4 -1
- package/src/social/components/Social/CommentListItem/CommentListItem.tsx +69 -55
- package/src/social/components/Social/CommentListItem/styles.ts +2 -1
- package/src/social/components/legacy/Social/ReplyCommentList/index.tsx +15 -5
- package/src/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.tsx +7 -1
- package/src/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +10 -2
- package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx +17 -10
- package/src/social/features/comment/components/PostComment/ReplyCommentList/index.tsx +15 -5
- package/src/social/features/comment/components/PostComment/ReplyCommentList/styles.ts +8 -0
- package/src/social/features/feed/components/TopNavigation/TopNavigation.tsx +3 -1
- package/src/social/features/livestream/Player/Player.tsx +10 -7
- package/src/social/features/post/Detail/index.tsx +5 -2
- 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/story/View/components/AmityViewStoryItem.tsx +21 -22
- package/src/social/features/user/Profile/components/Header/hooks/useHeader.ts +27 -20
- package/src/social/features/user/Profile/components/Header/styles.ts +2 -0
- package/src/social/features/user/Profile/elements/Menu/hooks/useMenu.ts +16 -4
- 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/useGlobalBehavior.ts +33 -0
- package/src/social/hooks/useInteractionBehavior.ts +47 -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/CommunityProfile/components/Header/Header.tsx +8 -2
- package/src/social/screens/SocialHomePage/index.tsx +45 -17
- package/src/social/screens/VisitorUsageLimit/VisitorUsageLimit.tsx +5 -0
- package/src/social/screens/VisitorUsageLimit/index.ts +1 -0
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
import { Pressable } from 'react-native';
|
|
28
28
|
import useAuth from '../../../../../../core/hooks/useAuth';
|
|
29
29
|
import { useTimeDifference } from '../../../../../hooks/useTimeDifference';
|
|
30
|
+
import { useGlobalBehavior } from '../../../../../hooks/useGlobalBehavior';
|
|
30
31
|
import {
|
|
31
32
|
isReportTarget,
|
|
32
33
|
reportTargetById,
|
|
@@ -144,6 +145,12 @@ const ReplyCommentList = ({
|
|
|
144
145
|
await addCommentReaction(commentId, 'like');
|
|
145
146
|
}
|
|
146
147
|
};
|
|
148
|
+
|
|
149
|
+
const { handleGlobalBehavior } = useGlobalBehavior();
|
|
150
|
+
|
|
151
|
+
const onPressLike = () =>
|
|
152
|
+
handleGlobalBehavior({ defaultBehavior: addReactionToComment });
|
|
153
|
+
|
|
147
154
|
const deleteReplyComment = () => {
|
|
148
155
|
Alert.alert('Delete reply', 'This reply will be permanently deleted.', [
|
|
149
156
|
{
|
|
@@ -292,10 +299,7 @@ const ReplyCommentList = ({
|
|
|
292
299
|
)}
|
|
293
300
|
</View>
|
|
294
301
|
|
|
295
|
-
<TouchableOpacity
|
|
296
|
-
onPress={() => addReactionToComment()}
|
|
297
|
-
style={styles.likeBtn}
|
|
298
|
-
>
|
|
302
|
+
<TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
|
|
299
303
|
<Text style={isLike ? styles.likedText : styles.btnText}>
|
|
300
304
|
{!isLike ? 'Like' : 'Liked'}
|
|
301
305
|
</Text>
|
|
@@ -342,6 +346,7 @@ const ReplyCommentList = ({
|
|
|
342
346
|
styles.twoOptions,
|
|
343
347
|
]}
|
|
344
348
|
>
|
|
349
|
+
<View style={styles.handleBar} />
|
|
345
350
|
{user?.userId === (client as Amity.Client).userId ? (
|
|
346
351
|
<View>
|
|
347
352
|
<TouchableOpacity
|
|
@@ -369,7 +374,12 @@ const ReplyCommentList = ({
|
|
|
369
374
|
</View>
|
|
370
375
|
) : (
|
|
371
376
|
<TouchableOpacity
|
|
372
|
-
onPress={
|
|
377
|
+
onPress={() => {
|
|
378
|
+
closeModal();
|
|
379
|
+
handleGlobalBehavior({
|
|
380
|
+
defaultBehavior: reportCommentObject,
|
|
381
|
+
});
|
|
382
|
+
}}
|
|
373
383
|
style={styles.modalRow}
|
|
374
384
|
>
|
|
375
385
|
<SvgXml
|
|
@@ -6,6 +6,14 @@ export const useStyles = () => {
|
|
|
6
6
|
const theme = useTheme() as MyMD3Theme;
|
|
7
7
|
|
|
8
8
|
const styles = StyleSheet.create({
|
|
9
|
+
handleBar: {
|
|
10
|
+
alignSelf: 'center',
|
|
11
|
+
width: 36,
|
|
12
|
+
backgroundColor: theme.colors.baseShade4,
|
|
13
|
+
height: 5,
|
|
14
|
+
marginVertical: 10,
|
|
15
|
+
borderRadius: 10,
|
|
16
|
+
},
|
|
9
17
|
commentWrap: {
|
|
10
18
|
backgroundColor: theme.colors.background,
|
|
11
19
|
paddingHorizontal: 12,
|
|
@@ -15,6 +15,7 @@ import AmityCreatePostMenuComponent from '../CreatePostMenu';
|
|
|
15
15
|
import TextKeyElement from '../../../../elements/TextKeyElement/TextKeyElement';
|
|
16
16
|
import { usePopup } from '../../../../hooks/usePopup';
|
|
17
17
|
import Popup from '../../../../components/PopupMenu/PopupMenu';
|
|
18
|
+
import useAuth from '../../../../../core/hooks/useAuth';
|
|
18
19
|
|
|
19
20
|
type AmitySocialHomeTopNavigationComponentType = {
|
|
20
21
|
activeTab: string;
|
|
@@ -29,6 +30,7 @@ const AmitySocialHomeTopNavigationComponent: FC<
|
|
|
29
30
|
const theme = componentConfig.themeStyles;
|
|
30
31
|
const { AmitySocialHomeTopNavigationComponentBehaviour } = useBehaviour();
|
|
31
32
|
const { isOpen, setIsOpen, toggle } = usePopup();
|
|
33
|
+
const { isVisitorOrBot } = useAuth();
|
|
32
34
|
|
|
33
35
|
const [myCommunitiesTab] = useUiKitConfig({
|
|
34
36
|
page: PageID.social_home_page,
|
|
@@ -169,7 +171,7 @@ const AmitySocialHomeTopNavigationComponent: FC<
|
|
|
169
171
|
>
|
|
170
172
|
<Image source={searchIcon} style={styles.icon} />
|
|
171
173
|
</TouchableOpacity>
|
|
172
|
-
{activeTab !== exploreTab && (
|
|
174
|
+
{!isVisitorOrBot && activeTab !== exploreTab && (
|
|
173
175
|
<TouchableOpacity
|
|
174
176
|
style={styles.iconBtn}
|
|
175
177
|
onPress={onPressCreate}
|
|
@@ -83,7 +83,7 @@ function AmityLiveStreamPlayerPage() {
|
|
|
83
83
|
};
|
|
84
84
|
useRoomSubscription({ room });
|
|
85
85
|
|
|
86
|
-
const { client } = useAuth();
|
|
86
|
+
const { client, isVisitorOrBot } = useAuth();
|
|
87
87
|
const videoRef = useRef<any>(null);
|
|
88
88
|
const isStreamEnding = useRef(false);
|
|
89
89
|
|
|
@@ -127,7 +127,7 @@ function AmityLiveStreamPlayerPage() {
|
|
|
127
127
|
}, []);
|
|
128
128
|
|
|
129
129
|
useEffect(() => {
|
|
130
|
-
if (!room?.status) return;
|
|
130
|
+
if (!room?.status || isVisitorOrBot) return;
|
|
131
131
|
|
|
132
132
|
const shouldEnd =
|
|
133
133
|
room.status === RoomStatus.ended ||
|
|
@@ -149,13 +149,14 @@ function AmityLiveStreamPlayerPage() {
|
|
|
149
149
|
setVideoKey((prev) => prev + 1);
|
|
150
150
|
}, 50);
|
|
151
151
|
}
|
|
152
|
-
}, [room?.status, wasLive]);
|
|
152
|
+
}, [room?.status, wasLive, isVisitorOrBot]);
|
|
153
153
|
|
|
154
154
|
useEffect(() => {
|
|
155
|
+
if (isVisitorOrBot) return;
|
|
155
156
|
if (room?.status === RoomStatus.terminated) {
|
|
156
157
|
navigation.replace('LivestreamTerminated', { type: 'viewer' });
|
|
157
158
|
}
|
|
158
|
-
}, [room?.status, navigation]);
|
|
159
|
+
}, [room?.status, navigation, isVisitorOrBot]);
|
|
159
160
|
|
|
160
161
|
const showControlsTemporarily = useCallback(() => {
|
|
161
162
|
setShowControls(true);
|
|
@@ -171,9 +172,10 @@ function AmityLiveStreamPlayerPage() {
|
|
|
171
172
|
}, [showControlsTemporarily]);
|
|
172
173
|
|
|
173
174
|
const shouldShowEndThumbnail =
|
|
174
|
-
|
|
175
|
-
(room?.status === RoomStatus.
|
|
176
|
-
|
|
175
|
+
!isVisitorOrBot &&
|
|
176
|
+
(room?.status === RoomStatus.ended ||
|
|
177
|
+
(room?.status === RoomStatus.recorded && wasLive) ||
|
|
178
|
+
(room as any)?.user?.isGlobalBan);
|
|
177
179
|
|
|
178
180
|
if (!room || error) {
|
|
179
181
|
return (
|
|
@@ -246,6 +248,7 @@ function AmityLiveStreamPlayerPage() {
|
|
|
246
248
|
setIsPaused(false);
|
|
247
249
|
}
|
|
248
250
|
}}
|
|
251
|
+
onEnd={() => setIsPaused(true)}
|
|
249
252
|
/>
|
|
250
253
|
)}
|
|
251
254
|
|
|
@@ -43,6 +43,7 @@ import NetInfo from '@react-native-community/netinfo';
|
|
|
43
43
|
import { useToast } from '../../../../core/stores/slices/toastSlice';
|
|
44
44
|
import MyAvatar from '../../../components/MyAvatar/MyAvatar';
|
|
45
45
|
import { MAX_MENTION_USERS } from '../../../../core/constants';
|
|
46
|
+
import useAuth from '../../../../core/hooks/useAuth';
|
|
46
47
|
|
|
47
48
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
48
49
|
import ErrorComponent from '../../../components/ErrorComponent/ErrorComponent';
|
|
@@ -73,6 +74,8 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
|
|
|
73
74
|
}) => {
|
|
74
75
|
const pageId = PageID.post_detail_page;
|
|
75
76
|
const componentId = ComponentID.WildCardComponent;
|
|
77
|
+
|
|
78
|
+
const { isVisitorOrBot } = useAuth();
|
|
76
79
|
const disabledInteraction = false;
|
|
77
80
|
const navigation =
|
|
78
81
|
useNavigation<NativeStackNavigationProp<RootStackParamList>>();
|
|
@@ -285,7 +288,7 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
|
|
|
285
288
|
</TouchableOpacity>
|
|
286
289
|
</View>
|
|
287
290
|
)}
|
|
288
|
-
{!disabledInteraction && (
|
|
291
|
+
{!disabledInteraction && !isVisitorOrBot && (
|
|
289
292
|
<View style={styles.InputWrap}>
|
|
290
293
|
<MyAvatar style={styles.myAvatar} />
|
|
291
294
|
<View style={styles.inputContainer}>
|
|
@@ -398,7 +401,7 @@ const AmityPostDetailPage: FC<AmityPostDetailPageType> = ({
|
|
|
398
401
|
postData?.targetType === 'community' && postData?.targetId
|
|
399
402
|
}
|
|
400
403
|
postType="post"
|
|
401
|
-
disabledInteraction={
|
|
404
|
+
disabledInteraction={disabledInteraction}
|
|
402
405
|
ListHeaderComponent={
|
|
403
406
|
postData && (
|
|
404
407
|
<AmityPostContentComponent
|
|
@@ -8,7 +8,10 @@ import {
|
|
|
8
8
|
} from '@amityco/ts-sdk-react-native';
|
|
9
9
|
import { AmityPostEngagementActionsSubComponentType } from './type';
|
|
10
10
|
import { useStyles } from './styles';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
useAmityComponent,
|
|
13
|
+
useInteractionBehavior,
|
|
14
|
+
} from '../../../../../hooks';
|
|
12
15
|
import { PageID, ComponentID } from '../../../../../enums';
|
|
13
16
|
import { SvgXml } from 'react-native-svg';
|
|
14
17
|
import { likeReaction } from '../../../../../../core/assets/icons/xml';
|
|
@@ -34,6 +37,7 @@ const DetailStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
|
|
|
34
37
|
componentId: ComponentID.post_content,
|
|
35
38
|
});
|
|
36
39
|
const styles = useStyles(themeStyles);
|
|
40
|
+
const { handleInteraction } = useInteractionBehavior();
|
|
37
41
|
const [postData, setPostData] = useState<Amity.Post>(null);
|
|
38
42
|
|
|
39
43
|
const { shareLink, handleSharePress } = usePostShareAction({
|
|
@@ -95,19 +99,20 @@ const DetailStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
|
|
|
95
99
|
}
|
|
96
100
|
}, [isLike, postId]);
|
|
97
101
|
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
const onPressReaction = useCallback(() => {
|
|
103
|
+
handleInteraction({
|
|
104
|
+
defaultBehavior: addReactionToPost,
|
|
105
|
+
isJoined: community ? community.isJoined : true,
|
|
106
|
+
});
|
|
107
|
+
}, [addReactionToPost, handleInteraction, community]);
|
|
101
108
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
);
|
|
110
|
-
}
|
|
109
|
+
const onClickReactions = useCallback(() => {
|
|
110
|
+
handleInteraction({
|
|
111
|
+
defaultBehavior: () => setIsReactionListVisible(true),
|
|
112
|
+
allowNonMember: true,
|
|
113
|
+
isJoined: community?.isJoined,
|
|
114
|
+
});
|
|
115
|
+
}, [handleInteraction, community]);
|
|
111
116
|
|
|
112
117
|
return (
|
|
113
118
|
<>
|
|
@@ -136,7 +141,7 @@ const DetailStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
|
|
|
136
141
|
</View>
|
|
137
142
|
<View style={[styles.actionSection, styles.detailActionSection]}>
|
|
138
143
|
<View style={styles.row}>
|
|
139
|
-
<TouchableOpacity onPress={
|
|
144
|
+
<TouchableOpacity onPress={onPressReaction} style={styles.likeBtn}>
|
|
140
145
|
{isLike ? (
|
|
141
146
|
<SvgXml
|
|
142
147
|
xml={likeReaction(themeStyles.colors.background)}
|
|
@@ -8,7 +8,10 @@ import {
|
|
|
8
8
|
subscribeTopic,
|
|
9
9
|
} from '@amityco/ts-sdk-react-native';
|
|
10
10
|
import { useStyles } from './styles';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
useAmityComponent,
|
|
13
|
+
useInteractionBehavior,
|
|
14
|
+
} from '../../../../../hooks';
|
|
12
15
|
import { PageID, ComponentID } from '../../../../../enums';
|
|
13
16
|
import { SvgXml } from 'react-native-svg';
|
|
14
17
|
import { likeReaction } from '../../../../../../core/assets/icons/xml';
|
|
@@ -38,6 +41,7 @@ const FeedStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
|
|
|
38
41
|
});
|
|
39
42
|
const styles = useStyles(themeStyles);
|
|
40
43
|
const { AmityGlobalFeedComponentBehavior } = useBehaviour();
|
|
44
|
+
const { handleInteraction } = useInteractionBehavior();
|
|
41
45
|
const navigation =
|
|
42
46
|
useNavigation<NativeStackNavigationProp<RootStackParamList>>();
|
|
43
47
|
const [postData, setPostData] = useState<Amity.Post>(null);
|
|
@@ -81,7 +85,14 @@ const FeedStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
|
|
|
81
85
|
}
|
|
82
86
|
}, [isLike, postData, postId]);
|
|
83
87
|
|
|
84
|
-
const
|
|
88
|
+
const onPressReaction = useCallback(() => {
|
|
89
|
+
handleInteraction({
|
|
90
|
+
defaultBehavior: addReactionToPost,
|
|
91
|
+
isJoined: community ? community.isJoined : true,
|
|
92
|
+
});
|
|
93
|
+
}, [addReactionToPost, handleInteraction, community]);
|
|
94
|
+
|
|
95
|
+
const goToPostDetail = useCallback(() => {
|
|
85
96
|
if (AmityGlobalFeedComponentBehavior.goToPostDetailPage) {
|
|
86
97
|
return AmityGlobalFeedComponentBehavior.goToPostDetailPage();
|
|
87
98
|
}
|
|
@@ -90,20 +101,17 @@ const FeedStyle: FC<AmityPostEngagementActionsSubComponentType> = ({
|
|
|
90
101
|
});
|
|
91
102
|
}, [AmityGlobalFeedComponentBehavior, navigation, postId]);
|
|
92
103
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
</View>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
104
|
+
const onPressComment = useCallback(() => {
|
|
105
|
+
handleInteraction({
|
|
106
|
+
defaultBehavior: goToPostDetail,
|
|
107
|
+
isJoined: community ? community.isJoined : true,
|
|
108
|
+
});
|
|
109
|
+
}, [goToPostDetail, handleInteraction, community]);
|
|
102
110
|
|
|
103
111
|
return (
|
|
104
112
|
<Pressable onPress={onPressComment} style={styles.actionSection}>
|
|
105
113
|
<View style={styles.row}>
|
|
106
|
-
<TouchableOpacity onPress={
|
|
114
|
+
<TouchableOpacity onPress={onPressReaction} style={styles.likeBtn}>
|
|
107
115
|
{isLike ? (
|
|
108
116
|
<SvgXml
|
|
109
117
|
xml={likeReaction(themeStyles.colors.background)}
|
|
@@ -13,7 +13,11 @@ import {
|
|
|
13
13
|
} from 'react-native';
|
|
14
14
|
import LinearGradient from 'react-native-linear-gradient';
|
|
15
15
|
import { FC, memo, useCallback, useRef, useState } from 'react';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
useConfigImageUri,
|
|
18
|
+
useInteractionBehavior,
|
|
19
|
+
useStory,
|
|
20
|
+
} from '../../../../hooks';
|
|
17
21
|
import { useStyles } from '../styles';
|
|
18
22
|
import Video, { OnLoadData } from 'react-native-video';
|
|
19
23
|
import {
|
|
@@ -40,6 +44,7 @@ import GestureRecognizer from 'react-native-swipe-gestures';
|
|
|
40
44
|
import uiSlice from '../../../../../core/stores/slices/uiSlice';
|
|
41
45
|
import { LoadingOverlay } from '../../../../components/legacy/LoadingOverlay';
|
|
42
46
|
import Toast from '../../../../components/legacy/Toast/Toast';
|
|
47
|
+
import GlobalToast from '../../../../components/Toast';
|
|
43
48
|
import { Typography } from '../../../../../core/components/Typography/Typography';
|
|
44
49
|
import { useTheme } from 'react-native-paper';
|
|
45
50
|
import { MyMD3Theme } from '../../../../../core/providers/AmityUIKitProvider';
|
|
@@ -87,6 +92,7 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
|
|
|
87
92
|
const progress = useRef(new Animated.Value(0)).current;
|
|
88
93
|
const sheetRef = useRef<BottomSheetMethods>(null);
|
|
89
94
|
const { handleReaction } = useStory();
|
|
95
|
+
const { handleInteraction } = useInteractionBehavior();
|
|
90
96
|
const currentStory = storyData[current];
|
|
91
97
|
const storyHyperLink = currentStory?.items[0]?.data || undefined;
|
|
92
98
|
const timeDifference = useTimeDifference(currentStory?.createdAt, true);
|
|
@@ -204,33 +210,24 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
|
|
|
204
210
|
}, [progress]);
|
|
205
211
|
|
|
206
212
|
const onPressReaction = useCallback(() => {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
progress.stopAnimation(() => setPressed(true));
|
|
218
|
-
Alert.alert('Join community to interact with all stories', null, [
|
|
219
|
-
{
|
|
220
|
-
text: 'OK',
|
|
221
|
-
onPress: () => {
|
|
222
|
-
startAnimation();
|
|
223
|
-
setPressed(false);
|
|
224
|
-
},
|
|
213
|
+
handleInteraction({
|
|
214
|
+
defaultBehavior: () => {
|
|
215
|
+
handleReaction({
|
|
216
|
+
targetId: currentStory?.storyId,
|
|
217
|
+
reactionName: 'like',
|
|
218
|
+
isLiked,
|
|
219
|
+
});
|
|
220
|
+
setTotalReaction((prev) => (isLiked ? prev - 1 : prev + 1));
|
|
221
|
+
setIsLiked((prev) => !prev);
|
|
225
222
|
},
|
|
226
|
-
|
|
223
|
+
isJoined: communityData?.isJoined,
|
|
224
|
+
});
|
|
227
225
|
}, [
|
|
228
226
|
communityData?.isJoined,
|
|
229
227
|
currentStory?.storyId,
|
|
228
|
+
handleInteraction,
|
|
230
229
|
handleReaction,
|
|
231
230
|
isLiked,
|
|
232
|
-
progress,
|
|
233
|
-
startAnimation,
|
|
234
231
|
]);
|
|
235
232
|
|
|
236
233
|
const onCloseBottomSheet = useCallback(() => {
|
|
@@ -652,6 +649,7 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
|
|
|
652
649
|
withAvatar={true}
|
|
653
650
|
/>
|
|
654
651
|
</KeyboardAvoidingView>
|
|
652
|
+
<GlobalToast />
|
|
655
653
|
</Modal>
|
|
656
654
|
)}
|
|
657
655
|
<BottomSheet
|
|
@@ -675,6 +673,7 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
|
|
|
675
673
|
</BottomSheet>
|
|
676
674
|
<LoadingOverlay isLoading={loading} />
|
|
677
675
|
<Toast />
|
|
676
|
+
<GlobalToast />
|
|
678
677
|
</View>
|
|
679
678
|
);
|
|
680
679
|
};
|
|
@@ -8,7 +8,7 @@ import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
|
8
8
|
import { RootStackParamList } from '../../../../../../../core/routes/RouteParamList';
|
|
9
9
|
import { UserRelationshipTab } from '../../../../../../types';
|
|
10
10
|
import { useBehaviour } from '../../../../../../providers/BehaviourProvider';
|
|
11
|
-
import { useBlockUser } from '../../../../../../hooks';
|
|
11
|
+
import { useBlockUser, useGlobalBehavior } from '../../../../../../hooks';
|
|
12
12
|
import useAuth from '../../../../../../../core/hooks/useAuth';
|
|
13
13
|
import { useFollowUser } from '../../../../../../hooks/queries/useFollowUser';
|
|
14
14
|
import useSocialSettings from '../../../../../../../core/hooks/useSocialSettings';
|
|
@@ -31,6 +31,7 @@ export function useHeader(user?: Amity.User) {
|
|
|
31
31
|
const { openBottomSheet, closeBottomSheet, bottomSheetHeight } =
|
|
32
32
|
useBottomSheet();
|
|
33
33
|
const { showToast } = useToast();
|
|
34
|
+
const { handleGlobalBehavior } = useGlobalBehavior();
|
|
34
35
|
const {
|
|
35
36
|
followUser,
|
|
36
37
|
unfollowUser,
|
|
@@ -56,7 +57,9 @@ export function useHeader(user?: Amity.User) {
|
|
|
56
57
|
|
|
57
58
|
const handleFollow = () => {
|
|
58
59
|
if (!user?.userId) return;
|
|
59
|
-
|
|
60
|
+
handleGlobalBehavior({
|
|
61
|
+
defaultBehavior: () => followUser(user.userId),
|
|
62
|
+
});
|
|
60
63
|
};
|
|
61
64
|
|
|
62
65
|
const handleUnfollow = () => {
|
|
@@ -109,24 +112,28 @@ export function useHeader(user?: Amity.User) {
|
|
|
109
112
|
|
|
110
113
|
const navigateToRelationship = (tab: UserRelationshipTab) => {
|
|
111
114
|
if (!user?.userId) return;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
115
|
+
handleGlobalBehavior({
|
|
116
|
+
defaultBehavior: () => {
|
|
117
|
+
if (!isMyProfile && isPrivateNetwork && !isFollowing) {
|
|
118
|
+
showToast({
|
|
119
|
+
type: 'informative',
|
|
120
|
+
message: TOAST.USER.RELATIONSHIP.FOLLOW_TO_INTERACT,
|
|
121
|
+
});
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (AmityUserProfileHeaderComponentBehavior?.goToUserRelationshipPage) {
|
|
125
|
+
AmityUserProfileHeaderComponentBehavior.goToUserRelationshipPage({
|
|
126
|
+
userId: user.userId,
|
|
127
|
+
selectedTab: tab,
|
|
128
|
+
});
|
|
129
|
+
} else {
|
|
130
|
+
navigation.push('UserRelationship', {
|
|
131
|
+
userId: user.userId,
|
|
132
|
+
selectedTab: tab,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
});
|
|
130
137
|
};
|
|
131
138
|
|
|
132
139
|
return {
|
|
@@ -17,6 +17,7 @@ import { useUserFlaggedByMeQuery } from '../../../../../../hooks/queries/useFlag
|
|
|
17
17
|
import { useBlockUser } from '../../../../../../hooks/queries/useBlockUser';
|
|
18
18
|
import { useFollowInfo } from '../../../../../../hooks/objects';
|
|
19
19
|
import { useBehaviour } from '../../../../../../providers/BehaviourProvider';
|
|
20
|
+
import { useGlobalBehavior } from '../../../../../../hooks';
|
|
20
21
|
|
|
21
22
|
type UseMenuParams = {
|
|
22
23
|
userId?: string;
|
|
@@ -28,6 +29,7 @@ export function useMenu({ userId, displayName }: UseMenuParams) {
|
|
|
28
29
|
|
|
29
30
|
const { client } = useAuth();
|
|
30
31
|
const { getShareLink } = useShareableLink();
|
|
32
|
+
const { handleGlobalBehavior } = useGlobalBehavior();
|
|
31
33
|
const { AmityUserProfilePageBehavior } = useBehaviour();
|
|
32
34
|
const { accessibilityId: menuButtonId } = useAmityElement({
|
|
33
35
|
pageId,
|
|
@@ -97,8 +99,10 @@ export function useMenu({ userId, displayName }: UseMenuParams) {
|
|
|
97
99
|
testID: 'report-user-button',
|
|
98
100
|
accessibilityLabel: 'Report user',
|
|
99
101
|
onPress: () => {
|
|
100
|
-
if (userId) reportUser(userId);
|
|
101
102
|
closeBottomSheet();
|
|
103
|
+
handleGlobalBehavior({
|
|
104
|
+
defaultBehavior: () => userId && reportUser(userId),
|
|
105
|
+
});
|
|
102
106
|
},
|
|
103
107
|
},
|
|
104
108
|
{
|
|
@@ -108,8 +112,10 @@ export function useMenu({ userId, displayName }: UseMenuParams) {
|
|
|
108
112
|
testID: 'unreport-user-button',
|
|
109
113
|
accessibilityLabel: 'Unreport user',
|
|
110
114
|
onPress: () => {
|
|
111
|
-
if (userId) unreportUser(userId);
|
|
112
115
|
closeBottomSheet();
|
|
116
|
+
handleGlobalBehavior({
|
|
117
|
+
defaultBehavior: () => userId && unreportUser(userId),
|
|
118
|
+
});
|
|
113
119
|
},
|
|
114
120
|
},
|
|
115
121
|
{
|
|
@@ -120,7 +126,10 @@ export function useMenu({ userId, displayName }: UseMenuParams) {
|
|
|
120
126
|
accessibilityLabel: 'Block user',
|
|
121
127
|
onPress: () => {
|
|
122
128
|
closeBottomSheet();
|
|
123
|
-
|
|
129
|
+
handleGlobalBehavior({
|
|
130
|
+
defaultBehavior: () =>
|
|
131
|
+
userId && blockUser(userId, displayName ?? userId),
|
|
132
|
+
});
|
|
124
133
|
},
|
|
125
134
|
},
|
|
126
135
|
{
|
|
@@ -131,7 +140,10 @@ export function useMenu({ userId, displayName }: UseMenuParams) {
|
|
|
131
140
|
accessibilityLabel: 'Unblock user',
|
|
132
141
|
onPress: () => {
|
|
133
142
|
closeBottomSheet();
|
|
134
|
-
|
|
143
|
+
handleGlobalBehavior({
|
|
144
|
+
defaultBehavior: () =>
|
|
145
|
+
userId && unBlockUser(userId, displayName ?? userId),
|
|
146
|
+
});
|
|
135
147
|
},
|
|
136
148
|
},
|
|
137
149
|
].filter((action) => action.visible);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
2
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
3
|
+
import { SvgXml } from 'react-native-svg';
|
|
4
|
+
import { Typography } from '../../../../core/components/Typography/Typography';
|
|
5
|
+
import { visitorLimit } from '../../../../core/assets/icons';
|
|
6
|
+
import { VISITOR_USAGE_LIMIT_MESSAGE } from '../../../../core/constants';
|
|
7
|
+
import { useUsageLimit } from './hooks';
|
|
8
|
+
|
|
9
|
+
export function UsageLimit() {
|
|
10
|
+
const { styles, theme, onPressSignIn } = useUsageLimit();
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<SafeAreaView style={styles.container} edges={['top', 'left']}>
|
|
14
|
+
<View style={styles.contentContainer}>
|
|
15
|
+
<SvgXml
|
|
16
|
+
accessible
|
|
17
|
+
accessibilityLabel="Usage limit reached"
|
|
18
|
+
width={60}
|
|
19
|
+
height={40}
|
|
20
|
+
style={styles.icon}
|
|
21
|
+
xml={visitorLimit()}
|
|
22
|
+
color={theme.colors.secondaryShade4}
|
|
23
|
+
/>
|
|
24
|
+
<Typography.TitleBold style={styles.title}>
|
|
25
|
+
{VISITOR_USAGE_LIMIT_MESSAGE.TITLE}
|
|
26
|
+
</Typography.TitleBold>
|
|
27
|
+
<Typography.Caption style={styles.subtitle}>
|
|
28
|
+
{VISITOR_USAGE_LIMIT_MESSAGE.SUBTITLE}
|
|
29
|
+
</Typography.Caption>
|
|
30
|
+
<TouchableOpacity
|
|
31
|
+
style={styles.signInButton}
|
|
32
|
+
onPress={onPressSignIn}
|
|
33
|
+
accessibilityRole="button"
|
|
34
|
+
accessibilityLabel={VISITOR_USAGE_LIMIT_MESSAGE.SIGN_IN}
|
|
35
|
+
>
|
|
36
|
+
<Typography.BodyBold style={styles.signInText}>
|
|
37
|
+
{VISITOR_USAGE_LIMIT_MESSAGE.SIGN_IN}
|
|
38
|
+
</Typography.BodyBold>
|
|
39
|
+
</TouchableOpacity>
|
|
40
|
+
</View>
|
|
41
|
+
</SafeAreaView>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useUsageLimit } from './useUsageLimit';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useCallback, useEffect } from 'react';
|
|
2
|
+
import { BackHandler } from 'react-native';
|
|
3
|
+
import { useStyles } from '../styles';
|
|
4
|
+
import { useToast } from '../../../../../core/stores/slices/toastSlice';
|
|
5
|
+
import { useBehaviour } from '../../../../providers/BehaviourProvider';
|
|
6
|
+
import {
|
|
7
|
+
VISITOR_USAGE_LIMIT_MESSAGE,
|
|
8
|
+
VISITOR_TOAST_DURATION,
|
|
9
|
+
} from '../../../../../core/constants';
|
|
10
|
+
|
|
11
|
+
export const useUsageLimit = () => {
|
|
12
|
+
const { styles, theme } = useStyles();
|
|
13
|
+
const { showToast } = useToast();
|
|
14
|
+
const { AmityGlobalBehaviour } = useBehaviour();
|
|
15
|
+
|
|
16
|
+
const showSignInToast = useCallback(() => {
|
|
17
|
+
showToast({
|
|
18
|
+
message: VISITOR_USAGE_LIMIT_MESSAGE.TOAST,
|
|
19
|
+
type: 'informative',
|
|
20
|
+
duration: VISITOR_TOAST_DURATION,
|
|
21
|
+
});
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
showSignInToast();
|
|
26
|
+
}, [showSignInToast]);
|
|
27
|
+
|
|
28
|
+
// Dead-end page: swallow the Android hardware back press so the user
|
|
29
|
+
// cannot navigate away from the error state.
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const subscription = BackHandler.addEventListener(
|
|
32
|
+
'hardwareBackPress',
|
|
33
|
+
() => true
|
|
34
|
+
);
|
|
35
|
+
return () => subscription.remove();
|
|
36
|
+
}, []);
|
|
37
|
+
|
|
38
|
+
const onPressSignIn = useCallback(() => {
|
|
39
|
+
if (AmityGlobalBehaviour?.handleVisitorUsageLimitSignIn) {
|
|
40
|
+
return AmityGlobalBehaviour.handleVisitorUsageLimitSignIn();
|
|
41
|
+
}
|
|
42
|
+
showSignInToast();
|
|
43
|
+
}, [AmityGlobalBehaviour, showSignInToast]);
|
|
44
|
+
|
|
45
|
+
return { styles, theme, onPressSignIn };
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UsageLimit } from './UsageLimit';
|