@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.
Files changed (144) hide show
  1. package/lib/commonjs/core/hooks/useUpload.js +6 -7
  2. package/lib/commonjs/core/hooks/useUpload.js.map +1 -1
  3. package/lib/commonjs/core/legacy/file.js +4 -19
  4. package/lib/commonjs/core/legacy/file.js.map +1 -1
  5. package/lib/commonjs/core/providers/AmityUIKitProvider.js +10 -3
  6. package/lib/commonjs/core/providers/AmityUIKitProvider.js.map +1 -1
  7. package/lib/commonjs/core/providers/AuthProvider.js +6 -2
  8. package/lib/commonjs/core/providers/AuthProvider.js.map +1 -1
  9. package/lib/commonjs/core/utils/fileUpload.js +59 -0
  10. package/lib/commonjs/core/utils/fileUpload.js.map +1 -0
  11. package/lib/commonjs/social/components/PollContent/PollOption.js +12 -12
  12. package/lib/commonjs/social/components/PollContent/PollOption.js.map +1 -1
  13. package/lib/commonjs/social/components/PostMenu/index.js +9 -2
  14. package/lib/commonjs/social/components/PostMenu/index.js.map +1 -1
  15. package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js +20 -13
  16. package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
  17. package/lib/commonjs/social/components/Social/CommentListItem/styles.js +3 -2
  18. package/lib/commonjs/social/components/Social/CommentListItem/styles.js.map +1 -1
  19. package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js +8 -4
  20. package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
  21. package/lib/commonjs/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js +3 -1
  22. package/lib/commonjs/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js.map +1 -1
  23. package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +8 -4
  24. package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
  25. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js +11 -5
  26. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
  27. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/styles.js +8 -0
  28. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/styles.js.map +1 -1
  29. package/lib/commonjs/social/features/livestream/Player/Player.js +9 -6
  30. package/lib/commonjs/social/features/livestream/Player/Player.js.map +1 -1
  31. package/lib/commonjs/social/features/post/components/Content/Content.js +1 -5
  32. package/lib/commonjs/social/features/post/components/Content/Content.js.map +1 -1
  33. package/lib/commonjs/social/features/story/Draft/Draft.js +2 -5
  34. package/lib/commonjs/social/features/story/Draft/Draft.js.map +1 -1
  35. package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js +1 -1
  36. package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
  37. package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js +22 -18
  38. package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
  39. package/lib/commonjs/social/features/user/Profile/components/Header/styles.js +2 -0
  40. package/lib/commonjs/social/features/user/Profile/components/Header/styles.js.map +1 -1
  41. package/lib/commonjs/social/features/user/Profile/elements/Menu/hooks/useMenu.js +15 -4
  42. package/lib/commonjs/social/features/user/Profile/elements/Menu/hooks/useMenu.js.map +1 -1
  43. package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js +9 -2
  44. package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
  45. package/lib/commonjs/social/screens/SocialHomePage/index.js +13 -3
  46. package/lib/commonjs/social/screens/SocialHomePage/index.js.map +1 -1
  47. package/lib/module/core/hooks/useUpload.js +7 -8
  48. package/lib/module/core/hooks/useUpload.js.map +1 -1
  49. package/lib/module/core/legacy/file.js +4 -19
  50. package/lib/module/core/legacy/file.js.map +1 -1
  51. package/lib/module/core/providers/AmityUIKitProvider.js +10 -3
  52. package/lib/module/core/providers/AmityUIKitProvider.js.map +1 -1
  53. package/lib/module/core/providers/AuthProvider.js +6 -2
  54. package/lib/module/core/providers/AuthProvider.js.map +1 -1
  55. package/lib/module/core/utils/fileUpload.js +54 -0
  56. package/lib/module/core/utils/fileUpload.js.map +1 -0
  57. package/lib/module/social/components/PollContent/PollOption.js +12 -12
  58. package/lib/module/social/components/PollContent/PollOption.js.map +1 -1
  59. package/lib/module/social/components/PostMenu/index.js +10 -3
  60. package/lib/module/social/components/PostMenu/index.js.map +1 -1
  61. package/lib/module/social/components/Social/CommentListItem/CommentListItem.js +20 -13
  62. package/lib/module/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
  63. package/lib/module/social/components/Social/CommentListItem/styles.js +3 -2
  64. package/lib/module/social/components/Social/CommentListItem/styles.js.map +1 -1
  65. package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js +8 -4
  66. package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
  67. package/lib/module/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js +3 -1
  68. package/lib/module/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js.map +1 -1
  69. package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +8 -4
  70. package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
  71. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js +11 -5
  72. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
  73. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/styles.js +8 -0
  74. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/styles.js.map +1 -1
  75. package/lib/module/social/features/livestream/Player/Player.js +9 -6
  76. package/lib/module/social/features/livestream/Player/Player.js.map +1 -1
  77. package/lib/module/social/features/post/components/Content/Content.js +1 -5
  78. package/lib/module/social/features/post/components/Content/Content.js.map +1 -1
  79. package/lib/module/social/features/story/Draft/Draft.js +2 -5
  80. package/lib/module/social/features/story/Draft/Draft.js.map +1 -1
  81. package/lib/module/social/features/story/View/components/AmityViewStoryItem.js +1 -1
  82. package/lib/module/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
  83. package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js +22 -18
  84. package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
  85. package/lib/module/social/features/user/Profile/components/Header/styles.js +2 -0
  86. package/lib/module/social/features/user/Profile/components/Header/styles.js.map +1 -1
  87. package/lib/module/social/features/user/Profile/elements/Menu/hooks/useMenu.js +16 -4
  88. package/lib/module/social/features/user/Profile/elements/Menu/hooks/useMenu.js.map +1 -1
  89. package/lib/module/social/screens/CommunityProfile/components/Header/Header.js +10 -3
  90. package/lib/module/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
  91. package/lib/module/social/screens/SocialHomePage/index.js +14 -4
  92. package/lib/module/social/screens/SocialHomePage/index.js.map +1 -1
  93. package/lib/typescript/core/hooks/useUpload.d.ts.map +1 -1
  94. package/lib/typescript/core/legacy/file.d.ts.map +1 -1
  95. package/lib/typescript/core/providers/AmityUIKitProvider.d.ts +5 -1
  96. package/lib/typescript/core/providers/AmityUIKitProvider.d.ts.map +1 -1
  97. package/lib/typescript/core/providers/AuthProvider.d.ts.map +1 -1
  98. package/lib/typescript/core/utils/fileUpload.d.ts +39 -0
  99. package/lib/typescript/core/utils/fileUpload.d.ts.map +1 -0
  100. package/lib/typescript/social/components/PollContent/PollOption.d.ts.map +1 -1
  101. package/lib/typescript/social/components/PostMenu/index.d.ts.map +1 -1
  102. package/lib/typescript/social/components/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
  103. package/lib/typescript/social/components/Social/CommentListItem/styles.d.ts +2 -1
  104. package/lib/typescript/social/components/Social/CommentListItem/styles.d.ts.map +1 -1
  105. package/lib/typescript/social/components/legacy/Social/ReplyCommentList/index.d.ts.map +1 -1
  106. package/lib/typescript/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.d.ts.map +1 -1
  107. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/index.d.ts.map +1 -1
  108. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/styles.d.ts +8 -0
  109. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/styles.d.ts.map +1 -1
  110. package/lib/typescript/social/features/livestream/Player/Player.d.ts.map +1 -1
  111. package/lib/typescript/social/features/post/components/Content/Content.d.ts.map +1 -1
  112. package/lib/typescript/social/features/story/Draft/Draft.d.ts.map +1 -1
  113. package/lib/typescript/social/features/story/View/components/AmityViewStoryItem.d.ts.map +1 -1
  114. package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts +2 -0
  115. package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts.map +1 -1
  116. package/lib/typescript/social/features/user/Profile/components/Header/styles.d.ts +2 -0
  117. package/lib/typescript/social/features/user/Profile/components/Header/styles.d.ts.map +1 -1
  118. package/lib/typescript/social/features/user/Profile/elements/Menu/hooks/useMenu.d.ts.map +1 -1
  119. package/lib/typescript/social/screens/CommunityProfile/components/Header/Header.d.ts.map +1 -1
  120. package/lib/typescript/social/screens/SocialHomePage/index.d.ts.map +1 -1
  121. package/package.json +1 -1
  122. package/src/core/hooks/useUpload.ts +6 -8
  123. package/src/core/legacy/file.tsx +16 -22
  124. package/src/core/providers/AmityUIKitProvider.tsx +26 -2
  125. package/src/core/providers/AuthProvider.tsx +3 -4
  126. package/src/core/utils/fileUpload.ts +60 -0
  127. package/src/social/components/PollContent/PollOption.tsx +13 -19
  128. package/src/social/components/PostMenu/index.tsx +6 -3
  129. package/src/social/components/Social/CommentListItem/CommentListItem.tsx +63 -57
  130. package/src/social/components/Social/CommentListItem/styles.ts +2 -1
  131. package/src/social/components/legacy/Social/ReplyCommentList/index.tsx +14 -11
  132. package/src/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.tsx +7 -1
  133. package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx +14 -14
  134. package/src/social/features/comment/components/PostComment/ReplyCommentList/index.tsx +15 -11
  135. package/src/social/features/comment/components/PostComment/ReplyCommentList/styles.ts +8 -0
  136. package/src/social/features/livestream/Player/Player.tsx +10 -7
  137. package/src/social/features/post/components/Content/Content.tsx +4 -7
  138. package/src/social/features/story/Draft/Draft.tsx +9 -5
  139. package/src/social/features/story/View/components/AmityViewStoryItem.tsx +1 -0
  140. package/src/social/features/user/Profile/components/Header/hooks/useHeader.ts +22 -18
  141. package/src/social/features/user/Profile/components/Header/styles.ts +2 -0
  142. package/src/social/features/user/Profile/elements/Menu/hooks/useMenu.ts +16 -4
  143. package/src/social/screens/CommunityProfile/components/Header/Header.tsx +8 -2
  144. 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
- <CustomSocialTab
93
- activeTab={activeTab}
94
- onTabChange={onTabChange}
95
- tabNames={
96
- isVisitorOrBot
97
- ? [exploreTab]
98
- : [newsFeedTab, exploreTab, myCommunitiesTab, PROFILE_TAB]
99
- }
100
- />
101
- <Divider />
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