diff --git a/App.js b/App.js index 0af2a54..f6cabac 100644 --- a/App.js +++ b/App.js @@ -109,7 +109,7 @@ const MainNavigation = () => { activeColor="#0d6efd" inactiveColor="#FFFFFF" barStyle={{ backgroundColor: '#000000' }} - sceneContainerStyle={{paddingBottom: 0}} + sceneContainerStyle={{paddingBottom: 0, paddingTop: 15}} > {<>}, + }} /> { - let r = await API.isLoggedIn(); - if(r){ - await API.logout(); - navigation.navigate('Login') + useEffect(()=>{ + getData = async () => { + let r = await API.isLoggedIn(); + if(r){ + await API.logout(); + navigation.navigate('Login') + } + } + getData(); + return ()=>{ + } }, []); diff --git a/Views/Profile.js b/Views/Profile.js index f48af8e..e2f649e 100644 --- a/Views/Profile.js +++ b/Views/Profile.js @@ -19,7 +19,6 @@ const getProfilePosts = async (profileid) => { try { const value = await AsyncStorage.getItem('profile_' + profileid) if (value !== null) { - console.log(JSON.parse(value)) return JSON.parse(value); } return []; @@ -61,7 +60,7 @@ let Profile = ({ navigation, route }) => { return ()=>{ subscribed = false; } - }, [route.params]); + }, [route.params?.profileid]); const renderPost = (({ item }) => { if (item.nonOrganicType) return (<>); diff --git a/components/Login.js b/components/Login.js index 3ed939e..219b49c 100644 --- a/components/Login.js +++ b/components/Login.js @@ -34,6 +34,7 @@ let LoginForm = () => { onChangeText={text => setEmail(text)} defaultValue={email} placeholder="email" + label="email:" autoCapitalize='none' autoComplete='email' autoCorrect={false} @@ -45,6 +46,7 @@ let LoginForm = () => { defaultValue={password} placeholder="password" textContentType="password" + label="password:" secureTextEntry={true} autoCapitalize='none' autoComplete='email' @@ -68,7 +70,7 @@ const styles = StyleSheet.create({ backgroundColor: 'white', flex: 1, flexDirection: "column", - justifyContent: "flex-start", + justifyContent: "center", padding: 15, width: "100%", alignContent: 'center', diff --git a/components/Post.js b/components/Post.js index b84e92b..b10285b 100644 --- a/components/Post.js +++ b/components/Post.js @@ -1,7 +1,7 @@ -import React, { useState, useEffect } from 'react'; -import { Text, ScrollView, FlatList, StyleSheet, View, Linking } from 'react-native'; +import React, { useState } from 'react'; +import { Text, ScrollView, FlatList, StyleSheet, View } from 'react-native'; import Hyperlink from 'react-native-hyperlink' -import { Avatar, Button, Card, Title, Chip } from 'react-native-paper'; +import { Button, Card, Chip } from 'react-native-paper'; import API from './../API.js'; import UserName from './UserName.js'; import Media from './Media.js'; @@ -62,7 +62,7 @@ let Post = (props) => { {!post.nonOrganicType ? - + {toProfileText} {" " + Moment(post.createdAt).fromNow()} diff --git a/components/UserName.js b/components/UserName.js index b9aef30..982705b 100644 --- a/components/UserName.js +++ b/components/UserName.js @@ -36,7 +36,8 @@ let UserName = ({ profileid, hideIcon }) => { let p = await API.getUserProfile(profileid).catch(() => { return {} }); if (subscribed) setProfile(p); - storeName(profileid, p) + storeName(profileid, p); + console.log("Fetching Name:" + p?.profile?.firstName); } getData(); return () => {