@amityco/react-native-social-uikit 4.0.2-f1fd1fbd.0 → 4.1.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 +44 -21
- 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/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 +14 -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.map +1 -1
- package/lib/module/core/providers/AuthProvider.js +44 -21
- 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/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 +15 -7
- 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/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/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 +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/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/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 +33 -16
- package/src/social/screens/VisitorUsageLimit/VisitorUsageLimit.tsx +5 -0
- package/src/social/screens/VisitorUsageLimit/index.ts +1 -0
|
@@ -9,6 +9,7 @@ import Button, { BUTTON_SIZE } from '../Button/Button';
|
|
|
9
9
|
import { useNavigation } from '@react-navigation/native';
|
|
10
10
|
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
11
11
|
import { RootStackParamList } from '../../../core/routes/RouteParamList';
|
|
12
|
+
import { useInteractionBehavior } from '../../hooks/useInteractionBehavior';
|
|
12
13
|
|
|
13
14
|
type PollOptionsProps = {
|
|
14
15
|
post?: Amity.Post<any>;
|
|
@@ -42,10 +43,10 @@ export function PollOptions({
|
|
|
42
43
|
useNavigation<NativeStackNavigationProp<RootStackParamList>>();
|
|
43
44
|
|
|
44
45
|
const { styles } = useStyles();
|
|
46
|
+
const { handleInteraction } = useInteractionBehavior();
|
|
45
47
|
const [selectedOption, setSelectedOption] = useState<Amity.PollAnswer[]>([]);
|
|
46
48
|
|
|
47
49
|
const btnDisabled = selectedOption.length === 0;
|
|
48
|
-
const optionDisabled = !!disabledPoll;
|
|
49
50
|
|
|
50
51
|
return (
|
|
51
52
|
<View>
|
|
@@ -60,7 +61,6 @@ export function PollOptions({
|
|
|
60
61
|
<Radio.Group<Amity.PollAnswer>
|
|
61
62
|
value={selectedOption[0]}
|
|
62
63
|
style={styles.optionGroup}
|
|
63
|
-
disabled={optionDisabled}
|
|
64
64
|
onChange={(value) => setSelectedOption([value])}
|
|
65
65
|
select={(value, option) => value.id === option.id}
|
|
66
66
|
>
|
|
@@ -79,11 +79,7 @@ export function PollOptions({
|
|
|
79
79
|
]}
|
|
80
80
|
>
|
|
81
81
|
<Radio.Label style={styles.optionLabel}>
|
|
82
|
-
<Typography.BodyBold
|
|
83
|
-
style={[optionDisabled && styles.optionLabelDisabled]}
|
|
84
|
-
>
|
|
85
|
-
{option.data}
|
|
86
|
-
</Typography.BodyBold>
|
|
82
|
+
<Typography.BodyBold>{option.data}</Typography.BodyBold>
|
|
87
83
|
</Radio.Label>
|
|
88
84
|
<Radio.Icon />
|
|
89
85
|
</Radio.Option>
|
|
@@ -93,7 +89,6 @@ export function PollOptions({
|
|
|
93
89
|
<CheckBox.Group<Amity.PollAnswer>
|
|
94
90
|
value={selectedOption}
|
|
95
91
|
style={styles.optionGroup}
|
|
96
|
-
disabled={optionDisabled}
|
|
97
92
|
onChange={(value) => setSelectedOption(value)}
|
|
98
93
|
select={(value, option) =>
|
|
99
94
|
!!value.find((item) => item.id === option.id)
|
|
@@ -115,11 +110,7 @@ export function PollOptions({
|
|
|
115
110
|
]}
|
|
116
111
|
>
|
|
117
112
|
<CheckBox.Label style={styles.optionLabel}>
|
|
118
|
-
<Typography.BodyBold
|
|
119
|
-
style={[optionDisabled && styles.optionLabelDisabled]}
|
|
120
|
-
>
|
|
121
|
-
{option.data}
|
|
122
|
-
</Typography.BodyBold>
|
|
113
|
+
<Typography.BodyBold>{option.data}</Typography.BodyBold>
|
|
123
114
|
</CheckBox.Label>
|
|
124
115
|
<CheckBox.Icon />
|
|
125
116
|
</CheckBox.Option>
|
|
@@ -144,12 +135,15 @@ export function PollOptions({
|
|
|
144
135
|
)}
|
|
145
136
|
{!isPollClosed && !isAlreadyVoted && (
|
|
146
137
|
<TouchableOpacity
|
|
147
|
-
disabled={btnDisabled
|
|
148
|
-
style={[
|
|
149
|
-
|
|
150
|
-
(
|
|
151
|
-
|
|
152
|
-
|
|
138
|
+
disabled={btnDisabled}
|
|
139
|
+
style={[styles.voteBtn, btnDisabled && styles.voteBtnDisabled]}
|
|
140
|
+
onPress={() =>
|
|
141
|
+
handleInteraction({
|
|
142
|
+
defaultBehavior: () =>
|
|
143
|
+
votePoll(selectedOption.map((option) => option.id)),
|
|
144
|
+
isJoined: !disabledPoll,
|
|
145
|
+
})
|
|
146
|
+
}
|
|
153
147
|
>
|
|
154
148
|
<Typography.BodyBold style={styles.voteBtnLabel}>
|
|
155
149
|
Vote
|
|
@@ -3,7 +3,7 @@ import { Alert, View } from 'react-native';
|
|
|
3
3
|
import { getCommunityById } from '../../../core/legacy/community';
|
|
4
4
|
import { useNavigation } from '@react-navigation/native';
|
|
5
5
|
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
6
|
-
import { useFlagPost, isModerator } from '../../hooks';
|
|
6
|
+
import { useFlagPost, isModerator, useGlobalBehavior } from '../../hooks';
|
|
7
7
|
import { deletePostById } from '../../../core/legacy/feed';
|
|
8
8
|
import useAuth from '../../../core/hooks/useAuth';
|
|
9
9
|
import globalFeedSlice from '../../../core/stores/slices/globalfeedSlice';
|
|
@@ -30,6 +30,7 @@ type PostMenuProps = {
|
|
|
30
30
|
|
|
31
31
|
export function PostMenu({ pageId, componentId, post }: PostMenuProps) {
|
|
32
32
|
const { showToast } = useToast();
|
|
33
|
+
const { handleGlobalBehavior } = useGlobalBehavior();
|
|
33
34
|
const { closePoll } = useClosePoll();
|
|
34
35
|
const { client } = useAuth();
|
|
35
36
|
const [communityData, setCommunityData] = useState<Amity.Community>(null);
|
|
@@ -121,7 +122,7 @@ export function PostMenu({ pageId, componentId, post }: PostMenuProps) {
|
|
|
121
122
|
iconProps={{ xml: report() }}
|
|
122
123
|
onPress={() => {
|
|
123
124
|
closeBottomSheet();
|
|
124
|
-
reportPost(postId);
|
|
125
|
+
handleGlobalBehavior({ defaultBehavior: () => reportPost(postId) });
|
|
125
126
|
}}
|
|
126
127
|
/>
|
|
127
128
|
),
|
|
@@ -136,7 +137,9 @@ export function PostMenu({ pageId, componentId, post }: PostMenuProps) {
|
|
|
136
137
|
label={'Unreport post'}
|
|
137
138
|
onPress={() => {
|
|
138
139
|
closeBottomSheet();
|
|
139
|
-
|
|
140
|
+
handleGlobalBehavior({
|
|
141
|
+
defaultBehavior: () => unreportPost(postId),
|
|
142
|
+
});
|
|
140
143
|
}}
|
|
141
144
|
/>
|
|
142
145
|
),
|
|
@@ -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 { useInteractionBehavior } from '../../../hooks/useInteractionBehavior';
|
|
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,20 @@ const CommentListItem = ({
|
|
|
290
291
|
onClickReply && onClickReply(user, commentId);
|
|
291
292
|
};
|
|
292
293
|
|
|
294
|
+
const { handleInteraction } = useInteractionBehavior();
|
|
295
|
+
|
|
296
|
+
const onPressLike = () =>
|
|
297
|
+
handleInteraction({
|
|
298
|
+
defaultBehavior: addReactionToComment,
|
|
299
|
+
isJoined: !disabledInteraction,
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
const onPressReply = () =>
|
|
303
|
+
handleInteraction({
|
|
304
|
+
defaultBehavior: onHandleReply,
|
|
305
|
+
isJoined: !disabledInteraction,
|
|
306
|
+
});
|
|
307
|
+
|
|
293
308
|
const onPressCommentReaction = () => {
|
|
294
309
|
setIsReactionListVisible(true);
|
|
295
310
|
};
|
|
@@ -334,60 +349,55 @@ const CommentListItem = ({
|
|
|
334
349
|
/>
|
|
335
350
|
)}
|
|
336
351
|
</View>
|
|
337
|
-
{
|
|
338
|
-
<View style={styles.
|
|
339
|
-
<View style={styles.
|
|
340
|
-
<
|
|
352
|
+
<View style={styles.actionSection}>
|
|
353
|
+
<View style={styles.rowContainer}>
|
|
354
|
+
<View style={styles.timeRow}>
|
|
355
|
+
<Typography.Caption style={styles.headerTextTime}>
|
|
356
|
+
{timeDifference}
|
|
357
|
+
</Typography.Caption>
|
|
358
|
+
{(editedAt !== createdAt || isEditComment) && (
|
|
341
359
|
<Typography.Caption style={styles.headerTextTime}>
|
|
342
|
-
{
|
|
360
|
+
{' '}
|
|
361
|
+
(edited)
|
|
343
362
|
</Typography.Caption>
|
|
344
|
-
|
|
345
|
-
<Typography.Caption style={styles.headerTextTime}>
|
|
346
|
-
{' '}
|
|
347
|
-
(edited)
|
|
348
|
-
</Typography.Caption>
|
|
349
|
-
)}
|
|
350
|
-
</View>
|
|
351
|
-
<TouchableOpacity
|
|
352
|
-
onPress={() => addReactionToComment()}
|
|
353
|
-
style={styles.likeBtn}
|
|
354
|
-
>
|
|
355
|
-
<Typography.CaptionBold
|
|
356
|
-
style={isLike ? styles.likedText : styles.btnText}
|
|
357
|
-
>
|
|
358
|
-
Like
|
|
359
|
-
</Typography.CaptionBold>
|
|
360
|
-
</TouchableOpacity>
|
|
361
|
-
<TouchableOpacity
|
|
362
|
-
onPress={disabledComment ? undefined : onHandleReply}
|
|
363
|
-
style={styles.likeBtn}
|
|
364
|
-
>
|
|
365
|
-
<Typography.CaptionBold style={styles.btnText}>
|
|
366
|
-
Reply
|
|
367
|
-
</Typography.CaptionBold>
|
|
368
|
-
</TouchableOpacity>
|
|
369
|
-
<TouchableOpacity onPress={openModal}>
|
|
370
|
-
<SvgXml
|
|
371
|
-
xml={threeDots(theme.colors.baseShade2)}
|
|
372
|
-
width="20"
|
|
373
|
-
height="20"
|
|
374
|
-
/>
|
|
375
|
-
</TouchableOpacity>
|
|
363
|
+
)}
|
|
376
364
|
</View>
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
onPress={onPressCommentReaction}
|
|
381
|
-
style={styles.likeBtn}
|
|
365
|
+
<TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
|
|
366
|
+
<Typography.CaptionBold
|
|
367
|
+
style={isLike ? styles.likedText : styles.btnText}
|
|
382
368
|
>
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
369
|
+
Like
|
|
370
|
+
</Typography.CaptionBold>
|
|
371
|
+
</TouchableOpacity>
|
|
372
|
+
<TouchableOpacity
|
|
373
|
+
onPress={disabledComment ? undefined : onPressReply}
|
|
374
|
+
style={styles.likeBtn}
|
|
375
|
+
>
|
|
376
|
+
<Typography.CaptionBold style={styles.btnText}>
|
|
377
|
+
Reply
|
|
378
|
+
</Typography.CaptionBold>
|
|
379
|
+
</TouchableOpacity>
|
|
380
|
+
<TouchableOpacity onPress={openModal}>
|
|
381
|
+
<SvgXml
|
|
382
|
+
xml={threeDots(theme.colors.baseShade2)}
|
|
383
|
+
width="20"
|
|
384
|
+
height="20"
|
|
385
|
+
/>
|
|
386
|
+
</TouchableOpacity>
|
|
389
387
|
</View>
|
|
390
|
-
|
|
388
|
+
|
|
389
|
+
{likeReaction > 0 && (
|
|
390
|
+
<TouchableOpacity
|
|
391
|
+
onPress={onPressCommentReaction}
|
|
392
|
+
style={styles.likeBtn}
|
|
393
|
+
>
|
|
394
|
+
<Typography.Caption style={styles.btnText}>
|
|
395
|
+
{likeReaction}
|
|
396
|
+
</Typography.Caption>
|
|
397
|
+
<SvgXml xml={likeCircle} width="20" height="20" />
|
|
398
|
+
</TouchableOpacity>
|
|
399
|
+
)}
|
|
400
|
+
</View>
|
|
391
401
|
|
|
392
402
|
{previewReplyCommentList.length > 0 && !isOpenReply && (
|
|
393
403
|
<ReplyCommentList
|
|
@@ -423,10 +433,10 @@ const CommentListItem = ({
|
|
|
423
433
|
style={styles.viewMoreReplyBtn}
|
|
424
434
|
>
|
|
425
435
|
<SvgXml xml={expandIcon} />
|
|
426
|
-
<
|
|
436
|
+
<Text style={styles.viewMoreText}>
|
|
427
437
|
View {childrenNumber}{' '}
|
|
428
438
|
{childrenNumber === 1 ? 'reply' : 'replies'}
|
|
429
|
-
</
|
|
439
|
+
</Text>
|
|
430
440
|
</TouchableOpacity>
|
|
431
441
|
)}
|
|
432
442
|
|
|
@@ -436,9 +446,7 @@ const CommentListItem = ({
|
|
|
436
446
|
style={styles.viewMoreReplyBtn}
|
|
437
447
|
>
|
|
438
448
|
<SvgXml xml={expandIcon} />
|
|
439
|
-
<
|
|
440
|
-
View more replies
|
|
441
|
-
</Typography.CaptionBold>
|
|
449
|
+
<Text style={styles.viewMoreText}>View more replies</Text>
|
|
442
450
|
</TouchableOpacity>
|
|
443
451
|
)}
|
|
444
452
|
</View>
|
|
@@ -492,7 +500,13 @@ const CommentListItem = ({
|
|
|
492
500
|
</View>
|
|
493
501
|
) : (
|
|
494
502
|
<TouchableOpacity
|
|
495
|
-
onPress={
|
|
503
|
+
onPress={() => {
|
|
504
|
+
closeModal();
|
|
505
|
+
handleInteraction({
|
|
506
|
+
defaultBehavior: reportCommentObject,
|
|
507
|
+
allowNonMember: true,
|
|
508
|
+
});
|
|
509
|
+
}}
|
|
496
510
|
style={styles.modalRow}
|
|
497
511
|
>
|
|
498
512
|
<SvgXml
|
|
@@ -71,12 +71,13 @@ export const useStyles = () => {
|
|
|
71
71
|
paddingHorizontal: 8,
|
|
72
72
|
marginTop: 12,
|
|
73
73
|
flexDirection: 'row',
|
|
74
|
-
justifyContent: 'center',
|
|
75
74
|
alignItems: 'center',
|
|
76
75
|
alignSelf: 'flex-start',
|
|
77
76
|
},
|
|
78
77
|
viewMoreText: {
|
|
78
|
+
fontWeight: '600',
|
|
79
79
|
color: theme.colors.secondaryShade1,
|
|
80
|
+
paddingHorizontal: 4,
|
|
80
81
|
},
|
|
81
82
|
commentText: {
|
|
82
83
|
fontSize: 15,
|
|
@@ -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 } = 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
|
>
|
|
@@ -359,7 +364,12 @@ export default function ReplyCommentList({
|
|
|
359
364
|
</View>
|
|
360
365
|
) : (
|
|
361
366
|
<TouchableOpacity
|
|
362
|
-
onPress={
|
|
367
|
+
onPress={() => {
|
|
368
|
+
closeModal();
|
|
369
|
+
handleGlobalBehavior({
|
|
370
|
+
defaultBehavior: reportCommentObject,
|
|
371
|
+
});
|
|
372
|
+
}}
|
|
363
373
|
style={styles.modalRow}
|
|
364
374
|
>
|
|
365
375
|
<SvgXml
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { FC, memo } from 'react';
|
|
2
2
|
import { TouchableOpacityProps } from 'react-native';
|
|
3
3
|
import { ComponentID, ElementID, PageID } from '../../enums/enumUIKitID';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
useAmityElement,
|
|
6
|
+
useGlobalBehavior,
|
|
7
|
+
useJoinCommunity,
|
|
8
|
+
} from '../../hooks';
|
|
5
9
|
import { Button, BUTTON_SIZE } from '../../components/Button/Button';
|
|
6
10
|
import { plus } from '../../../core/assets/icons';
|
|
7
11
|
import { useCustomRankingGlobalFeed } from '../../hooks/useCustomRankingGlobalFeed';
|
|
@@ -36,9 +40,13 @@ const CommunityJoinButton: FC<CommunityJoinButtonType> = ({
|
|
|
36
40
|
},
|
|
37
41
|
});
|
|
38
42
|
|
|
43
|
+
const { handleGlobalBehavior } = useGlobalBehavior();
|
|
44
|
+
|
|
39
45
|
const handleJoinCommunity = () => {
|
|
40
46
|
if (!communityId) return;
|
|
41
|
-
|
|
47
|
+
handleGlobalBehavior({
|
|
48
|
+
defaultBehavior: () => joinCommunity(communityId),
|
|
49
|
+
});
|
|
42
50
|
};
|
|
43
51
|
|
|
44
52
|
if (isExcluded) return null;
|
package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx
CHANGED
|
@@ -43,7 +43,7 @@ import { useTheme } from 'react-native-paper';
|
|
|
43
43
|
import type { MyMD3Theme } from '../../../../../../core/providers/AmityUIKitProvider';
|
|
44
44
|
import ReplyCommentList from '../ReplyCommentList/index';
|
|
45
45
|
import { CommentRepository } from '@amityco/ts-sdk-react-native';
|
|
46
|
-
import { useTimeDifference } from '../../../../../hooks';
|
|
46
|
+
import { useGlobalBehavior, useTimeDifference } from '../../../../../hooks';
|
|
47
47
|
import ModeratorBadgeElement from '../../../../../elements/ModeratorBadgeElement/ModeratorBadgeElement';
|
|
48
48
|
import { BrandBadge } from '../../../../../elements/BrandBadge';
|
|
49
49
|
import { ComponentID, PageID } from '../../../../../enums';
|
|
@@ -315,6 +315,14 @@ const CommentListItem = ({
|
|
|
315
315
|
onClickReply && onClickReply(user, commentId);
|
|
316
316
|
};
|
|
317
317
|
|
|
318
|
+
const { handleGlobalBehavior } = useGlobalBehavior();
|
|
319
|
+
|
|
320
|
+
const onPressLike = () =>
|
|
321
|
+
handleGlobalBehavior({ defaultBehavior: addReactionToComment });
|
|
322
|
+
|
|
323
|
+
const onPressReply = () =>
|
|
324
|
+
handleGlobalBehavior({ defaultBehavior: onHandleReply });
|
|
325
|
+
|
|
318
326
|
const onPressCommentReaction = () => {
|
|
319
327
|
onNavigate && onNavigate();
|
|
320
328
|
setIsReactionListVisible(true);
|
|
@@ -399,18 +407,12 @@ const CommentListItem = ({
|
|
|
399
407
|
)}
|
|
400
408
|
</View>
|
|
401
409
|
|
|
402
|
-
<TouchableOpacity
|
|
403
|
-
onPress={() => addReactionToComment()}
|
|
404
|
-
style={styles.likeBtn}
|
|
405
|
-
>
|
|
410
|
+
<TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
|
|
406
411
|
<Text style={isLike ? styles.likedText : styles.btnText}>
|
|
407
412
|
{!isLike ? 'Like' : 'Liked'}
|
|
408
413
|
</Text>
|
|
409
414
|
</TouchableOpacity>
|
|
410
|
-
<TouchableOpacity
|
|
411
|
-
onPress={onHandleReply}
|
|
412
|
-
style={styles.likeBtn}
|
|
413
|
-
>
|
|
415
|
+
<TouchableOpacity onPress={onPressReply} style={styles.likeBtn}>
|
|
414
416
|
<Text style={styles.btnText}>Reply</Text>
|
|
415
417
|
</TouchableOpacity>
|
|
416
418
|
<TouchableOpacity onPress={openModal} style={styles.threeDots}>
|
|
@@ -532,7 +534,12 @@ const CommentListItem = ({
|
|
|
532
534
|
</View>
|
|
533
535
|
) : (
|
|
534
536
|
<TouchableOpacity
|
|
535
|
-
onPress={
|
|
537
|
+
onPress={() => {
|
|
538
|
+
closeModal();
|
|
539
|
+
handleGlobalBehavior({
|
|
540
|
+
defaultBehavior: reportCommentObject,
|
|
541
|
+
});
|
|
542
|
+
}}
|
|
536
543
|
style={styles.modalRow}
|
|
537
544
|
>
|
|
538
545
|
<SvgXml
|
|
@@ -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
|