diff --git a/src/components/posts/container/postsContainer.js b/src/components/posts/container/postsContainer.js index 638a44b70..9221385c5 100644 --- a/src/components/posts/container/postsContainer.js +++ b/src/components/posts/container/postsContainer.js @@ -25,6 +25,7 @@ const PostsContainer = ({ tag, nsfw, filterOptionsValue, + feedUsername, }) => { const dispatch = useDispatch(); @@ -59,6 +60,7 @@ const PostsContainer = ({ setFeedPosts={_setFeedPosts} tag={tag} filterOptionsValue={filterOptionsValue} + feedUsername={feedUsername} /> )} diff --git a/src/components/posts/view/postsView.js b/src/components/posts/view/postsView.js index 8dd98c903..4ba6af774 100644 --- a/src/components/posts/view/postsView.js +++ b/src/components/posts/view/postsView.js @@ -39,6 +39,7 @@ const PostsView = ({ changeForceLoadPostState, forceLoadPost, filterOptionsValue, + feedUsername, }) => { const [posts, setPosts] = useState(isConnected ? [] : feedPosts); const [startAuthor, setStartAuthor] = useState(''); @@ -167,11 +168,12 @@ const PostsView = ({ if (filter === 'feed' || filter === 'blog' || getFor === 'blog' || filter === 'reblogs') { options = { - tag, + tag: feedUsername, limit, }; } else { options = { + tag, limit, }; } diff --git a/src/components/profile/profileView.js b/src/components/profile/profileView.js index fb75b8c36..b61780202 100644 --- a/src/components/profile/profileView.js +++ b/src/components/profile/profileView.js @@ -177,7 +177,7 @@ class ProfileView extends PureComponent { selectedOptionIndex={0} pageType="profiles" getFor="blog" - tag={username} + feedUsername={username} key={username} handleOnScroll={isSummaryOpen ? this._handleOnScroll : null} forceLoadPost={forceLoadPost} diff --git a/src/constants/options/filters.js b/src/constants/options/filters.js index 8189b7fef..6dfe4de3a 100644 --- a/src/constants/options/filters.js +++ b/src/constants/options/filters.js @@ -1,6 +1,9 @@ export const POPULAR_FILTERS = ['FEED', 'TOP', 'HOT', 'NEW']; export const POPULAR_FILTERS_VALUE = ['feed', 'trending', 'hot', 'created']; +export const GLOBAL_POST_FILTERS = ['TOP', 'HOT', 'NEW']; +export const GLOBAL_POST_FILTERS_VALUE = ['trending', 'hot', 'created']; + export const PROFILE_FILTERS = ['BLOG', 'FEED']; export const PROFILE_FILTERS_VALUE = ['blog', 'feed']; diff --git a/src/screens/feed/screen/feedScreen.js b/src/screens/feed/screen/feedScreen.js index 358743b6d..c7f95dd43 100644 --- a/src/screens/feed/screen/feedScreen.js +++ b/src/screens/feed/screen/feedScreen.js @@ -25,7 +25,7 @@ const FeedScreen = () => { filterOptionsValue={[...POPULAR_FILTERS_VALUE]} getFor={isLoggedIn ? 'feed' : 'trending'} selectedOptionIndex={isLoggedIn ? 0 : 2} - tag={get(currentAccount, 'name')} + feedUsername={get(currentAccount, 'name')} /> diff --git a/src/screens/searchResult/screen/searchResultScreen.js b/src/screens/searchResult/screen/searchResultScreen.js index 04d0682b2..567a12c6c 100644 --- a/src/screens/searchResult/screen/searchResultScreen.js +++ b/src/screens/searchResult/screen/searchResultScreen.js @@ -10,7 +10,7 @@ import { SearchInput, Posts, TabBar } from '../../../components'; import styles from './searchResultStyles'; import globalStyles from '../../../globalStyles'; -import { POPULAR_FILTERS, POPULAR_FILTERS_VALUE } from '../../../constants/options/filters'; +import { GLOBAL_POST_FILTERS, GLOBAL_POST_FILTERS_VALUE } from '../../../constants/options/filters'; const SearchResultScreen = ({ navigation }) => { const tag = navigation.getParam('tag', ''); @@ -33,7 +33,7 @@ const SearchResultScreen = ({ navigation }) => { const _getSelectedIndex = () => { if (filter) { - const selectedIndex = POPULAR_FILTERS_VALUE.indexOf(filter); + const selectedIndex = GLOBAL_POST_FILTERS_VALUE.indexOf(filter); if (selectedIndex > 0) { return selectedIndex; } @@ -54,8 +54,8 @@ const SearchResultScreen = ({ navigation }) => {