diff --git a/Views/Groups.js b/Views/Groups.js index 2d41a8b..ffccd40 100644 --- a/Views/Groups.js +++ b/Views/Groups.js @@ -101,7 +101,7 @@ export default Groups; const styles = StyleSheet.create({ container: { - padding: 5, + padding: 0, }, title: { padding: 10, diff --git a/Views/Profile.js b/Views/Profile.js index a61b383..97e1a31 100644 --- a/Views/Profile.js +++ b/Views/Profile.js @@ -34,6 +34,7 @@ let Profile = ({ navigation, route }) => { let [profile, setProfile] = useState({}); const [showNewPost, setShowNewPost] = useState(false); const [tag, setTag] = useState(''); + const [loading, setLoading] = useState(true); useEffect(() => { let subscribed = true; @@ -50,6 +51,7 @@ let Profile = ({ navigation, route }) => { await getProfilePosts(route.params.profileid).then(setPosts); console.log('Loaded Cache Profile:' + route.params.profileid); API.getPosts(route.params.profileid).then((data) => { + setLoading(false); if(!subscribed) return 0; setPosts(data); storeProfilePosts(route.params.profileid, data); @@ -135,20 +137,21 @@ let Profile = ({ navigation, route }) => { return ( - {(Posts.length !== 0 || profile._id) && + {(Posts.length !== 0 || profile._id) ? item.lastUpdated || item._id || item.ceatedAt} ListHeaderComponent={header} - refreshing={Posts.length === 0} + refreshing={loading} initialNumToRender={3} maxToRenderPerBatch={3} removeClippedSubviews={true} onRefresh={() => { API.getPosts(route.params.profileid).then(setPosts); }} - /> + /> : + <> //TODO: Add empty profile card here } diff --git a/Views/Search.js b/Views/Search.js index eec3cc2..96f0522 100644 --- a/Views/Search.js +++ b/Views/Search.js @@ -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 (); }); + const followers = viewer.following.slice().reverse().slice(0, 10); return ( { item} - ListHeaderComponent={Current Following} + ListHeaderComponent={Recently Following} /> } diff --git a/components/GroupCard.js b/components/GroupCard.js index 385e2fd..7e2ec35 100644 --- a/components/GroupCard.js +++ b/components/GroupCard.js @@ -6,6 +6,7 @@ import API from './../API.js'; import { useNavigation } from '@react-navigation/native'; import AsyncStorage from '@react-native-async-storage/async-storage'; import FollowButton from './basics/FollowButton.js'; +import ProfilePhotoCircle from './ProfilePhotoCircle.js'; const DefaultPhoto = "https://social.emmint.com/uploads/e6f9be6d665dc43417701bf16a90122c.png"; @@ -66,8 +67,9 @@ let ProfileCard = ({ profileid, hideIcon, profileObj }) => { right: 0, top: 0, }} /> + } description={profileObj.profile.description} //left={props => } titleStyle={{fontWeight:"bold", fontSize:20}} @@ -86,9 +88,10 @@ export default React.memo(ProfileCard); const styles = StyleSheet.create({ content: { - margin: 4, + margin: 0, padding: 0, - borderRadius: 5, + borderRadius: 0, + marginBottom: 2, }, centerItems: { justifyContent: 'center', diff --git a/components/Post.js b/components/Post.js index baa8455..561d4ee 100644 --- a/components/Post.js +++ b/components/Post.js @@ -63,23 +63,26 @@ let Post = (props) => { {!post.nonOrganicType ? - + {toProfileText} - + {" " + Moment(post.createdAt).fromNow()} - { cleanContent.length ? - {cleanContent} + {cleanContent.length ? + { + cleanContent + } : <> } - - + + : @@ -90,7 +93,7 @@ let Post = (props) => { } - +