mirror of
https://github.com/ecency/ecency-mobile.git
synced 2025-01-05 12:36:31 +03:00
Change design of the peopleResultsView
This commit is contained in:
parent
09cdfb2d3e
commit
c46b699b62
@ -8,6 +8,7 @@ import styles from './userListItemStyles';
|
||||
const UserListItem = ({
|
||||
rightText,
|
||||
description,
|
||||
descriptionStyle,
|
||||
username,
|
||||
subRightText,
|
||||
index,
|
||||
@ -44,7 +45,7 @@ const UserListItem = ({
|
||||
<UserAvatar noAction={true} style={styles.avatar} username={username} />
|
||||
<View style={styles.userDescription}>
|
||||
<Text style={styles.name}>{text || username}</Text>
|
||||
{description && <Text style={styles.date}>{description}</Text>}
|
||||
{description && <Text style={[styles.date, descriptionStyle]}>{description}</Text>}
|
||||
</View>
|
||||
{middleText && (
|
||||
<View style={styles.middleWrapper}>
|
||||
|
@ -2,6 +2,7 @@ import { useState, useEffect } from 'react';
|
||||
import get from 'lodash/get';
|
||||
import { withNavigation } from 'react-navigation';
|
||||
import { connect } from 'react-redux';
|
||||
import { shuffle } from 'lodash';
|
||||
|
||||
import ROUTES from '../../../../../../constants/routeNames';
|
||||
|
||||
@ -18,26 +19,12 @@ const PeopleResultsContainer = (props) => {
|
||||
setNoResult(false);
|
||||
setUsers([]);
|
||||
|
||||
if (searchValue) {
|
||||
searchAccount(searchValue, 20, 1).then((res) => {
|
||||
if (res.length === 0) {
|
||||
setNoResult(true);
|
||||
}
|
||||
setUsers(res);
|
||||
});
|
||||
} else {
|
||||
getLeaderboard().then((result) => {
|
||||
const sos = result.map((item) => {
|
||||
item.name = item._id;
|
||||
|
||||
return item;
|
||||
});
|
||||
if (sos.length === 0) {
|
||||
setNoResult(true);
|
||||
}
|
||||
setUsers(sos);
|
||||
});
|
||||
}
|
||||
searchAccount(searchValue, 20, searchValue ? 0 : 1).then((res) => {
|
||||
if (res.length === 0) {
|
||||
setNoResult(true);
|
||||
}
|
||||
setUsers(res);
|
||||
});
|
||||
}, [searchValue]);
|
||||
|
||||
// Component Functions
|
||||
|
@ -38,6 +38,12 @@ const PeopleResults = ({ navigation, searchValue }) => {
|
||||
handleOnPress={() => handleOnPress(item)}
|
||||
index={index}
|
||||
username={item.name}
|
||||
text={`@${item.name} ${item.full_name}`}
|
||||
description={item.about}
|
||||
descriptionStyle={styles.descriptionStyle}
|
||||
isHasRightItem
|
||||
isLoggedIn
|
||||
isLoadingRightAction={false}
|
||||
/>
|
||||
)}
|
||||
ListEmptyComponent={_renderEmptyContent}
|
||||
|
@ -45,4 +45,9 @@ export default EStyleSheet.create({
|
||||
marginLeft: 15,
|
||||
color: '$primaryBlack',
|
||||
},
|
||||
descriptionStyle: {
|
||||
maxWidth: '$deviceWidth',
|
||||
marginTop: 4,
|
||||
marginRight: 24,
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user