Some more UI changes for circle profile

This commit is contained in:
Adolfo Reyna
2023-07-22 22:52:24 -04:00
parent 919cd4be3b
commit 0c8aa9fc21
7 changed files with 65 additions and 46 deletions

View File

@@ -15,10 +15,12 @@ const Search = () => {
useEffect(() => {
let subscribed = true;
API.searchProfiles('').then((data) => {
if (subscribed)
setProfiles(data.profiles || []);
});
// Igonred as we are using following
//API.searchProfiles('').then((data) => {
// if (subscribed && data.profiles){
// setProfiles(filteredProfiles);
// }
//});
return () => {
subscribed = false;
}
@@ -29,6 +31,7 @@ const Search = () => {
if (queryTimer) clearTimeout(queryTimer);
let timerId = setTimeout(() => {
API.searchProfiles(query).then((data) => {
console.log("DataChange Search view")
setProfiles(data.profiles || []);
});
}, 300);
@@ -40,6 +43,7 @@ const Search = () => {
const renderFollowing = (({ item }) => {
return (<ProfileCardHorizontal profileid={item} />);
});
const followers = viewer.following.slice().reverse().slice(0, 10);
return (
<SafeAreaView style={{ flex: 1, backgroundColor: "#edf2f7", }}>
<Searchbar
@@ -59,10 +63,10 @@ const Search = () => {
<FlatList
contentContainerStyle={styles.container}
numColumns={1}
data={viewer.following}
data={followers}
renderItem={renderFollowing}
keyExtractor={item => item}
ListHeaderComponent={<Text style={{fontSize:20, padding:10, alignSelf: "center"}}>Current Following</Text>}
ListHeaderComponent={<Text style={{fontSize:20, padding:10, alignSelf: "center"}}>Recently Following</Text>}
/>
}
</SafeAreaView>