@amityco/react-native-social-uikit 4.0.0 → 4.0.1-324acbfd.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 +30 -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 +46 -16
- package/lib/commonjs/core/providers/AuthProvider.js.map +1 -1
- package/lib/commonjs/core/routes/AmityPageRenderer.js +5 -1
- package/lib/commonjs/core/routes/AmityPageRenderer.js.map +1 -1
- package/lib/commonjs/core/routes/AmityUIKitNavigator.js +42 -1
- package/lib/commonjs/core/routes/AmityUIKitNavigator.js.map +1 -1
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/social/components/Social/CommentList/CommentList.js +7 -1
- package/lib/commonjs/social/components/Social/CommentList/CommentList.js.map +1 -1
- package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js +16 -3
- package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js +12 -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/enums/enumUIKitID.js +2 -0
- package/lib/commonjs/social/enums/enumUIKitID.js.map +1 -1
- package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +15 -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 +12 -2
- package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
- package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js +5 -1
- package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
- package/lib/commonjs/social/features/post/Detail/index.js +8 -2
- package/lib/commonjs/social/features/post/Detail/index.js.map +1 -1
- package/lib/commonjs/social/features/post/components/Content/Content.js +5 -1
- package/lib/commonjs/social/features/post/components/Content/Content.js.map +1 -1
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js +9 -1
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js +9 -1
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
- package/lib/commonjs/social/features/user/CreateProfile/CreateProfile.js +114 -0
- package/lib/commonjs/social/features/user/CreateProfile/CreateProfile.js.map +1 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.js +78 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.js.map +1 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/ImageUpload/index.js +13 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/ImageUpload/index.js.map +1 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/ImageUpload/styles.js +51 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/ImageUpload/styles.js.map +1 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/TopBar/TopBar.js +34 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/TopBar/TopBar.js.map +1 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/TopBar/index.js +13 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/TopBar/index.js.map +1 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/TopBar/styles.js +37 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/TopBar/styles.js.map +1 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/index.js +28 -0
- package/lib/commonjs/social/features/user/CreateProfile/components/index.js.map +1 -0
- package/lib/commonjs/social/features/user/CreateProfile/hooks/index.js +17 -0
- package/lib/commonjs/social/features/user/CreateProfile/hooks/index.js.map +1 -0
- package/lib/commonjs/social/features/user/CreateProfile/hooks/useCreateProfile.js +194 -0
- package/lib/commonjs/social/features/user/CreateProfile/hooks/useCreateProfile.js.map +1 -0
- package/lib/commonjs/social/features/user/CreateProfile/index.js +13 -0
- package/lib/commonjs/social/features/user/CreateProfile/index.js.map +1 -0
- package/lib/commonjs/social/features/user/CreateProfile/styles.js +40 -0
- package/lib/commonjs/social/features/user/CreateProfile/styles.js.map +1 -0
- package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js +6 -1
- package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
- package/lib/commonjs/social/hooks/index.js +11 -0
- package/lib/commonjs/social/hooks/index.js.map +1 -1
- package/lib/commonjs/social/hooks/useGlobalBehavior.js +53 -0
- package/lib/commonjs/social/hooks/useGlobalBehavior.js.map +1 -0
- package/lib/commonjs/social/hooks/usePostPermission.js +4 -2
- package/lib/commonjs/social/hooks/usePostPermission.js.map +1 -1
- package/lib/commonjs/social/hooks/useStoryPermission.js +3 -2
- package/lib/commonjs/social/hooks/useStoryPermission.js.map +1 -1
- package/lib/commonjs/social/index.js +13 -0
- package/lib/commonjs/social/index.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/CreateUserProfile/CreateUserProfile.js +20 -0
- package/lib/commonjs/social/screens/CreateUserProfile/CreateUserProfile.js.map +1 -0
- package/lib/commonjs/social/screens/CreateUserProfile/index.js +13 -0
- package/lib/commonjs/social/screens/CreateUserProfile/index.js.map +1 -0
- package/lib/commonjs/social/screens/SocialHomePage/index.js +22 -7
- package/lib/commonjs/social/screens/SocialHomePage/index.js.map +1 -1
- package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +78 -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/commonjs/social/screens/VisitorUsageLimit/styles.js +50 -0
- package/lib/commonjs/social/screens/VisitorUsageLimit/styles.js.map +1 -0
- package/lib/commonjs/social/screens/index.js +11 -0
- package/lib/commonjs/social/screens/index.js.map +1 -1
- 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 +23 -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 +46 -16
- package/lib/module/core/providers/AuthProvider.js.map +1 -1
- package/lib/module/core/routes/AmityPageRenderer.js +5 -1
- package/lib/module/core/routes/AmityPageRenderer.js.map +1 -1
- package/lib/module/core/routes/AmityUIKitNavigator.js +42 -1
- package/lib/module/core/routes/AmityUIKitNavigator.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/social/components/Social/CommentList/CommentList.js +7 -1
- package/lib/module/social/components/Social/CommentList/CommentList.js.map +1 -1
- package/lib/module/social/components/Social/CommentListItem/CommentListItem.js +16 -3
- package/lib/module/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js +12 -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/enums/enumUIKitID.js +2 -0
- package/lib/module/social/enums/enumUIKitID.js.map +1 -1
- package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +16 -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 +12 -2
- package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
- package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js +5 -1
- package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
- package/lib/module/social/features/post/Detail/index.js +8 -2
- package/lib/module/social/features/post/Detail/index.js.map +1 -1
- package/lib/module/social/features/post/components/Content/Content.js +5 -1
- package/lib/module/social/features/post/components/Content/Content.js.map +1 -1
- package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js +10 -2
- package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
- package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js +10 -2
- package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
- package/lib/module/social/features/user/CreateProfile/CreateProfile.js +107 -0
- package/lib/module/social/features/user/CreateProfile/CreateProfile.js.map +1 -0
- package/lib/module/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.js +72 -0
- package/lib/module/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.js.map +1 -0
- package/lib/module/social/features/user/CreateProfile/components/ImageUpload/index.js +2 -0
- package/lib/module/social/features/user/CreateProfile/components/ImageUpload/index.js.map +1 -0
- package/lib/module/social/features/user/CreateProfile/components/ImageUpload/styles.js +44 -0
- package/lib/module/social/features/user/CreateProfile/components/ImageUpload/styles.js.map +1 -0
- package/lib/module/social/features/user/CreateProfile/components/TopBar/TopBar.js +27 -0
- package/lib/module/social/features/user/CreateProfile/components/TopBar/TopBar.js.map +1 -0
- package/lib/module/social/features/user/CreateProfile/components/TopBar/index.js +2 -0
- package/lib/module/social/features/user/CreateProfile/components/TopBar/index.js.map +1 -0
- package/lib/module/social/features/user/CreateProfile/components/TopBar/styles.js +30 -0
- package/lib/module/social/features/user/CreateProfile/components/TopBar/styles.js.map +1 -0
- package/lib/module/social/features/user/CreateProfile/components/index.js +3 -0
- package/lib/module/social/features/user/CreateProfile/components/index.js.map +1 -0
- package/lib/module/social/features/user/CreateProfile/hooks/index.js +2 -0
- package/lib/module/social/features/user/CreateProfile/hooks/index.js.map +1 -0
- package/lib/module/social/features/user/CreateProfile/hooks/useCreateProfile.js +187 -0
- package/lib/module/social/features/user/CreateProfile/hooks/useCreateProfile.js.map +1 -0
- package/lib/module/social/features/user/CreateProfile/index.js +2 -0
- package/lib/module/social/features/user/CreateProfile/index.js.map +1 -0
- package/lib/module/social/features/user/CreateProfile/styles.js +33 -0
- package/lib/module/social/features/user/CreateProfile/styles.js.map +1 -0
- package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js +7 -2
- package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
- package/lib/module/social/hooks/index.js +1 -0
- package/lib/module/social/hooks/index.js.map +1 -1
- package/lib/module/social/hooks/useGlobalBehavior.js +45 -0
- package/lib/module/social/hooks/useGlobalBehavior.js.map +1 -0
- package/lib/module/social/hooks/usePostPermission.js +4 -2
- package/lib/module/social/hooks/usePostPermission.js.map +1 -1
- package/lib/module/social/hooks/useStoryPermission.js +3 -2
- package/lib/module/social/hooks/useStoryPermission.js.map +1 -1
- package/lib/module/social/index.js +2 -1
- package/lib/module/social/index.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/CreateUserProfile/CreateUserProfile.js +14 -0
- package/lib/module/social/screens/CreateUserProfile/CreateUserProfile.js.map +1 -0
- package/lib/module/social/screens/CreateUserProfile/index.js +2 -0
- package/lib/module/social/screens/CreateUserProfile/index.js.map +1 -0
- package/lib/module/social/screens/SocialHomePage/index.js +23 -8
- package/lib/module/social/screens/SocialHomePage/index.js.map +1 -1
- package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +72 -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/module/social/screens/VisitorUsageLimit/styles.js +43 -0
- package/lib/module/social/screens/VisitorUsageLimit/styles.js.map +1 -0
- package/lib/module/social/screens/index.js +1 -0
- package/lib/module/social/screens/index.js.map +1 -1
- 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 +8 -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/AmityPageRenderer.d.ts.map +1 -1
- package/lib/typescript/core/routes/AmityUIKitNavigator.d.ts.map +1 -1
- package/lib/typescript/core/routes/RouteParamList.d.ts +1 -0
- package/lib/typescript/core/routes/RouteParamList.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 +18 -0
- package/lib/typescript/core/types/behaviour.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/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/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/enums/enumUIKitID.d.ts +2 -0
- package/lib/typescript/social/enums/enumUIKitID.d.ts.map +1 -1
- package/lib/typescript/social/features/comment/components/PostComment/CommentListItem/CommentListItem.d.ts.map +1 -1
- package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/index.d.ts.map +1 -1
- package/lib/typescript/social/features/feed/components/TopNavigation/TopNavigation.d.ts.map +1 -1
- package/lib/typescript/social/features/post/Detail/index.d.ts.map +1 -1
- package/lib/typescript/social/features/post/components/Content/Content.d.ts.map +1 -1
- package/lib/typescript/social/features/post/components/EngagementActions/Components/DetailStyle.d.ts.map +1 -1
- package/lib/typescript/social/features/post/components/EngagementActions/Components/FeedStyle.d.ts.map +1 -1
- package/lib/typescript/social/features/user/CreateProfile/CreateProfile.d.ts +28 -0
- package/lib/typescript/social/features/user/CreateProfile/CreateProfile.d.ts.map +1 -0
- package/lib/typescript/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.d.ts +9 -0
- package/lib/typescript/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.d.ts.map +1 -0
- package/lib/typescript/social/features/user/CreateProfile/components/ImageUpload/index.d.ts +2 -0
- package/lib/typescript/social/features/user/CreateProfile/components/ImageUpload/index.d.ts.map +1 -0
- package/lib/typescript/social/features/user/CreateProfile/components/ImageUpload/styles.d.ts +39 -0
- package/lib/typescript/social/features/user/CreateProfile/components/ImageUpload/styles.d.ts.map +1 -0
- package/lib/typescript/social/features/user/CreateProfile/components/TopBar/TopBar.d.ts +7 -0
- package/lib/typescript/social/features/user/CreateProfile/components/TopBar/TopBar.d.ts.map +1 -0
- package/lib/typescript/social/features/user/CreateProfile/components/TopBar/index.d.ts +2 -0
- package/lib/typescript/social/features/user/CreateProfile/components/TopBar/index.d.ts.map +1 -0
- package/lib/typescript/social/features/user/CreateProfile/components/TopBar/styles.d.ts +25 -0
- package/lib/typescript/social/features/user/CreateProfile/components/TopBar/styles.d.ts.map +1 -0
- package/lib/typescript/social/features/user/CreateProfile/components/index.d.ts +3 -0
- package/lib/typescript/social/features/user/CreateProfile/components/index.d.ts.map +1 -0
- package/lib/typescript/social/features/user/CreateProfile/hooks/index.d.ts +2 -0
- package/lib/typescript/social/features/user/CreateProfile/hooks/index.d.ts.map +1 -0
- package/lib/typescript/social/features/user/CreateProfile/hooks/useCreateProfile.d.ts +74 -0
- package/lib/typescript/social/features/user/CreateProfile/hooks/useCreateProfile.d.ts.map +1 -0
- package/lib/typescript/social/features/user/CreateProfile/index.d.ts +3 -0
- package/lib/typescript/social/features/user/CreateProfile/index.d.ts.map +1 -0
- package/lib/typescript/social/features/user/CreateProfile/styles.d.ts +28 -0
- package/lib/typescript/social/features/user/CreateProfile/styles.d.ts.map +1 -0
- package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts.map +1 -1
- package/lib/typescript/social/hooks/index.d.ts +1 -0
- package/lib/typescript/social/hooks/index.d.ts.map +1 -1
- package/lib/typescript/social/hooks/useGlobalBehavior.d.ts +23 -0
- package/lib/typescript/social/hooks/useGlobalBehavior.d.ts.map +1 -0
- package/lib/typescript/social/hooks/usePostPermission.d.ts.map +1 -1
- package/lib/typescript/social/hooks/useStoryPermission.d.ts.map +1 -1
- package/lib/typescript/social/index.d.ts +2 -1
- package/lib/typescript/social/index.d.ts.map +1 -1
- package/lib/typescript/social/providers/BehaviourProvider.d.ts.map +1 -1
- package/lib/typescript/social/screens/CreateUserProfile/CreateUserProfile.d.ts +7 -0
- package/lib/typescript/social/screens/CreateUserProfile/CreateUserProfile.d.ts.map +1 -0
- package/lib/typescript/social/screens/CreateUserProfile/index.d.ts +3 -0
- package/lib/typescript/social/screens/CreateUserProfile/index.d.ts.map +1 -0
- 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/lib/typescript/social/screens/VisitorUsageLimit/styles.d.ts +38 -0
- package/lib/typescript/social/screens/VisitorUsageLimit/styles.d.ts.map +1 -0
- package/lib/typescript/social/screens/index.d.ts +1 -0
- package/lib/typescript/social/screens/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/core/assets/icons/index.ts +1 -0
- package/src/core/assets/icons/visitorLimit.tsx +23 -0
- package/src/core/constants/index.ts +12 -0
- package/src/core/hooks/useAuth.ts +4 -0
- package/src/core/providers/AmityUIKitProvider.tsx +2 -1
- package/src/core/providers/AuthProvider.tsx +41 -12
- package/src/core/routes/AmityPageRenderer.tsx +11 -0
- package/src/core/routes/AmityUIKitNavigator.tsx +38 -1
- package/src/core/routes/RouteParamList.tsx +4 -0
- package/src/core/types/auth.ts +2 -0
- package/src/core/types/behaviour.ts +18 -0
- package/src/index.tsx +4 -0
- package/src/social/components/Social/CommentList/CommentList.tsx +5 -1
- package/src/social/components/Social/CommentListItem/CommentListItem.tsx +19 -12
- package/src/social/components/legacy/Social/ReplyCommentList/index.tsx +17 -11
- package/src/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +10 -2
- package/src/social/enums/enumUIKitID.ts +2 -0
- package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx +22 -16
- package/src/social/features/comment/components/PostComment/ReplyCommentList/index.tsx +17 -11
- package/src/social/features/feed/components/TopNavigation/TopNavigation.tsx +3 -1
- package/src/social/features/post/Detail/index.tsx +6 -2
- package/src/social/features/post/components/Content/Content.tsx +7 -4
- package/src/social/features/post/components/EngagementActions/Components/DetailStyle.tsx +7 -2
- package/src/social/features/post/components/EngagementActions/Components/FeedStyle.tsx +7 -2
- package/src/social/features/user/CreateProfile/CreateProfile.tsx +121 -0
- package/src/social/features/user/CreateProfile/components/ImageUpload/ImageUpload.tsx +85 -0
- package/src/social/features/user/CreateProfile/components/ImageUpload/index.ts +1 -0
- package/src/social/features/user/CreateProfile/components/ImageUpload/styles.ts +44 -0
- package/src/social/features/user/CreateProfile/components/TopBar/TopBar.tsx +30 -0
- package/src/social/features/user/CreateProfile/components/TopBar/index.ts +1 -0
- package/src/social/features/user/CreateProfile/components/TopBar/styles.ts +30 -0
- package/src/social/features/user/CreateProfile/components/index.ts +2 -0
- package/src/social/features/user/CreateProfile/hooks/index.ts +1 -0
- package/src/social/features/user/CreateProfile/hooks/useCreateProfile.ts +186 -0
- package/src/social/features/user/CreateProfile/index.ts +2 -0
- package/src/social/features/user/CreateProfile/styles.ts +33 -0
- package/src/social/features/user/Profile/components/Header/hooks/useHeader.ts +5 -2
- package/src/social/hooks/index.ts +1 -0
- package/src/social/hooks/useGlobalBehavior.ts +39 -0
- package/src/social/hooks/usePostPermission.ts +3 -1
- package/src/social/hooks/useStoryPermission.ts +8 -6
- package/src/social/index.tsx +2 -0
- package/src/social/providers/BehaviourProvider.tsx +1 -0
- package/src/social/screens/CreateUserProfile/CreateUserProfile.tsx +19 -0
- package/src/social/screens/CreateUserProfile/index.ts +2 -0
- package/src/social/screens/SocialHomePage/index.tsx +36 -13
- package/src/social/screens/VisitorUsageLimit/VisitorUsageLimit.tsx +78 -0
- package/src/social/screens/VisitorUsageLimit/index.ts +1 -0
- package/src/social/screens/VisitorUsageLimit/styles.ts +43 -0
- package/src/social/screens/index.ts +1 -0
- package/uikit.config.json +17 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { MyMD3Theme } from '../../../core/providers/AmityUIKitProvider';
|
|
2
|
+
export declare const useStyles: () => {
|
|
3
|
+
styles: {
|
|
4
|
+
container: {
|
|
5
|
+
flex: number;
|
|
6
|
+
backgroundColor: string;
|
|
7
|
+
};
|
|
8
|
+
contentContainer: {
|
|
9
|
+
flex: number;
|
|
10
|
+
alignItems: "center";
|
|
11
|
+
paddingHorizontal: number;
|
|
12
|
+
flexDirection: "column";
|
|
13
|
+
justifyContent: "center";
|
|
14
|
+
};
|
|
15
|
+
icon: {
|
|
16
|
+
marginBottom: number;
|
|
17
|
+
};
|
|
18
|
+
title: {
|
|
19
|
+
textAlign: "center";
|
|
20
|
+
color: string;
|
|
21
|
+
};
|
|
22
|
+
subtitle: {
|
|
23
|
+
textAlign: "center";
|
|
24
|
+
color: string;
|
|
25
|
+
};
|
|
26
|
+
signInButton: {
|
|
27
|
+
marginTop: number;
|
|
28
|
+
borderRadius: number;
|
|
29
|
+
paddingVertical: number;
|
|
30
|
+
paddingHorizontal: number;
|
|
31
|
+
};
|
|
32
|
+
signInText: {
|
|
33
|
+
color: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
theme: MyMD3Theme;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../src/social/screens/VisitorUsageLimit/styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAE7E,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/social/screens/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/social/screens/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amityco/react-native-social-uikit",
|
|
3
|
-
"version": "4.0.0",
|
|
3
|
+
"version": "4.0.1-324acbfd.0",
|
|
4
4
|
"description": "Social UIKit",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"registry": "https://registry.npmjs.org/"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@amityco/ts-sdk-react-native": "7.
|
|
60
|
+
"@amityco/ts-sdk-react-native": "7.22.1-f15e84ea.0",
|
|
61
61
|
"@babel/plugin-transform-export-namespace-from": "^7.27.1",
|
|
62
62
|
"@commitlint/config-conventional": "^17.0.2",
|
|
63
63
|
"@evilmartians/lefthook": "^1.2.2",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"@types/react": "^19.1.0"
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
122
|
-
"@amityco/ts-sdk-react-native": "7.
|
|
122
|
+
"@amityco/ts-sdk-react-native": "7.22.1-f15e84ea.0",
|
|
123
123
|
"@livekit/react-native": "^2.9.6",
|
|
124
124
|
"@livekit/react-native-webrtc": "^137.0.2",
|
|
125
125
|
"@react-native-async-storage/async-storage": "^1.19.3",
|
|
@@ -34,6 +34,7 @@ export { default as pause } from './pause';
|
|
|
34
34
|
export { default as resume } from './resume';
|
|
35
35
|
export { default as terminated } from './terminated';
|
|
36
36
|
export { default as warning } from './warning';
|
|
37
|
+
export { default as visitorLimit } from './visitorLimit';
|
|
37
38
|
export { default as ban } from './ban';
|
|
38
39
|
export { default as arrowLeft } from './arrowLeft';
|
|
39
40
|
export { default as poll } from './poll';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const icon = () => `<svg
|
|
2
|
+
width="100%"
|
|
3
|
+
height="100%"
|
|
4
|
+
viewBox="0 0 61 42"
|
|
5
|
+
fill="none"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
8
|
+
<path
|
|
9
|
+
d="M58.3438 0.75C59.7148 0.75 60.875 1.91016 60.875 3.28125V38.7188C60.875 40.1953 59.7148 41.25 58.3438 41.25H5.1875C2.33984 41.25 0.125 39.0352 0.125 36.1875V6.65625C0.125 5.28516 1.17969 4.125 2.65625 4.125H6.875V3.28125C6.875 1.91016 7.92969 0.75 9.40625 0.75H58.3438ZM3.5 36.1875C3.5 37.1367 4.23828 37.875 5.1875 37.875C6.03125 37.875 6.875 37.1367 6.875 36.1875V7.5H3.5V36.1875ZM57.5 37.875V4.125H10.25V36.1875V36.293C10.25 36.7148 10.0391 37.4531 9.93359 37.875H57.5Z"
|
|
10
|
+
fill="currentColor"
|
|
11
|
+
/>
|
|
12
|
+
<path
|
|
13
|
+
d="M34.5 13C34.5 12.4477 34.9477 12 35.5 12C36.0523 12 36.5 12.4477 36.5 13V23C36.5 23.5523 36.0523 24 35.5 24C34.9477 24 34.5 23.5523 34.5 23V13Z"
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
d="M35.5 25.75C36.4665 25.75 37.25 26.5335 37.25 27.5C37.25 28.4665 36.4665 29.25 35.5 29.25C34.5335 29.25 33.75 28.4665 33.75 27.5C33.75 26.5335 34.5335 25.75 35.5 25.75Z"
|
|
18
|
+
fill="currentColor"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
export default icon;
|
|
@@ -88,11 +88,23 @@ export const ERROR_CODE = {
|
|
|
88
88
|
ONLY_ONE_MODERATOR: '400317',
|
|
89
89
|
ONLY_ONE_MEMBER: '400318',
|
|
90
90
|
GLOBAL_BAN: '400312',
|
|
91
|
+
VISITOR_USAGE_LIMIT_EXCEEDED: '400323',
|
|
91
92
|
INVALID_IMAGE:
|
|
92
93
|
'Amity SDK (500000): Image uploading failed: Request has invalid image format',
|
|
93
94
|
DISPLAY_NAME_UPDATE: '400301',
|
|
94
95
|
};
|
|
95
96
|
|
|
97
|
+
export const VISITOR_USAGE_LIMIT_MESSAGE = {
|
|
98
|
+
TITLE: "You've reached your daily limit.",
|
|
99
|
+
SUBTITLE: 'Create an account or sign in to keep exploring the community.',
|
|
100
|
+
SIGN_IN: 'Sign in',
|
|
101
|
+
TOAST: 'Create an account or sign in to continue.',
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// Web parity: amity_social_label_create_account_or_sign_in
|
|
105
|
+
export const VISITOR_USER_ACTION_TOAST =
|
|
106
|
+
'Create an account or sign in to continue.';
|
|
107
|
+
|
|
96
108
|
export const COMMENT_ERROR_MESSAGE = {
|
|
97
109
|
BLOCKED_WORD:
|
|
98
110
|
'Your comment contains inappropriate word. Please review and delete it.',
|
|
@@ -14,6 +14,8 @@ const useAuth = (): AuthContextInterface => {
|
|
|
14
14
|
sessionState,
|
|
15
15
|
apiRegion,
|
|
16
16
|
isGlobalBan,
|
|
17
|
+
isVisitorUsageLimitReached,
|
|
18
|
+
isVisitorOrBot,
|
|
17
19
|
} = useContext(AuthContext);
|
|
18
20
|
|
|
19
21
|
return {
|
|
@@ -26,6 +28,8 @@ const useAuth = (): AuthContextInterface => {
|
|
|
26
28
|
sessionState,
|
|
27
29
|
apiRegion,
|
|
28
30
|
isGlobalBan,
|
|
31
|
+
isVisitorUsageLimitReached,
|
|
32
|
+
isVisitorOrBot,
|
|
29
33
|
};
|
|
30
34
|
};
|
|
31
35
|
|
|
@@ -21,7 +21,8 @@ import { ErrorBoundary } from '../components/ErrorBoundary';
|
|
|
21
21
|
|
|
22
22
|
export type CusTomTheme = typeof DefaultTheme;
|
|
23
23
|
export interface IAmityUIkitProvider {
|
|
24
|
-
|
|
24
|
+
/** Omit to connect as a visitor (read-only session). */
|
|
25
|
+
userId?: string;
|
|
25
26
|
displayName?: string;
|
|
26
27
|
apiKey: string;
|
|
27
28
|
apiRegion?: string;
|
|
@@ -24,6 +24,8 @@ export const AuthContext = createContext<AuthContextInterface>({
|
|
|
24
24
|
authToken: '',
|
|
25
25
|
fcmToken: undefined,
|
|
26
26
|
isGlobalBan: false,
|
|
27
|
+
isVisitorUsageLimitReached: false,
|
|
28
|
+
isVisitorOrBot: false,
|
|
27
29
|
});
|
|
28
30
|
|
|
29
31
|
export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
|
|
@@ -44,6 +46,9 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
|
|
|
44
46
|
apiEndpoint: { http: apiEndpoint },
|
|
45
47
|
});
|
|
46
48
|
const [isGlobalBan, setIsGlobalBan] = useState(false);
|
|
49
|
+
const [isVisitorUsageLimitReached, setIsVisitorUsageLimitReached] =
|
|
50
|
+
useState(false);
|
|
51
|
+
const [isVisitorOrBot, setIsVisitorOrBot] = useState(false);
|
|
47
52
|
|
|
48
53
|
const sessionHandler: Amity.SessionHandler = {
|
|
49
54
|
sessionWillRenewAccessToken(renewal) {
|
|
@@ -64,22 +69,39 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
|
|
|
64
69
|
if (sessionState === 'established') {
|
|
65
70
|
setIsConnected(true);
|
|
66
71
|
onSdkReady();
|
|
72
|
+
// Same check as the Web UIKit's isVisitorOrBot in SDKProvider
|
|
73
|
+
setIsVisitorOrBot(Client.getCurrentUserType() !== 'signed-in');
|
|
67
74
|
}
|
|
68
75
|
}, [sessionState]);
|
|
69
76
|
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
// SDK emits this (throttled, 2s window) when a visitor/bot session gets
|
|
79
|
+
// error 400323 — daily usage limit exceeded. The session stays alive, so
|
|
80
|
+
// this is tracked separately from isGlobalBan. In-memory only: the flag
|
|
81
|
+
// resets when the provider remounts or the user signs in with a userId.
|
|
82
|
+
return Client.onVisitorUsageLimitReached(() => {
|
|
83
|
+
setIsVisitorUsageLimitReached(true);
|
|
84
|
+
});
|
|
85
|
+
}, []);
|
|
72
86
|
|
|
73
|
-
|
|
74
|
-
userId: userId,
|
|
75
|
-
displayName: displayName,
|
|
76
|
-
};
|
|
77
|
-
if (authToken?.length > 0) {
|
|
78
|
-
loginParam = { ...loginParam, authToken: authToken };
|
|
79
|
-
}
|
|
87
|
+
const handleConnect = useCallback(async () => {
|
|
80
88
|
try {
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
if (userId) {
|
|
90
|
+
let loginParam: Amity.ConnectClientParams = {
|
|
91
|
+
userId: userId,
|
|
92
|
+
displayName: displayName,
|
|
93
|
+
};
|
|
94
|
+
if (authToken?.length > 0) {
|
|
95
|
+
loginParam = { ...loginParam, authToken: authToken };
|
|
96
|
+
}
|
|
97
|
+
const response = await Client.login(loginParam, sessionHandler);
|
|
98
|
+
if (!response) return;
|
|
99
|
+
} else {
|
|
100
|
+
// No userId — connect as a visitor (read-only session, same
|
|
101
|
+
// convention as the Web UIKit's registerDevice without userId)
|
|
102
|
+
const response = await Client.loginAsVisitor({ sessionHandler });
|
|
103
|
+
if (!response) return;
|
|
104
|
+
}
|
|
83
105
|
} catch (err) {
|
|
84
106
|
if (err?.message?.includes(ERROR_CODE.GLOBAL_BAN)) {
|
|
85
107
|
setIsGlobalBan(true);
|
|
@@ -93,7 +115,11 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
|
|
|
93
115
|
console.log(err);
|
|
94
116
|
}
|
|
95
117
|
}
|
|
96
|
-
|
|
118
|
+
// Depend on userId (and the other login params) so that when the host
|
|
119
|
+
// switches a visitor session to a signed-in one by passing a userId, this
|
|
120
|
+
// callback re-reads the new value and calls Client.login instead of
|
|
121
|
+
// re-using the stale (undefined) userId and re-connecting as a visitor.
|
|
122
|
+
}, [userId, displayName, authToken, fcmToken]);
|
|
97
123
|
|
|
98
124
|
const login = async () => {
|
|
99
125
|
setError('');
|
|
@@ -111,6 +137,7 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
|
|
|
111
137
|
}
|
|
112
138
|
};
|
|
113
139
|
useEffect(() => {
|
|
140
|
+
setIsVisitorUsageLimitReached(false);
|
|
114
141
|
login();
|
|
115
142
|
}, [userId]);
|
|
116
143
|
|
|
@@ -138,6 +165,8 @@ export const AuthContextProvider: FC<IAmityUIkitProvider> = ({
|
|
|
138
165
|
sessionState,
|
|
139
166
|
apiRegion: apiRegion.toLowerCase(),
|
|
140
167
|
isGlobalBan,
|
|
168
|
+
isVisitorUsageLimitReached,
|
|
169
|
+
isVisitorOrBot,
|
|
141
170
|
}}
|
|
142
171
|
>
|
|
143
172
|
{children}
|
|
@@ -22,6 +22,7 @@ import { useTheme } from 'react-native-paper';
|
|
|
22
22
|
import PostTypeChoiceModal from '../../social/components/legacy/PostTypeChoiceModal/PostTypeChoiceModal';
|
|
23
23
|
import CreateStoryScreen from '../../social/screens/CreateStory/CreateStoryScreen';
|
|
24
24
|
import Toast from '../../social/components/legacy/Toast/Toast';
|
|
25
|
+
import SnackbarToast from '../../social/components/Toast';
|
|
25
26
|
import AmitySocialGlobalSearchPage from '../../social/screens/SocialGlobalSearch';
|
|
26
27
|
import AmityMyCommunitiesSearchPage from '../../social/screens/MyCommunitiesSearch';
|
|
27
28
|
import PostTargetSelection from '../../social/screens/PostTargetSelection';
|
|
@@ -91,6 +92,13 @@ export default function PageRenderer({ children }: PageRendererProps) {
|
|
|
91
92
|
name="AmityPostEngagementContentComponent"
|
|
92
93
|
children={() => children}
|
|
93
94
|
/>
|
|
95
|
+
{/* Prop-driven page (e.g. AmityCreateProfilePage) rendered directly
|
|
96
|
+
by the host. The component's displayName resolves to this route
|
|
97
|
+
so it can be the navigator's initialRouteName. */}
|
|
98
|
+
<Stack.Screen
|
|
99
|
+
name="AmityCreateUserProfilePage"
|
|
100
|
+
children={() => children}
|
|
101
|
+
/>
|
|
94
102
|
|
|
95
103
|
{/* --- Social Home --- */}
|
|
96
104
|
<Stack.Screen
|
|
@@ -251,6 +259,9 @@ export default function PageRenderer({ children }: PageRendererProps) {
|
|
|
251
259
|
)}
|
|
252
260
|
<PostTypeChoiceModal />
|
|
253
261
|
<Toast />
|
|
262
|
+
{/* Redux toastSlice renderer (useToast). The legacy Toast above reads a
|
|
263
|
+
different slice (state.ui), so pages using useToast need this. */}
|
|
264
|
+
<SnackbarToast />
|
|
254
265
|
</NavigationContainer>
|
|
255
266
|
</NavigationIndependentTree>
|
|
256
267
|
);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
NavigationContainer,
|
|
3
4
|
NavigationIndependentTree,
|
|
4
5
|
} from '@react-navigation/native';
|
|
6
|
+
import { View } from 'react-native';
|
|
5
7
|
import { navigationRef, onNavigationReady } from './navigation';
|
|
6
8
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
7
9
|
import type { RootStackParamList } from './RouteParamList';
|
|
@@ -43,6 +45,8 @@ import { CommunityStoriesNotificationSettingScreen } from '../../social/screens/
|
|
|
43
45
|
import { CommunityLivestreamsNotificationSettingScreen } from '../../social/screens/CommunityLivestreamsNotificationSetting';
|
|
44
46
|
import CommunityPendingRequest from '../../social/screens/CommunityPendingRequest';
|
|
45
47
|
import { GlobalBan } from '../../social/screens/GlobalBan';
|
|
48
|
+
import { VisitorUsageLimit } from '../../social/screens/VisitorUsageLimit';
|
|
49
|
+
import { useBehaviour } from '../../social/providers/BehaviourProvider';
|
|
46
50
|
import {
|
|
47
51
|
ImageViewerScreen,
|
|
48
52
|
VideoPlayerScreen,
|
|
@@ -60,10 +64,43 @@ const Stack = createNativeStackNavigator<
|
|
|
60
64
|
|
|
61
65
|
export default function AmitySocialUIKitV4Navigator() {
|
|
62
66
|
const theme = useTheme<MyMD3Theme>();
|
|
63
|
-
const { isGlobalBan } = useAuth();
|
|
67
|
+
const { isGlobalBan, isVisitorUsageLimitReached, isConnected } = useAuth();
|
|
68
|
+
const { AmityGlobalBehavior } = useBehaviour();
|
|
69
|
+
|
|
70
|
+
const handleVisitorUsageLimitReached =
|
|
71
|
+
AmityGlobalBehavior?.handleVisitorUsageLimitReached;
|
|
72
|
+
const hasHandledUsageLimit = useRef(false);
|
|
73
|
+
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (!isVisitorUsageLimitReached) {
|
|
76
|
+
hasHandledUsageLimit.current = false;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// Customer override replaces the default full-page swap; guard so rapid
|
|
80
|
+
// repeat events trigger a single navigation.
|
|
81
|
+
if (handleVisitorUsageLimitReached && !hasHandledUsageLimit.current) {
|
|
82
|
+
hasHandledUsageLimit.current = true;
|
|
83
|
+
handleVisitorUsageLimitReached();
|
|
84
|
+
}
|
|
85
|
+
}, [isVisitorUsageLimitReached, handleVisitorUsageLimitReached]);
|
|
64
86
|
|
|
65
87
|
if (isGlobalBan) return <GlobalBan />;
|
|
66
88
|
|
|
89
|
+
// Wait for the session to establish before mounting the home page. Until then
|
|
90
|
+
// isVisitorOrBot is unknown (defaults to false), so rendering now would flash
|
|
91
|
+
// the full signed-in UIKit for a frame before resolving to visitor mode.
|
|
92
|
+
if (!isConnected) {
|
|
93
|
+
return (
|
|
94
|
+
<View style={{ flex: 1, backgroundColor: theme.colors.background }} />
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Default usage-limit handling: replace the whole navigation tree with the
|
|
99
|
+
// dead-end error page so back-navigation cannot escape it.
|
|
100
|
+
if (isVisitorUsageLimitReached && !handleVisitorUsageLimitReached) {
|
|
101
|
+
return <VisitorUsageLimit />;
|
|
102
|
+
}
|
|
103
|
+
|
|
67
104
|
return (
|
|
68
105
|
<NavigationIndependentTree>
|
|
69
106
|
<NavigationContainer ref={navigationRef} onReady={onNavigationReady}>
|
|
@@ -140,6 +140,10 @@ export type RootStackParamList = {
|
|
|
140
140
|
userId: string;
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
+
// Prop-driven page rendered via AmityPageRenderer (no route params). The
|
|
144
|
+
// route only exists so the renderer can register a pass-through screen.
|
|
145
|
+
AmityCreateUserProfilePage: undefined;
|
|
146
|
+
|
|
143
147
|
UserRelationship: {
|
|
144
148
|
userId: string;
|
|
145
149
|
selectedTab?: UserRelationshipTab;
|
package/src/core/types/auth.ts
CHANGED
|
@@ -17,6 +17,24 @@ export type CommunitySettingPageContext = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export interface IBehaviour {
|
|
20
|
+
AmityGlobalBehavior?: {
|
|
21
|
+
/**
|
|
22
|
+
* Called when a visitor attempts a restricted action (comment, react,
|
|
23
|
+
* follow, join…). Default shows a toast; override to open a sign-in flow.
|
|
24
|
+
*/
|
|
25
|
+
handleVisitorUserAction?: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Called when a visitor session exceeds its daily usage limit (error
|
|
28
|
+
* 400323). Providing this skips the default full-page
|
|
29
|
+
* <VisitorUsageLimit /> swap so a custom error page can be shown instead.
|
|
30
|
+
*/
|
|
31
|
+
handleVisitorUsageLimitReached?: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Called when "Sign in" is pressed on the usage-limit error page.
|
|
34
|
+
* Default shows a toast; override to navigate to a sign-in flow.
|
|
35
|
+
*/
|
|
36
|
+
handleVisitorUsageLimitSignIn?: () => void;
|
|
37
|
+
};
|
|
20
38
|
AmitySocialHomePageBehaviour?: {
|
|
21
39
|
onChooseTab?: (arg?: string) => void;
|
|
22
40
|
};
|
package/src/index.tsx
CHANGED
|
@@ -73,8 +73,10 @@ import {
|
|
|
73
73
|
PostDetail,
|
|
74
74
|
AmityUserProfilePage,
|
|
75
75
|
AmityEditUserProfilePage,
|
|
76
|
+
AmityCreateProfilePage,
|
|
76
77
|
AmityUserRelationshipPage,
|
|
77
78
|
AmityBlockedUsersPage,
|
|
79
|
+
VisitorUsageLimit,
|
|
78
80
|
} from './social';
|
|
79
81
|
|
|
80
82
|
// Polyfill for BackHandler compatibility with older libraries like react-native-modalbox
|
|
@@ -106,6 +108,7 @@ export {
|
|
|
106
108
|
AmityUiKitProvider,
|
|
107
109
|
ErrorBoundary,
|
|
108
110
|
AmityUiKitSocial,
|
|
111
|
+
VisitorUsageLimit,
|
|
109
112
|
AmityStoryTabComponent,
|
|
110
113
|
AmityStoryTabComponentEnum,
|
|
111
114
|
AmityCreateStoryPage,
|
|
@@ -141,6 +144,7 @@ export {
|
|
|
141
144
|
PostDetail,
|
|
142
145
|
AmityUserProfilePage,
|
|
143
146
|
AmityEditUserProfilePage,
|
|
147
|
+
AmityCreateProfilePage,
|
|
144
148
|
AmityUserRelationshipPage,
|
|
145
149
|
AmityBlockedUsersPage,
|
|
146
150
|
AmityAllCategoriesPage,
|
|
@@ -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,9 @@ const CommentList: FC<ICommentListProp> = ({
|
|
|
68
69
|
withAvatar,
|
|
69
70
|
disabledComment,
|
|
70
71
|
}) => {
|
|
72
|
+
// Web parity: visitors never see the comment composer
|
|
73
|
+
const { isVisitorOrBot } = useAuth();
|
|
74
|
+
const hideComposer = disabledInteraction || isVisitorOrBot;
|
|
71
75
|
const styles = useStyles();
|
|
72
76
|
const theme = useTheme() as MyMD3Theme;
|
|
73
77
|
const onNextPageRef = useRef<() => void | null>(null);
|
|
@@ -284,7 +288,7 @@ const CommentList: FC<ICommentListProp> = ({
|
|
|
284
288
|
</TouchableOpacity>
|
|
285
289
|
</View>
|
|
286
290
|
)}
|
|
287
|
-
{!
|
|
291
|
+
{!hideComposer &&
|
|
288
292
|
(disabledComment ? (
|
|
289
293
|
<View style={styles.disabledCommentWrap}>
|
|
290
294
|
<SvgXml
|
|
@@ -44,6 +44,7 @@ import ReplyCommentList from '../../legacy/Social/ReplyCommentList';
|
|
|
44
44
|
import AmityReactionListComponent from '../../../features/reaction/components/List';
|
|
45
45
|
import { CommentRepository } from '@amityco/ts-sdk-react-native';
|
|
46
46
|
import { useTimeDifference } from '../../../hooks/useTimeDifference';
|
|
47
|
+
import { useGlobalBehavior } from '../../../hooks/useGlobalBehavior';
|
|
47
48
|
import { LinkPreview } from '../../PreviewLink';
|
|
48
49
|
import { Typography } from '../../../../core/components/Typography/Typography';
|
|
49
50
|
import { pen, report, trash, unreport } from '../../../../core/assets/icons';
|
|
@@ -290,6 +291,13 @@ const CommentListItem = ({
|
|
|
290
291
|
onClickReply && onClickReply(user, commentId);
|
|
291
292
|
};
|
|
292
293
|
|
|
294
|
+
// Web parity: visitors see Like/Reply but taps show the sign-in toast
|
|
295
|
+
const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
|
|
296
|
+
const onPressLike = () =>
|
|
297
|
+
handleGlobalBehavior({ defaultBehavior: addReactionToComment });
|
|
298
|
+
const onPressReply = () =>
|
|
299
|
+
handleGlobalBehavior({ defaultBehavior: onHandleReply });
|
|
300
|
+
|
|
293
301
|
const onPressCommentReaction = () => {
|
|
294
302
|
setIsReactionListVisible(true);
|
|
295
303
|
};
|
|
@@ -348,10 +356,7 @@ const CommentListItem = ({
|
|
|
348
356
|
</Typography.Caption>
|
|
349
357
|
)}
|
|
350
358
|
</View>
|
|
351
|
-
<TouchableOpacity
|
|
352
|
-
onPress={() => addReactionToComment()}
|
|
353
|
-
style={styles.likeBtn}
|
|
354
|
-
>
|
|
359
|
+
<TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
|
|
355
360
|
<Typography.CaptionBold
|
|
356
361
|
style={isLike ? styles.likedText : styles.btnText}
|
|
357
362
|
>
|
|
@@ -359,20 +364,22 @@ const CommentListItem = ({
|
|
|
359
364
|
</Typography.CaptionBold>
|
|
360
365
|
</TouchableOpacity>
|
|
361
366
|
<TouchableOpacity
|
|
362
|
-
onPress={disabledComment ? undefined :
|
|
367
|
+
onPress={disabledComment ? undefined : onPressReply}
|
|
363
368
|
style={styles.likeBtn}
|
|
364
369
|
>
|
|
365
370
|
<Typography.CaptionBold style={styles.btnText}>
|
|
366
371
|
Reply
|
|
367
372
|
</Typography.CaptionBold>
|
|
368
373
|
</TouchableOpacity>
|
|
369
|
-
|
|
370
|
-
<
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
{!isVisitorOrBot && (
|
|
375
|
+
<TouchableOpacity onPress={openModal}>
|
|
376
|
+
<SvgXml
|
|
377
|
+
xml={threeDots(theme.colors.baseShade2)}
|
|
378
|
+
width="20"
|
|
379
|
+
height="20"
|
|
380
|
+
/>
|
|
381
|
+
</TouchableOpacity>
|
|
382
|
+
)}
|
|
376
383
|
</View>
|
|
377
384
|
|
|
378
385
|
{likeReaction > 0 && (
|
|
@@ -44,6 +44,7 @@ import { useNavigation } from '@react-navigation/native';
|
|
|
44
44
|
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
45
45
|
import { RootStackParamList } from '../../../../../core/routes/RouteParamList';
|
|
46
46
|
import { useTimeDifference } from '../../../../hooks';
|
|
47
|
+
import { useGlobalBehavior } from '../../../../hooks/useGlobalBehavior';
|
|
47
48
|
import { useToast } from '../../../../../core/stores/slices/toastSlice';
|
|
48
49
|
import AmityReactionListComponent from '../../../../features/reaction/components/List';
|
|
49
50
|
|
|
@@ -155,6 +156,12 @@ export default function ReplyCommentList({
|
|
|
155
156
|
await addCommentReaction(commentId, 'like');
|
|
156
157
|
}
|
|
157
158
|
};
|
|
159
|
+
|
|
160
|
+
// Web parity: visitors see Like but taps show the sign-in toast
|
|
161
|
+
const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
|
|
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
|
{
|
|
@@ -267,10 +274,7 @@ export default function ReplyCommentList({
|
|
|
267
274
|
</Typography.Caption>
|
|
268
275
|
)}
|
|
269
276
|
</View>
|
|
270
|
-
<TouchableOpacity
|
|
271
|
-
onPress={() => addReactionToComment()}
|
|
272
|
-
style={styles.likeBtn}
|
|
273
|
-
>
|
|
277
|
+
<TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
|
|
274
278
|
<Typography.CaptionBold
|
|
275
279
|
style={isLike ? styles.likedText : styles.btnText}
|
|
276
280
|
>
|
|
@@ -278,13 +282,15 @@ export default function ReplyCommentList({
|
|
|
278
282
|
</Typography.CaptionBold>
|
|
279
283
|
</TouchableOpacity>
|
|
280
284
|
|
|
281
|
-
|
|
282
|
-
<
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
285
|
+
{!isVisitorOrBot && (
|
|
286
|
+
<TouchableOpacity onPress={openModal} style={styles.threeDots}>
|
|
287
|
+
<SvgXml
|
|
288
|
+
xml={threeDots(theme.colors.base)}
|
|
289
|
+
width="20"
|
|
290
|
+
height="16"
|
|
291
|
+
/>
|
|
292
|
+
</TouchableOpacity>
|
|
293
|
+
)}
|
|
288
294
|
</View>
|
|
289
295
|
{likeReaction > 0 && (
|
|
290
296
|
<TouchableOpacity
|
|
@@ -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;
|
|
@@ -24,6 +24,7 @@ export enum PageID {
|
|
|
24
24
|
pending_request_page = 'pending_request_page',
|
|
25
25
|
user_profile_page = 'user_profile_page',
|
|
26
26
|
edit_user_profile_page = 'edit_user_profile_page',
|
|
27
|
+
create_user_profile_page = 'create_user_profile_page',
|
|
27
28
|
blocked_users_page = 'blocked_users_page',
|
|
28
29
|
user_relationship_page = 'user_relationship_page',
|
|
29
30
|
user_pending_follow_request_page = 'user_pending_follow_request_page',
|
|
@@ -204,6 +205,7 @@ export enum ElementID {
|
|
|
204
205
|
user_display_name_title = 'user_display_name_title',
|
|
205
206
|
user_about_title = 'user_about_title',
|
|
206
207
|
update_user_profile_button = 'update_user_profile_button',
|
|
208
|
+
create_user_profile_button = 'create_user_profile_button',
|
|
207
209
|
unblock_user_button = 'unblock_user_button',
|
|
208
210
|
follow_user_button = 'follow_user_button',
|
|
209
211
|
following_user_button = 'following_user_button',
|