@amityco/react-native-social-uikit 4.0.1-fd53cf63.0 → 4.0.2-232eeace.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/hooks/useUpload.js +6 -7
- package/lib/commonjs/core/hooks/useUpload.js.map +1 -1
- package/lib/commonjs/core/legacy/file.js +4 -19
- package/lib/commonjs/core/legacy/file.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 +6 -2
- package/lib/commonjs/core/providers/AuthProvider.js.map +1 -1
- package/lib/commonjs/core/utils/fileUpload.js +59 -0
- package/lib/commonjs/core/utils/fileUpload.js.map +1 -0
- 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/CommentListItem/CommentListItem.js +20 -13
- 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 +8 -4
- 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/features/comment/components/PostComment/CommentListItem/CommentListItem.js +8 -4
- 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 +11 -5
- 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/livestream/Player/Player.js +9 -6
- package/lib/commonjs/social/features/livestream/Player/Player.js.map +1 -1
- package/lib/commonjs/social/features/post/components/Content/Content.js +1 -5
- package/lib/commonjs/social/features/post/components/Content/Content.js.map +1 -1
- package/lib/commonjs/social/features/story/Draft/Draft.js +2 -5
- package/lib/commonjs/social/features/story/Draft/Draft.js.map +1 -1
- package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js +1 -1
- 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 +22 -18
- 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/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 +13 -3
- package/lib/commonjs/social/screens/SocialHomePage/index.js.map +1 -1
- package/lib/module/core/hooks/useUpload.js +7 -8
- package/lib/module/core/hooks/useUpload.js.map +1 -1
- package/lib/module/core/legacy/file.js +4 -19
- package/lib/module/core/legacy/file.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 +6 -2
- package/lib/module/core/providers/AuthProvider.js.map +1 -1
- package/lib/module/core/utils/fileUpload.js +54 -0
- package/lib/module/core/utils/fileUpload.js.map +1 -0
- 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/CommentListItem/CommentListItem.js +20 -13
- 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 +8 -4
- 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/features/comment/components/PostComment/CommentListItem/CommentListItem.js +8 -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 +11 -5
- 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/livestream/Player/Player.js +9 -6
- package/lib/module/social/features/livestream/Player/Player.js.map +1 -1
- package/lib/module/social/features/post/components/Content/Content.js +1 -5
- package/lib/module/social/features/post/components/Content/Content.js.map +1 -1
- package/lib/module/social/features/story/Draft/Draft.js +2 -5
- package/lib/module/social/features/story/Draft/Draft.js.map +1 -1
- package/lib/module/social/features/story/View/components/AmityViewStoryItem.js +1 -1
- 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 +22 -18
- 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/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 +14 -4
- package/lib/module/social/screens/SocialHomePage/index.js.map +1 -1
- package/lib/typescript/core/hooks/useUpload.d.ts.map +1 -1
- package/lib/typescript/core/legacy/file.d.ts.map +1 -1
- package/lib/typescript/core/providers/AmityUIKitProvider.d.ts +5 -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/utils/fileUpload.d.ts +39 -0
- package/lib/typescript/core/utils/fileUpload.d.ts.map +1 -0
- 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/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/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/livestream/Player/Player.d.ts.map +1 -1
- package/lib/typescript/social/features/post/components/Content/Content.d.ts.map +1 -1
- package/lib/typescript/social/features/story/Draft/Draft.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/screens/CommunityProfile/components/Header/Header.d.ts.map +1 -1
- package/lib/typescript/social/screens/SocialHomePage/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/hooks/useUpload.ts +6 -8
- package/src/core/legacy/file.tsx +16 -22
- package/src/core/providers/AmityUIKitProvider.tsx +26 -2
- package/src/core/providers/AuthProvider.tsx +3 -4
- package/src/core/utils/fileUpload.ts +60 -0
- package/src/social/components/PollContent/PollOption.tsx +13 -19
- package/src/social/components/PostMenu/index.tsx +6 -3
- package/src/social/components/Social/CommentListItem/CommentListItem.tsx +63 -57
- package/src/social/components/Social/CommentListItem/styles.ts +2 -1
- package/src/social/components/legacy/Social/ReplyCommentList/index.tsx +14 -11
- package/src/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.tsx +7 -1
- package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx +14 -14
- package/src/social/features/comment/components/PostComment/ReplyCommentList/index.tsx +15 -11
- package/src/social/features/comment/components/PostComment/ReplyCommentList/styles.ts +8 -0
- package/src/social/features/livestream/Player/Player.tsx +10 -7
- package/src/social/features/post/components/Content/Content.tsx +4 -7
- package/src/social/features/story/Draft/Draft.tsx +9 -5
- package/src/social/features/story/View/components/AmityViewStoryItem.tsx +1 -0
- package/src/social/features/user/Profile/components/Header/hooks/useHeader.ts +22 -18
- 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/screens/CommunityProfile/components/Header/Header.tsx +8 -2
- package/src/social/screens/SocialHomePage/index.tsx +26 -11
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
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';
|
|
@@ -52,7 +52,20 @@ 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
|
|
|
58
71
|
useEffect(() => {
|
|
@@ -81,6 +94,8 @@ const AmitySocialHomePage = () => {
|
|
|
81
94
|
display: activeTab === tab ? ('flex' as const) : ('none' as const),
|
|
82
95
|
});
|
|
83
96
|
|
|
97
|
+
const tabNames = isVisitorOrBot ? [exploreTab] : visibleTabs;
|
|
98
|
+
|
|
84
99
|
return (
|
|
85
100
|
<SafeAreaView
|
|
86
101
|
testID="social_home_page"
|
|
@@ -89,16 +104,16 @@ const AmitySocialHomePage = () => {
|
|
|
89
104
|
style={styles.container}
|
|
90
105
|
>
|
|
91
106
|
<AmitySocialHomeTopNavigationComponent activeTab={activeTab} />
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
107
|
+
{tabNames.length > 1 && (
|
|
108
|
+
<>
|
|
109
|
+
<CustomSocialTab
|
|
110
|
+
activeTab={activeTab}
|
|
111
|
+
onTabChange={onTabChange}
|
|
112
|
+
tabNames={tabNames}
|
|
113
|
+
/>
|
|
114
|
+
<Divider />
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
102
117
|
{!isVisitorOrBot && (
|
|
103
118
|
<View style={tabStyle(newsFeedTab)}>
|
|
104
119
|
<AmityNewsFeedComponent
|