Quick fix on keyboard on ios

This commit is contained in:
Adolfo Reyna
2023-01-25 14:41:48 -05:00
parent 03e20edbcc
commit 6b8f9a56c5
3 changed files with 17 additions and 17 deletions

4
App.js
View File

@@ -18,7 +18,7 @@ import * as Notifications from 'expo-notifications';
import API from './API.js'; import API from './API.js';
import i18n from "./i18nMessages.js"; import i18n from "./i18nMessages.js";
import NewPostView from './Views/NewPost.js'; import NewPostView from './Views/NewPost.js';
import { TouchableOpacity, View, Image } from 'react-native'; import { TouchableOpacity, View, Image, KeyboardAvoidingView } from 'react-native';
import MenuView from './Views/Menu.js'; import MenuView from './Views/Menu.js';
import ProfileSettings from './Views/ProfileSettings.js'; import ProfileSettings from './Views/ProfileSettings.js';
import InviteView from './Views/Invite.js'; import InviteView from './Views/Invite.js';
@@ -245,6 +245,7 @@ export default function App() {
<PaperProvider settings={{ <PaperProvider settings={{
icon: props => <MaterialIcons {...props} />, icon: props => <MaterialIcons {...props} />,
}} theme={theme}> }} theme={theme}>
<KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : 'height'} style={{flex: 1}}>
<NavigationContainer> <NavigationContainer>
<StatusBar style="dark" /> <StatusBar style="dark" />
<Stack.Navigator screenOptions={{ <Stack.Navigator screenOptions={{
@@ -304,6 +305,7 @@ export default function App() {
</Stack.Navigator> </Stack.Navigator>
</NavigationContainer> </NavigationContainer>
<MediaView></MediaView> <MediaView></MediaView>
</KeyboardAvoidingView>
</PaperProvider> </PaperProvider>
); );
} }

View File

@@ -4,29 +4,29 @@ import { StyleSheet, Text, View, TextInput, SafeAreaView } from 'react-native';
import API from './../API.js'; import API from './../API.js';
import LoginForm from './../components/Login.js'; import LoginForm from './../components/Login.js';
export default function App({navigation, route}) { export default function App({ navigation, route }) {
useEffect(()=>{ useEffect(() => {
getData = async () => { getData = async () => {
let r = await API.isLoggedIn(); let r = await API.isLoggedIn();
if(r){ if (r) {
await API.logout(); await API.logout();
navigation.navigate('Login') navigation.navigate('Login')
} }
} }
getData(); getData();
return ()=>{ return () => {
} }
}, []); }, []);
return ( return (
<SafeAreaView style={styles.container}> <SafeAreaView style={styles.container}>
<LoginForm /> <LoginForm />
<StatusBar style="auto" /> <StatusBar style="auto" />
<View style={{position:"absolute", top:30, left: 10, opacity: 0.5}}> <View style={{ position: "absolute", top: 30, left: 10, opacity: 0.5 }}>
<Text>{"<- Not an EMI family memeber?"}</Text> <Text>{"<- Not an EMI family memeber?"}</Text>
</View> </View>
</SafeAreaView> </SafeAreaView>
); );
} }

View File

@@ -102,8 +102,7 @@ let NewPostView = (props) => {
} }
return ( return (
<SafeAreaView> <View style={{ padding: 10, paddingTop: 20, flex:1, justifyContent:"center"}}>
<View style={{ padding: 10}}>
<View style={{ flexDirection: "row", marginBottom: 10, justifyContent: "space-around" }}> <View style={{ flexDirection: "row", marginBottom: 10, justifyContent: "space-around" }}>
<Text style={{ fontSize: 25 }}>{i18n.t("message.statusUpdate")}:</Text> <Text style={{ fontSize: 25 }}>{i18n.t("message.statusUpdate")}:</Text>
<Button icon="send" mode="outlined" onPress={handleNewPostButton}> <Button icon="send" mode="outlined" onPress={handleNewPostButton}>
@@ -127,7 +126,7 @@ let NewPostView = (props) => {
textAlignVertical: "center", textAlignVertical: "center",
textAlign: "center", textAlign: "center",
fontSize: 20, fontSize: 20,
minHeight: 200 minHeight: 100
}} }}
autoFocus={true} autoFocus={true}
/> />
@@ -152,7 +151,6 @@ let NewPostView = (props) => {
) )
} }
</View> </View>
</SafeAreaView>
) )
} }