@amityco/react-native-social-uikit 4.0.2-bfd939a.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 +10 -3
- package/lib/commonjs/core/providers/AmityUIKitProvider.js.map +1 -1
- package/lib/commonjs/core/providers/AuthProvider.js +44 -16
- package/lib/commonjs/core/providers/AuthProvider.js.map +1 -1
- package/lib/commonjs/core/routes/AmityUIKitNavigator.js +23 -1
- package/lib/commonjs/core/routes/AmityUIKitNavigator.js.map +1 -1
- package/lib/commonjs/social/components/PollContent/PollOption.js +12 -12
- package/lib/commonjs/social/components/PollContent/PollOption.js.map +1 -1
- package/lib/commonjs/social/components/PostMenu/index.js +9 -2
- package/lib/commonjs/social/components/PostMenu/index.js.map +1 -1
- package/lib/commonjs/social/components/Social/CommentList/CommentList.js +6 -1
- package/lib/commonjs/social/components/Social/CommentList/CommentList.js.map +1 -1
- package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js +24 -6
- package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/commonjs/social/components/Social/CommentListItem/styles.js +3 -2
- package/lib/commonjs/social/components/Social/CommentListItem/styles.js.map +1 -1
- package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js +14 -2
- package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
- package/lib/commonjs/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js +3 -1
- package/lib/commonjs/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js.map +1 -1
- package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +6 -1
- package/lib/commonjs/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
- package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +17 -3
- package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js +17 -3
- package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
- package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/styles.js +8 -0
- package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/styles.js.map +1 -1
- package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js +5 -1
- package/lib/commonjs/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
- package/lib/commonjs/social/features/livestream/Player/Player.js +9 -6
- package/lib/commonjs/social/features/livestream/Player/Player.js.map +1 -1
- package/lib/commonjs/social/features/post/Detail/index.js +6 -2
- package/lib/commonjs/social/features/post/Detail/index.js.map +1 -1
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js +16 -10
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js +17 -9
- package/lib/commonjs/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
- package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js +19 -21
- package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
- package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js +28 -19
- package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
- package/lib/commonjs/social/features/user/Profile/components/Header/styles.js +2 -0
- package/lib/commonjs/social/features/user/Profile/components/Header/styles.js.map +1 -1
- package/lib/commonjs/social/features/user/Profile/elements/Menu/hooks/useMenu.js +15 -4
- package/lib/commonjs/social/features/user/Profile/elements/Menu/hooks/useMenu.js.map +1 -1
- package/lib/commonjs/social/features/visitor/UsageLimit/UsageLimit.js +46 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/UsageLimit.js.map +1 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/hooks/index.js +13 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/hooks/index.js.map +1 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/hooks/useUsageLimit.js +54 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/hooks/useUsageLimit.js.map +1 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/index.js +13 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/index.js.map +1 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/styles.js +52 -0
- package/lib/commonjs/social/features/visitor/UsageLimit/styles.js.map +1 -0
- package/lib/commonjs/social/hooks/index.js +22 -0
- package/lib/commonjs/social/hooks/index.js.map +1 -1
- package/lib/commonjs/social/hooks/useGlobalBehavior.js +44 -0
- package/lib/commonjs/social/hooks/useGlobalBehavior.js.map +1 -0
- package/lib/commonjs/social/hooks/useInteractionBehavior.js +50 -0
- package/lib/commonjs/social/hooks/useInteractionBehavior.js.map +1 -0
- package/lib/commonjs/social/hooks/usePostPermission.js +4 -2
- package/lib/commonjs/social/hooks/usePostPermission.js.map +1 -1
- package/lib/commonjs/social/hooks/useStoryPermission.js +3 -2
- package/lib/commonjs/social/hooks/useStoryPermission.js.map +1 -1
- package/lib/commonjs/social/providers/BehaviourProvider.js +1 -0
- package/lib/commonjs/social/providers/BehaviourProvider.js.map +1 -1
- package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js +9 -2
- package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
- package/lib/commonjs/social/screens/SocialHomePage/index.js +23 -6
- package/lib/commonjs/social/screens/SocialHomePage/index.js.map +1 -1
- package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +11 -0
- package/lib/commonjs/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +1 -0
- package/lib/commonjs/social/screens/VisitorUsageLimit/index.js +13 -0
- package/lib/commonjs/social/screens/VisitorUsageLimit/index.js.map +1 -0
- package/lib/module/core/assets/icons/index.js +1 -0
- package/lib/module/core/assets/icons/index.js.map +1 -1
- package/lib/module/core/assets/icons/visitorLimit.js +19 -0
- package/lib/module/core/assets/icons/visitorLimit.js.map +1 -0
- package/lib/module/core/constants/index.js +10 -0
- package/lib/module/core/constants/index.js.map +1 -1
- package/lib/module/core/hooks/useAuth.js +6 -2
- package/lib/module/core/hooks/useAuth.js.map +1 -1
- package/lib/module/core/providers/AmityUIKitProvider.js +10 -3
- package/lib/module/core/providers/AmityUIKitProvider.js.map +1 -1
- package/lib/module/core/providers/AuthProvider.js +44 -16
- package/lib/module/core/providers/AuthProvider.js.map +1 -1
- package/lib/module/core/routes/AmityUIKitNavigator.js +23 -1
- package/lib/module/core/routes/AmityUIKitNavigator.js.map +1 -1
- package/lib/module/social/components/PollContent/PollOption.js +12 -12
- package/lib/module/social/components/PollContent/PollOption.js.map +1 -1
- package/lib/module/social/components/PostMenu/index.js +10 -3
- package/lib/module/social/components/PostMenu/index.js.map +1 -1
- package/lib/module/social/components/Social/CommentList/CommentList.js +6 -1
- package/lib/module/social/components/Social/CommentList/CommentList.js.map +1 -1
- package/lib/module/social/components/Social/CommentListItem/CommentListItem.js +24 -6
- package/lib/module/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/module/social/components/Social/CommentListItem/styles.js +3 -2
- package/lib/module/social/components/Social/CommentListItem/styles.js.map +1 -1
- package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js +14 -2
- package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
- package/lib/module/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js +3 -1
- package/lib/module/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js.map +1 -1
- package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js +7 -2
- package/lib/module/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.js.map +1 -1
- package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +18 -4
- package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js +17 -3
- package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
- package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/styles.js +8 -0
- package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/styles.js.map +1 -1
- package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js +5 -1
- package/lib/module/social/features/feed/components/TopNavigation/TopNavigation.js.map +1 -1
- package/lib/module/social/features/livestream/Player/Player.js +9 -6
- package/lib/module/social/features/livestream/Player/Player.js.map +1 -1
- package/lib/module/social/features/post/Detail/index.js +6 -2
- package/lib/module/social/features/post/Detail/index.js.map +1 -1
- package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js +17 -11
- package/lib/module/social/features/post/components/EngagementActions/Components/DetailStyle.js.map +1 -1
- package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js +18 -10
- package/lib/module/social/features/post/components/EngagementActions/Components/FeedStyle.js.map +1 -1
- package/lib/module/social/features/story/View/components/AmityViewStoryItem.js +20 -22
- package/lib/module/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
- package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js +29 -20
- package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
- package/lib/module/social/features/user/Profile/components/Header/styles.js +2 -0
- package/lib/module/social/features/user/Profile/components/Header/styles.js.map +1 -1
- package/lib/module/social/features/user/Profile/elements/Menu/hooks/useMenu.js +16 -4
- package/lib/module/social/features/user/Profile/elements/Menu/hooks/useMenu.js.map +1 -1
- package/lib/module/social/features/visitor/UsageLimit/UsageLimit.js +40 -0
- package/lib/module/social/features/visitor/UsageLimit/UsageLimit.js.map +1 -0
- package/lib/module/social/features/visitor/UsageLimit/hooks/index.js +2 -0
- package/lib/module/social/features/visitor/UsageLimit/hooks/index.js.map +1 -0
- package/lib/module/social/features/visitor/UsageLimit/hooks/useUsageLimit.js +47 -0
- package/lib/module/social/features/visitor/UsageLimit/hooks/useUsageLimit.js.map +1 -0
- package/lib/module/social/features/visitor/UsageLimit/index.js +2 -0
- package/lib/module/social/features/visitor/UsageLimit/index.js.map +1 -0
- package/lib/module/social/features/visitor/UsageLimit/styles.js +45 -0
- package/lib/module/social/features/visitor/UsageLimit/styles.js.map +1 -0
- package/lib/module/social/hooks/index.js +2 -0
- package/lib/module/social/hooks/index.js.map +1 -1
- package/lib/module/social/hooks/useGlobalBehavior.js +36 -0
- package/lib/module/social/hooks/useGlobalBehavior.js.map +1 -0
- package/lib/module/social/hooks/useInteractionBehavior.js +43 -0
- package/lib/module/social/hooks/useInteractionBehavior.js.map +1 -0
- package/lib/module/social/hooks/usePostPermission.js +4 -2
- package/lib/module/social/hooks/usePostPermission.js.map +1 -1
- package/lib/module/social/hooks/useStoryPermission.js +3 -2
- package/lib/module/social/hooks/useStoryPermission.js.map +1 -1
- package/lib/module/social/providers/BehaviourProvider.js +1 -0
- package/lib/module/social/providers/BehaviourProvider.js.map +1 -1
- package/lib/module/social/screens/CommunityProfile/components/Header/Header.js +10 -3
- package/lib/module/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
- package/lib/module/social/screens/SocialHomePage/index.js +25 -8
- package/lib/module/social/screens/SocialHomePage/index.js.map +1 -1
- package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js +5 -0
- package/lib/module/social/screens/VisitorUsageLimit/VisitorUsageLimit.js.map +1 -0
- package/lib/module/social/screens/VisitorUsageLimit/index.js +2 -0
- package/lib/module/social/screens/VisitorUsageLimit/index.js.map +1 -0
- package/lib/typescript/core/assets/icons/index.d.ts +1 -0
- package/lib/typescript/core/assets/icons/index.d.ts.map +1 -1
- package/lib/typescript/core/assets/icons/visitorLimit.d.ts +3 -0
- package/lib/typescript/core/assets/icons/visitorLimit.d.ts.map +1 -0
- package/lib/typescript/core/constants/index.d.ts +10 -0
- package/lib/typescript/core/constants/index.d.ts.map +1 -1
- package/lib/typescript/core/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/core/providers/AmityUIKitProvider.d.ts +7 -2
- package/lib/typescript/core/providers/AmityUIKitProvider.d.ts.map +1 -1
- package/lib/typescript/core/providers/AuthProvider.d.ts.map +1 -1
- package/lib/typescript/core/routes/AmityUIKitNavigator.d.ts.map +1 -1
- package/lib/typescript/core/types/auth.d.ts +2 -0
- package/lib/typescript/core/types/auth.d.ts.map +1 -1
- package/lib/typescript/core/types/behaviour.d.ts +6 -0
- package/lib/typescript/core/types/behaviour.d.ts.map +1 -1
- package/lib/typescript/social/components/PollContent/PollOption.d.ts.map +1 -1
- package/lib/typescript/social/components/PostMenu/index.d.ts.map +1 -1
- package/lib/typescript/social/components/Social/CommentList/CommentList.d.ts.map +1 -1
- package/lib/typescript/social/components/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
- package/lib/typescript/social/components/Social/CommentListItem/styles.d.ts +2 -1
- package/lib/typescript/social/components/Social/CommentListItem/styles.d.ts.map +1 -1
- package/lib/typescript/social/components/legacy/Social/ReplyCommentList/index.d.ts.map +1 -1
- package/lib/typescript/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.d.ts.map +1 -1
- package/lib/typescript/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.d.ts.map +1 -1
- package/lib/typescript/social/features/comment/components/PostComment/CommentListItem/CommentListItem.d.ts.map +1 -1
- package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/index.d.ts.map +1 -1
- package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/styles.d.ts +8 -0
- package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/styles.d.ts.map +1 -1
- package/lib/typescript/social/features/feed/components/TopNavigation/TopNavigation.d.ts.map +1 -1
- package/lib/typescript/social/features/livestream/Player/Player.d.ts.map +1 -1
- package/lib/typescript/social/features/post/Detail/index.d.ts.map +1 -1
- package/lib/typescript/social/features/post/components/EngagementActions/Components/DetailStyle.d.ts.map +1 -1
- package/lib/typescript/social/features/post/components/EngagementActions/Components/FeedStyle.d.ts.map +1 -1
- package/lib/typescript/social/features/story/View/components/AmityViewStoryItem.d.ts.map +1 -1
- package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts +2 -0
- package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts.map +1 -1
- package/lib/typescript/social/features/user/Profile/components/Header/styles.d.ts +2 -0
- package/lib/typescript/social/features/user/Profile/components/Header/styles.d.ts.map +1 -1
- package/lib/typescript/social/features/user/Profile/elements/Menu/hooks/useMenu.d.ts.map +1 -1
- package/lib/typescript/social/features/visitor/UsageLimit/UsageLimit.d.ts +2 -0
- package/lib/typescript/social/features/visitor/UsageLimit/UsageLimit.d.ts.map +1 -0
- package/lib/typescript/social/features/visitor/UsageLimit/hooks/index.d.ts +2 -0
- package/lib/typescript/social/features/visitor/UsageLimit/hooks/index.d.ts.map +1 -0
- package/lib/typescript/social/features/visitor/UsageLimit/hooks/useUsageLimit.d.ts +40 -0
- package/lib/typescript/social/features/visitor/UsageLimit/hooks/useUsageLimit.d.ts.map +1 -0
- package/lib/typescript/social/features/visitor/UsageLimit/index.d.ts +2 -0
- package/lib/typescript/social/features/visitor/UsageLimit/index.d.ts.map +1 -0
- package/lib/typescript/social/features/visitor/UsageLimit/styles.d.ts +40 -0
- package/lib/typescript/social/features/visitor/UsageLimit/styles.d.ts.map +1 -0
- package/lib/typescript/social/hooks/index.d.ts +2 -0
- package/lib/typescript/social/hooks/index.d.ts.map +1 -1
- package/lib/typescript/social/hooks/useGlobalBehavior.d.ts +16 -0
- package/lib/typescript/social/hooks/useGlobalBehavior.d.ts.map +1 -0
- package/lib/typescript/social/hooks/useInteractionBehavior.d.ts +11 -0
- package/lib/typescript/social/hooks/useInteractionBehavior.d.ts.map +1 -0
- package/lib/typescript/social/hooks/usePostPermission.d.ts.map +1 -1
- package/lib/typescript/social/hooks/useStoryPermission.d.ts.map +1 -1
- package/lib/typescript/social/providers/BehaviourProvider.d.ts.map +1 -1
- package/lib/typescript/social/screens/CommunityProfile/components/Header/Header.d.ts.map +1 -1
- package/lib/typescript/social/screens/SocialHomePage/index.d.ts.map +1 -1
- package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts +2 -0
- package/lib/typescript/social/screens/VisitorUsageLimit/VisitorUsageLimit.d.ts.map +1 -0
- package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts +2 -0
- package/lib/typescript/social/screens/VisitorUsageLimit/index.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/core/assets/icons/index.ts +1 -0
- package/src/core/assets/icons/visitorLimit.tsx +19 -0
- package/src/core/constants/index.ts +15 -0
- package/src/core/hooks/useAuth.ts +4 -0
- package/src/core/providers/AmityUIKitProvider.tsx +28 -3
- package/src/core/providers/AuthProvider.tsx +34 -11
- package/src/core/routes/AmityUIKitNavigator.tsx +26 -1
- package/src/core/types/auth.ts +2 -0
- package/src/core/types/behaviour.ts +6 -0
- package/src/social/components/PollContent/PollOption.tsx +13 -19
- package/src/social/components/PostMenu/index.tsx +6 -3
- package/src/social/components/Social/CommentList/CommentList.tsx +4 -1
- package/src/social/components/Social/CommentListItem/CommentListItem.tsx +69 -55
- package/src/social/components/Social/CommentListItem/styles.ts +2 -1
- package/src/social/components/legacy/Social/ReplyCommentList/index.tsx +15 -5
- package/src/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.tsx +7 -1
- package/src/social/elements/CommunityJoinButtonElement/CommunityJoinButtonElement.tsx +10 -2
- package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx +17 -10
- package/src/social/features/comment/components/PostComment/ReplyCommentList/index.tsx +15 -5
- package/src/social/features/comment/components/PostComment/ReplyCommentList/styles.ts +8 -0
- package/src/social/features/feed/components/TopNavigation/TopNavigation.tsx +3 -1
- package/src/social/features/livestream/Player/Player.tsx +10 -7
- package/src/social/features/post/Detail/index.tsx +5 -2
- package/src/social/features/post/components/EngagementActions/Components/DetailStyle.tsx +19 -14
- package/src/social/features/post/components/EngagementActions/Components/FeedStyle.tsx +20 -12
- package/src/social/features/story/View/components/AmityViewStoryItem.tsx +21 -22
- package/src/social/features/user/Profile/components/Header/hooks/useHeader.ts +27 -20
- package/src/social/features/user/Profile/components/Header/styles.ts +2 -0
- package/src/social/features/user/Profile/elements/Menu/hooks/useMenu.ts +16 -4
- package/src/social/features/visitor/UsageLimit/UsageLimit.tsx +43 -0
- package/src/social/features/visitor/UsageLimit/hooks/index.ts +1 -0
- package/src/social/features/visitor/UsageLimit/hooks/useUsageLimit.ts +46 -0
- package/src/social/features/visitor/UsageLimit/index.ts +1 -0
- package/src/social/features/visitor/UsageLimit/styles.ts +45 -0
- package/src/social/hooks/index.ts +2 -0
- package/src/social/hooks/useGlobalBehavior.ts +33 -0
- package/src/social/hooks/useInteractionBehavior.ts +47 -0
- package/src/social/hooks/usePostPermission.ts +3 -1
- package/src/social/hooks/useStoryPermission.ts +8 -6
- package/src/social/providers/BehaviourProvider.tsx +1 -0
- package/src/social/screens/CommunityProfile/components/Header/Header.tsx +8 -2
- package/src/social/screens/SocialHomePage/index.tsx +45 -17
- package/src/social/screens/VisitorUsageLimit/VisitorUsageLimit.tsx +5 -0
- package/src/social/screens/VisitorUsageLimit/index.ts +1 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { useTheme } from 'react-native-paper';
|
|
3
|
+
import type { MyMD3Theme } from '../../../../core/providers/AmityUIKitProvider';
|
|
4
|
+
|
|
5
|
+
export const useStyles = () => {
|
|
6
|
+
const theme = useTheme<MyMD3Theme>();
|
|
7
|
+
|
|
8
|
+
const styles = StyleSheet.create({
|
|
9
|
+
container: {
|
|
10
|
+
flex: 1,
|
|
11
|
+
backgroundColor: theme.colors.background,
|
|
12
|
+
},
|
|
13
|
+
contentContainer: {
|
|
14
|
+
flex: 1,
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
paddingHorizontal: 32,
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
},
|
|
20
|
+
icon: {
|
|
21
|
+
marginBottom: 16,
|
|
22
|
+
},
|
|
23
|
+
title: {
|
|
24
|
+
maxWidth: 252,
|
|
25
|
+
textAlign: 'center',
|
|
26
|
+
color: theme.colors.baseShade3,
|
|
27
|
+
},
|
|
28
|
+
subtitle: {
|
|
29
|
+
maxWidth: 252,
|
|
30
|
+
textAlign: 'center',
|
|
31
|
+
color: theme.colors.baseShade3,
|
|
32
|
+
},
|
|
33
|
+
signInButton: {
|
|
34
|
+
marginTop: 16,
|
|
35
|
+
borderRadius: 8,
|
|
36
|
+
paddingVertical: 10,
|
|
37
|
+
paddingHorizontal: 16,
|
|
38
|
+
},
|
|
39
|
+
signInText: {
|
|
40
|
+
color: theme.colors.primary,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
return { styles, theme };
|
|
45
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import useAuth from '../../core/hooks/useAuth';
|
|
3
|
+
import { useBehaviour } from '../providers/BehaviourProvider';
|
|
4
|
+
import { useToast } from '../../core/stores/slices/toastSlice';
|
|
5
|
+
import {
|
|
6
|
+
VISITOR_USER_ACTION_TOAST,
|
|
7
|
+
VISITOR_TOAST_DURATION,
|
|
8
|
+
} from '../../core/constants';
|
|
9
|
+
|
|
10
|
+
export const useGlobalBehavior = () => {
|
|
11
|
+
const { showToast } = useToast();
|
|
12
|
+
const { isVisitorOrBot } = useAuth();
|
|
13
|
+
const { AmityGlobalBehaviour } = useBehaviour();
|
|
14
|
+
|
|
15
|
+
const handleGlobalBehavior = useCallback(
|
|
16
|
+
({ defaultBehavior }: { defaultBehavior?: () => void }) => {
|
|
17
|
+
if (isVisitorOrBot) {
|
|
18
|
+
if (AmityGlobalBehaviour?.handleVisitorUserAction) {
|
|
19
|
+
return AmityGlobalBehaviour.handleVisitorUserAction();
|
|
20
|
+
}
|
|
21
|
+
return showToast({
|
|
22
|
+
message: VISITOR_USER_ACTION_TOAST,
|
|
23
|
+
type: 'informative',
|
|
24
|
+
duration: VISITOR_TOAST_DURATION,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return defaultBehavior?.();
|
|
28
|
+
},
|
|
29
|
+
[isVisitorOrBot, AmityGlobalBehaviour, showToast]
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return { handleGlobalBehavior, isVisitorOrBot };
|
|
33
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useBehaviour } from '../providers/BehaviourProvider';
|
|
3
|
+
import { useToast } from '../../core/stores/slices/toastSlice';
|
|
4
|
+
import { useGlobalBehavior } from './useGlobalBehavior';
|
|
5
|
+
import {
|
|
6
|
+
NON_MEMBER_ACTION_TOAST,
|
|
7
|
+
VISITOR_TOAST_DURATION,
|
|
8
|
+
} from '../../core/constants';
|
|
9
|
+
|
|
10
|
+
type HandleInteractionParams = {
|
|
11
|
+
defaultBehavior?: () => void;
|
|
12
|
+
allowNonMember?: boolean;
|
|
13
|
+
isJoined?: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const useInteractionBehavior = () => {
|
|
17
|
+
const { showToast } = useToast();
|
|
18
|
+
const { AmityGlobalBehaviour } = useBehaviour();
|
|
19
|
+
const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
|
|
20
|
+
|
|
21
|
+
const handleInteraction = useCallback(
|
|
22
|
+
({
|
|
23
|
+
defaultBehavior,
|
|
24
|
+
allowNonMember,
|
|
25
|
+
isJoined,
|
|
26
|
+
}: HandleInteractionParams) => {
|
|
27
|
+
handleGlobalBehavior({
|
|
28
|
+
defaultBehavior: () => {
|
|
29
|
+
if (allowNonMember || isJoined) {
|
|
30
|
+
return defaultBehavior?.();
|
|
31
|
+
}
|
|
32
|
+
if (AmityGlobalBehaviour?.handleNonMemberAction) {
|
|
33
|
+
return AmityGlobalBehaviour.handleNonMemberAction();
|
|
34
|
+
}
|
|
35
|
+
return showToast({
|
|
36
|
+
message: NON_MEMBER_ACTION_TOAST,
|
|
37
|
+
type: 'informative',
|
|
38
|
+
duration: VISITOR_TOAST_DURATION,
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
[handleGlobalBehavior, AmityGlobalBehaviour, showToast]
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
return { handleInteraction, isVisitorOrBot };
|
|
47
|
+
};
|
|
@@ -12,13 +12,14 @@ type UsePostPermissionParams = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export function usePostPermission({ community }: UsePostPermissionParams) {
|
|
15
|
-
const { client } = useAuth();
|
|
15
|
+
const { client, isVisitorOrBot } = useAuth();
|
|
16
16
|
const [hasPostPermission, setHasPostPermission] = useState(false);
|
|
17
17
|
|
|
18
18
|
const isOnlyAdminCanPost =
|
|
19
19
|
community?.postSetting === CommunityPostSettings.ONLY_ADMIN_CAN_POST;
|
|
20
20
|
|
|
21
21
|
useEffect(() => {
|
|
22
|
+
if (isVisitorOrBot) return;
|
|
22
23
|
if (!community?.communityId || !client?.userId) return;
|
|
23
24
|
|
|
24
25
|
CommunityRepository.Membership.getMembers(
|
|
@@ -41,6 +42,7 @@ export function usePostPermission({ community }: UsePostPermissionParams) {
|
|
|
41
42
|
client?.userId,
|
|
42
43
|
isOnlyAdminCanPost,
|
|
43
44
|
community?.isJoined,
|
|
45
|
+
isVisitorOrBot,
|
|
44
46
|
]);
|
|
45
47
|
|
|
46
48
|
return hasPostPermission;
|
|
@@ -4,17 +4,19 @@ import useSocialSettings from '../../core/hooks/useSocialSettings';
|
|
|
4
4
|
import { checkStoryPermission, isAdmin } from '../utils/permissions';
|
|
5
5
|
|
|
6
6
|
export function useStoryPermission(communityId?: string) {
|
|
7
|
-
const { client } = useAuth();
|
|
7
|
+
const { client, isVisitorOrBot } = useAuth();
|
|
8
8
|
const { socialSettings } = useSocialSettings();
|
|
9
9
|
const user = useUser(client?.userId || '');
|
|
10
10
|
|
|
11
11
|
const isGlobalAdmin = isAdmin(user?.roles);
|
|
12
12
|
|
|
13
|
-
const hasStoryPermission =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const hasStoryPermission =
|
|
14
|
+
!isVisitorOrBot &&
|
|
15
|
+
(!communityId
|
|
16
|
+
? socialSettings?.story?.allowAllUserToCreateStory
|
|
17
|
+
: socialSettings?.story?.allowAllUserToCreateStory ||
|
|
18
|
+
isGlobalAdmin ||
|
|
19
|
+
checkStoryPermission(client, communityId));
|
|
18
20
|
|
|
19
21
|
return { hasStoryPermission };
|
|
20
22
|
}
|
|
@@ -14,6 +14,7 @@ export const BehaviourProvider = ({
|
|
|
14
14
|
}: IBehavioudProviderProps) => {
|
|
15
15
|
const defaultBehaviour = useMemo(
|
|
16
16
|
() => ({
|
|
17
|
+
AmityGlobalBehaviour: {},
|
|
17
18
|
AmitySocialHomePageBehaviour: {},
|
|
18
19
|
AmityGlobalFeedComponentBehavior: {},
|
|
19
20
|
AmityPostContentComponentBehavior: {},
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
useCommunity,
|
|
7
7
|
isModerator,
|
|
8
8
|
useUser,
|
|
9
|
+
useGlobalBehavior,
|
|
9
10
|
} from '../../../../hooks';
|
|
10
11
|
import { useStyles } from './styles';
|
|
11
12
|
import { CommunityCover } from '../../elements/CommunityCover/CommunityCover';
|
|
@@ -50,6 +51,7 @@ const AmityCommunityHeaderComponent: FC<AmityCommunityHeaderComponentProps> = ({
|
|
|
50
51
|
const client = Client.getActiveClient();
|
|
51
52
|
const navigation =
|
|
52
53
|
useNavigation<NativeStackNavigationProp<RootStackParamList>>();
|
|
54
|
+
const { handleGlobalBehavior } = useGlobalBehavior();
|
|
53
55
|
const componentId = ComponentID.community_header;
|
|
54
56
|
const { community } = useCommunity(communityId);
|
|
55
57
|
const { posts: pendingPosts } = usePosts({
|
|
@@ -153,8 +155,12 @@ const AmityCommunityHeaderComponent: FC<AmityCommunityHeaderComponentProps> = ({
|
|
|
153
155
|
community={community}
|
|
154
156
|
style={styles.infoWrap}
|
|
155
157
|
onPress={() => {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
+
handleGlobalBehavior({
|
|
159
|
+
defaultBehavior: () => {
|
|
160
|
+
navigation.navigate('CommunityMembership', {
|
|
161
|
+
community: community,
|
|
162
|
+
});
|
|
163
|
+
},
|
|
158
164
|
});
|
|
159
165
|
}}
|
|
160
166
|
/>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useCallback, useRef, useState } from 'react';
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { StyleSheet, View } from 'react-native';
|
|
4
4
|
import CustomSocialTab from '../../components/CustomSocialTab/CustomSocialTab';
|
|
5
|
-
import { useUiKitConfig } from '../../hooks';
|
|
5
|
+
import { useAmityElement, useUiKitConfig } from '../../hooks';
|
|
6
6
|
import { ComponentID, ElementID, PageID } from '../../enums/enumUIKitID';
|
|
7
7
|
import { useTheme } from 'react-native-paper';
|
|
8
8
|
import { useBehaviour } from '../../providers/BehaviourProvider';
|
|
@@ -20,7 +20,7 @@ const PROFILE_TAB = 'Profile';
|
|
|
20
20
|
|
|
21
21
|
const AmitySocialHomePage = () => {
|
|
22
22
|
const theme = useTheme() as MyMD3Theme;
|
|
23
|
-
const { client } = useAuth();
|
|
23
|
+
const { client, isVisitorOrBot } = useAuth();
|
|
24
24
|
|
|
25
25
|
const styles = StyleSheet.create({
|
|
26
26
|
container: {
|
|
@@ -52,9 +52,29 @@ const AmitySocialHomePage = () => {
|
|
|
52
52
|
keys: ['text'],
|
|
53
53
|
}) as string[];
|
|
54
54
|
|
|
55
|
+
const { isExcluded: isExploreExcluded } = useAmityElement({
|
|
56
|
+
pageId: PageID.social_home_page,
|
|
57
|
+
componentId: ComponentID.WildCardComponent,
|
|
58
|
+
elementId: ElementID.explore_button,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const allTabs = [newsFeedTab, exploreTab, myCommunitiesTab, PROFILE_TAB];
|
|
62
|
+
|
|
63
|
+
const visibleTabs = isExploreExcluded
|
|
64
|
+
? allTabs.filter((t) => t !== exploreTab)
|
|
65
|
+
: allTabs;
|
|
66
|
+
|
|
55
67
|
const [activeTab, setActiveTab] = useState<string>(newsFeedTab);
|
|
68
|
+
|
|
56
69
|
const visitedTabs = useRef<Set<string>>(new Set([newsFeedTab]));
|
|
57
70
|
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (isVisitorOrBot) {
|
|
73
|
+
visitedTabs.current.add(exploreTab);
|
|
74
|
+
setActiveTab(exploreTab);
|
|
75
|
+
}
|
|
76
|
+
}, [isVisitorOrBot, exploreTab]);
|
|
77
|
+
|
|
58
78
|
const onTabChange = useCallback(
|
|
59
79
|
(tabName: string) => {
|
|
60
80
|
if (AmitySocialHomePageBehaviour?.onChooseTab)
|
|
@@ -74,6 +94,8 @@ const AmitySocialHomePage = () => {
|
|
|
74
94
|
display: activeTab === tab ? ('flex' as const) : ('none' as const),
|
|
75
95
|
});
|
|
76
96
|
|
|
97
|
+
const tabNames = isVisitorOrBot ? [exploreTab] : visibleTabs;
|
|
98
|
+
|
|
77
99
|
return (
|
|
78
100
|
<SafeAreaView
|
|
79
101
|
testID="social_home_page"
|
|
@@ -82,24 +104,30 @@ const AmitySocialHomePage = () => {
|
|
|
82
104
|
style={styles.container}
|
|
83
105
|
>
|
|
84
106
|
<AmitySocialHomeTopNavigationComponent activeTab={activeTab} />
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
107
|
+
{tabNames.length > 1 && (
|
|
108
|
+
<>
|
|
109
|
+
<CustomSocialTab
|
|
110
|
+
activeTab={activeTab}
|
|
111
|
+
onTabChange={onTabChange}
|
|
112
|
+
tabNames={tabNames}
|
|
113
|
+
/>
|
|
114
|
+
<Divider />
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
117
|
+
{!isVisitorOrBot && (
|
|
118
|
+
<View style={tabStyle(newsFeedTab)}>
|
|
119
|
+
<AmityNewsFeedComponent
|
|
120
|
+
pageId={PageID.social_home_page}
|
|
121
|
+
onPressExploreCommunity={onPressExploreCommunity}
|
|
122
|
+
/>
|
|
123
|
+
</View>
|
|
124
|
+
)}
|
|
97
125
|
{visitedTabs.current.has(exploreTab) && (
|
|
98
126
|
<View style={tabStyle(exploreTab)}>
|
|
99
127
|
<AmityExploreComponent pageId={PageID.social_home_page} />
|
|
100
128
|
</View>
|
|
101
129
|
)}
|
|
102
|
-
{visitedTabs.current.has(myCommunitiesTab) && (
|
|
130
|
+
{!isVisitorOrBot && visitedTabs.current.has(myCommunitiesTab) && (
|
|
103
131
|
<View style={tabStyle(myCommunitiesTab)}>
|
|
104
132
|
<AmityMyCommunitiesComponent
|
|
105
133
|
pageId={PageID.social_home_page}
|
|
@@ -107,7 +135,7 @@ const AmitySocialHomePage = () => {
|
|
|
107
135
|
/>
|
|
108
136
|
</View>
|
|
109
137
|
)}
|
|
110
|
-
{visitedTabs.current.has(PROFILE_TAB) && (
|
|
138
|
+
{!isVisitorOrBot && visitedTabs.current.has(PROFILE_TAB) && (
|
|
111
139
|
<View style={tabStyle(PROFILE_TAB)}>
|
|
112
140
|
<UserProfile inline stickyTab={false} userId={client?.userId ?? ''} />
|
|
113
141
|
</View>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { VisitorUsageLimit } from './VisitorUsageLimit';
|