From 124ad66d196a4145dc767c48ccb9424c336b0c3c Mon Sep 17 00:00:00 2001 From: feruz Date: Mon, 25 Jan 2021 15:14:48 +0200 Subject: [PATCH] remove search page thumbnails --- .../view/userListItem/userListItem.js | 15 ++++++++++- .../screen/tabs/best/view/postsResults.js | 26 ++----------------- .../screen/tabs/people/view/peopleResults.js | 1 + 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/src/components/basicUIElements/view/userListItem/userListItem.js b/src/components/basicUIElements/view/userListItem/userListItem.js index ae615b773..a638fde97 100644 --- a/src/components/basicUIElements/view/userListItem/userListItem.js +++ b/src/components/basicUIElements/view/userListItem/userListItem.js @@ -1,5 +1,6 @@ import React from 'react'; import { ActivityIndicator, View, Text, TouchableOpacity } from 'react-native'; +import Highlighter from 'react-native-highlight-words'; import { UserAvatar } from '../../../userAvatar'; import Tag from '../tag/tagView'; @@ -26,6 +27,7 @@ const UserListItem = ({ isFollowing = false, isLoadingRightAction = false, isLoggedIn, + searchValue, }) => { const _handleSubscribeButtonPress = () => { const _data = {}; @@ -45,7 +47,18 @@ const UserListItem = ({ {text || username} - {description && {description}} + {!!searchValue && ( + + )} + {description && !searchValue && ( + {description} + )} {middleText && ( diff --git a/src/screens/searchResult/screen/tabs/best/view/postsResults.js b/src/screens/searchResult/screen/tabs/best/view/postsResults.js index 861f760f0..b32dd1749 100644 --- a/src/screens/searchResult/screen/tabs/best/view/postsResults.js +++ b/src/screens/searchResult/screen/tabs/best/view/postsResults.js @@ -1,8 +1,7 @@ import React, { useState } from 'react'; -import { SafeAreaView, FlatList, View, Text, TouchableOpacity, Dimensions } from 'react-native'; +import { SafeAreaView, FlatList, View, Text, TouchableOpacity } from 'react-native'; import get from 'lodash/get'; import isUndefined from 'lodash/isUndefined'; -import FastImage from 'react-native-fast-image'; import { useIntl } from 'react-intl'; import Highlighter from 'react-native-highlight-words'; @@ -14,30 +13,19 @@ import { EmptyScreen, } from '../../../../../../components/basicUIElements'; import PostsResultsContainer from '../container/postsResultsContainer'; -import ProgressiveImage from '../../../../../../components/progressiveImage'; import { getTimeFromNow } from '../../../../../../utils/time'; import styles from './postsResultsStyles'; -const DEFAULT_IMAGE = - 'https://images.ecency.com/DQmT8R33geccEjJfzZEdsRHpP3VE8pu3peRCnQa1qukU4KR/no_image_3x.png'; - -const dim = Dimensions.get('window'); - const filterOptions = ['relevance', 'popularity', 'newest']; const PostsResults = ({ navigation, searchValue }) => { const intl = useIntl(); - const [calcImgHeight, setCalcImgHeight] = useState(300); const _renderItem = (item, index) => { const reputation = get(item, 'author_rep', undefined) || get(item, 'author_reputation', undefined); //console.log(item); - const image = get(item, 'img_url', DEFAULT_IMAGE) || get(item, 'image', DEFAULT_IMAGE); - const thumbnail = - get(item, 'thumbnail', DEFAULT_IMAGE) || - `https://images.ecency.com/6x5/${get(item, 'img_url', DEFAULT_IMAGE)}`; const votes = get(item, 'up_votes', 0) || get(item, 'stats.total_votes', 0); const body = get(item, 'summary', '') || get(item, 'body_marked', ''); @@ -50,16 +38,6 @@ const PostsResults = ({ navigation, searchValue }) => { size={36} content={item} /> - {image && thumbnail && ( - - )} {item.title} {!!body && ( @@ -68,7 +46,7 @@ const PostsResults = ({ navigation, searchValue }) => { searchWords={[searchValue]} textToHighlight={body.replace(//g, '').replace(/<\/mark>/g, '')} style={styles.summary} - numberOfLines={2} + numberOfLines={3} /> )} diff --git a/src/screens/searchResult/screen/tabs/people/view/peopleResults.js b/src/screens/searchResult/screen/tabs/people/view/peopleResults.js index 15330f976..5d142b0d0 100644 --- a/src/screens/searchResult/screen/tabs/people/view/peopleResults.js +++ b/src/screens/searchResult/screen/tabs/people/view/peopleResults.js @@ -40,6 +40,7 @@ const PeopleResults = ({ searchValue }) => { descriptionStyle={styles.descriptionStyle} isHasRightItem isLoggedIn + searchValue={searchValue} isLoadingRightAction={false} /> )}