Adding popular posts

This commit is contained in:
Adolfo Reyna
2023-10-20 10:10:47 -07:00
parent 6097bc0381
commit 8abc441cf5
3 changed files with 162 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
import { StyleSheet, SafeAreaView, FlatList } from 'react-native';
import API from './../API.js';
import Post from './../components/Post.js';
import PostPopularUsers from '../components/PostPopularUsers.js';
import GlobalState from '../contexts/GlobalState.js';
import * as Linking from 'expo-linking';
@@ -98,8 +99,12 @@ let Feed = ({ navigation, route }) => {
}
}, [route.params]);
const renderPost = (({ item }) => {
if (item.nonOrganicType === 'PopularUsers' || item.nonOrganicType === 'PopularGroups')
if (item.nonOrganicType === 'PopularUsers' || item.nonOrganicType === 'PopularGroups'){
if(item.nonOrganicType === 'PopularUsers'){
return (<PostPopularUsers post={item}/>)
}
return (<></>);
}
return (<Post post={item} />);
});