mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-22 21:01:31 +03:00
Merge pull request #1346 from esteemapp/bugfix/search-result
Fixed search result tag issue
This commit is contained in:
commit
fb5b4df1bc
@ -25,6 +25,7 @@ const PostsContainer = ({
|
|||||||
tag,
|
tag,
|
||||||
nsfw,
|
nsfw,
|
||||||
filterOptionsValue,
|
filterOptionsValue,
|
||||||
|
feedUsername,
|
||||||
}) => {
|
}) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
@ -59,6 +60,7 @@ const PostsContainer = ({
|
|||||||
setFeedPosts={_setFeedPosts}
|
setFeedPosts={_setFeedPosts}
|
||||||
tag={tag}
|
tag={tag}
|
||||||
filterOptionsValue={filterOptionsValue}
|
filterOptionsValue={filterOptionsValue}
|
||||||
|
feedUsername={feedUsername}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</AccountContainer>
|
</AccountContainer>
|
||||||
|
@ -39,6 +39,7 @@ const PostsView = ({
|
|||||||
changeForceLoadPostState,
|
changeForceLoadPostState,
|
||||||
forceLoadPost,
|
forceLoadPost,
|
||||||
filterOptionsValue,
|
filterOptionsValue,
|
||||||
|
feedUsername,
|
||||||
}) => {
|
}) => {
|
||||||
const [posts, setPosts] = useState(isConnected ? [] : feedPosts);
|
const [posts, setPosts] = useState(isConnected ? [] : feedPosts);
|
||||||
const [startAuthor, setStartAuthor] = useState('');
|
const [startAuthor, setStartAuthor] = useState('');
|
||||||
@ -167,11 +168,12 @@ const PostsView = ({
|
|||||||
|
|
||||||
if (filter === 'feed' || filter === 'blog' || getFor === 'blog' || filter === 'reblogs') {
|
if (filter === 'feed' || filter === 'blog' || getFor === 'blog' || filter === 'reblogs') {
|
||||||
options = {
|
options = {
|
||||||
tag,
|
tag: feedUsername,
|
||||||
limit,
|
limit,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
options = {
|
options = {
|
||||||
|
tag,
|
||||||
limit,
|
limit,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ class ProfileView extends PureComponent {
|
|||||||
selectedOptionIndex={0}
|
selectedOptionIndex={0}
|
||||||
pageType="profiles"
|
pageType="profiles"
|
||||||
getFor="blog"
|
getFor="blog"
|
||||||
tag={username}
|
feedUsername={username}
|
||||||
key={username}
|
key={username}
|
||||||
handleOnScroll={isSummaryOpen ? this._handleOnScroll : null}
|
handleOnScroll={isSummaryOpen ? this._handleOnScroll : null}
|
||||||
forceLoadPost={forceLoadPost}
|
forceLoadPost={forceLoadPost}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
export const POPULAR_FILTERS = ['FEED', 'TOP', 'HOT', 'NEW'];
|
export const POPULAR_FILTERS = ['FEED', 'TOP', 'HOT', 'NEW'];
|
||||||
export const POPULAR_FILTERS_VALUE = ['feed', 'trending', 'hot', 'created'];
|
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 = ['BLOG', 'FEED'];
|
||||||
export const PROFILE_FILTERS_VALUE = ['blog', 'feed'];
|
export const PROFILE_FILTERS_VALUE = ['blog', 'feed'];
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ const FeedScreen = () => {
|
|||||||
filterOptionsValue={[...POPULAR_FILTERS_VALUE]}
|
filterOptionsValue={[...POPULAR_FILTERS_VALUE]}
|
||||||
getFor={isLoggedIn ? 'feed' : 'trending'}
|
getFor={isLoggedIn ? 'feed' : 'trending'}
|
||||||
selectedOptionIndex={isLoggedIn ? 0 : 2}
|
selectedOptionIndex={isLoggedIn ? 0 : 2}
|
||||||
tag={get(currentAccount, 'name')}
|
feedUsername={get(currentAccount, 'name')}
|
||||||
/>
|
/>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
@ -10,7 +10,7 @@ import { SearchInput, Posts, TabBar } from '../../../components';
|
|||||||
import styles from './searchResultStyles';
|
import styles from './searchResultStyles';
|
||||||
import globalStyles from '../../../globalStyles';
|
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 SearchResultScreen = ({ navigation }) => {
|
||||||
const tag = navigation.getParam('tag', '');
|
const tag = navigation.getParam('tag', '');
|
||||||
@ -33,7 +33,7 @@ const SearchResultScreen = ({ navigation }) => {
|
|||||||
|
|
||||||
const _getSelectedIndex = () => {
|
const _getSelectedIndex = () => {
|
||||||
if (filter) {
|
if (filter) {
|
||||||
const selectedIndex = POPULAR_FILTERS_VALUE.indexOf(filter);
|
const selectedIndex = GLOBAL_POST_FILTERS_VALUE.indexOf(filter);
|
||||||
if (selectedIndex > 0) {
|
if (selectedIndex > 0) {
|
||||||
return selectedIndex;
|
return selectedIndex;
|
||||||
}
|
}
|
||||||
@ -54,8 +54,8 @@ const SearchResultScreen = ({ navigation }) => {
|
|||||||
<View tabLabel={intl.formatMessage({ id: 'search.posts' })} style={styles.tabbarItem}>
|
<View tabLabel={intl.formatMessage({ id: 'search.posts' })} style={styles.tabbarItem}>
|
||||||
<Posts
|
<Posts
|
||||||
key={tag}
|
key={tag}
|
||||||
filterOptions={POPULAR_FILTERS}
|
filterOptions={GLOBAL_POST_FILTERS}
|
||||||
filterOptionsValue={POPULAR_FILTERS_VALUE}
|
filterOptionsValue={GLOBAL_POST_FILTERS_VALUE}
|
||||||
selectedOptionIndex={_getSelectedIndex()}
|
selectedOptionIndex={_getSelectedIndex()}
|
||||||
tag={tag}
|
tag={tag}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user