mirror of
https://github.com/ecency/ecency-mobile.git
synced 2025-01-08 07:02:25 +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 = ({
|
const UserListItem = ({
|
||||||
rightText,
|
rightText,
|
||||||
description,
|
description,
|
||||||
|
descriptionStyle,
|
||||||
username,
|
username,
|
||||||
subRightText,
|
subRightText,
|
||||||
index,
|
index,
|
||||||
@ -44,7 +45,7 @@ const UserListItem = ({
|
|||||||
<UserAvatar noAction={true} style={styles.avatar} username={username} />
|
<UserAvatar noAction={true} style={styles.avatar} username={username} />
|
||||||
<View style={styles.userDescription}>
|
<View style={styles.userDescription}>
|
||||||
<Text style={styles.name}>{text || username}</Text>
|
<Text style={styles.name}>{text || username}</Text>
|
||||||
{description && <Text style={styles.date}>{description}</Text>}
|
{description && <Text style={[styles.date, descriptionStyle]}>{description}</Text>}
|
||||||
</View>
|
</View>
|
||||||
{middleText && (
|
{middleText && (
|
||||||
<View style={styles.middleWrapper}>
|
<View style={styles.middleWrapper}>
|
||||||
|
@ -2,6 +2,7 @@ import { useState, useEffect } from 'react';
|
|||||||
import get from 'lodash/get';
|
import get from 'lodash/get';
|
||||||
import { withNavigation } from 'react-navigation';
|
import { withNavigation } from 'react-navigation';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
import { shuffle } from 'lodash';
|
||||||
|
|
||||||
import ROUTES from '../../../../../../constants/routeNames';
|
import ROUTES from '../../../../../../constants/routeNames';
|
||||||
|
|
||||||
@ -18,26 +19,12 @@ const PeopleResultsContainer = (props) => {
|
|||||||
setNoResult(false);
|
setNoResult(false);
|
||||||
setUsers([]);
|
setUsers([]);
|
||||||
|
|
||||||
if (searchValue) {
|
searchAccount(searchValue, 20, searchValue ? 0 : 1).then((res) => {
|
||||||
searchAccount(searchValue, 20, 1).then((res) => {
|
|
||||||
if (res.length === 0) {
|
if (res.length === 0) {
|
||||||
setNoResult(true);
|
setNoResult(true);
|
||||||
}
|
}
|
||||||
setUsers(res);
|
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);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [searchValue]);
|
}, [searchValue]);
|
||||||
|
|
||||||
// Component Functions
|
// Component Functions
|
||||||
|
@ -38,6 +38,12 @@ const PeopleResults = ({ navigation, searchValue }) => {
|
|||||||
handleOnPress={() => handleOnPress(item)}
|
handleOnPress={() => handleOnPress(item)}
|
||||||
index={index}
|
index={index}
|
||||||
username={item.name}
|
username={item.name}
|
||||||
|
text={`@${item.name} ${item.full_name}`}
|
||||||
|
description={item.about}
|
||||||
|
descriptionStyle={styles.descriptionStyle}
|
||||||
|
isHasRightItem
|
||||||
|
isLoggedIn
|
||||||
|
isLoadingRightAction={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
ListEmptyComponent={_renderEmptyContent}
|
ListEmptyComponent={_renderEmptyContent}
|
||||||
|
@ -45,4 +45,9 @@ export default EStyleSheet.create({
|
|||||||
marginLeft: 15,
|
marginLeft: 15,
|
||||||
color: '$primaryBlack',
|
color: '$primaryBlack',
|
||||||
},
|
},
|
||||||
|
descriptionStyle: {
|
||||||
|
maxWidth: '$deviceWidth',
|
||||||
|
marginTop: 4,
|
||||||
|
marginRight: 24,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user