32 lines
822 B
JavaScript
32 lines
822 B
JavaScript
import { View, Text, Platform } from "react-native";
|
|
import React from "react";
|
|
import { KeyboardAvoidingView } from "react-native";
|
|
import { StyleSheet } from "react-native";
|
|
import { TouchableWithoutFeedback } from "react-native";
|
|
import { Keyboard } from "react-native";
|
|
|
|
const KeyboardAvoidingComponent = ({ children }) => {
|
|
return (
|
|
<KeyboardAvoidingView
|
|
enabled
|
|
behavior={Platform.OS === "ios" ? "padding":"height" }
|
|
style={styles.container}
|
|
>
|
|
{/* <TouchableWithoutFeedback onPress={Keyboard.dismiss}> */}
|
|
<View style={styles.inner}>{children}</View>
|
|
{/* </TouchableWithoutFeedback> */}
|
|
</KeyboardAvoidingView>
|
|
);
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
},
|
|
inner: {
|
|
flex: 1,
|
|
},
|
|
});
|
|
|
|
export default KeyboardAvoidingComponent;
|