30 lines
1,021 B
TypeScript
Executable file
30 lines
1,021 B
TypeScript
Executable file
import tw from "../lib/tailwind";
|
|
import React from "react";
|
|
import { KeyboardAvoidingView, Platform, ScrollView, View, RefreshControl } from "react-native";
|
|
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
|
|
import { useRefresh } from "../lib/refresh-context";
|
|
import type { ReactParentComponent } from '@packages/shared';
|
|
|
|
function AppContainer(props: ReactParentComponent) {
|
|
const { children } = props;
|
|
const { refreshAll } = useRefresh();
|
|
|
|
return (
|
|
|
|
<KeyboardAwareScrollView
|
|
// contentContainerStyle={{ flexGrow: 1 }}
|
|
contentContainerStyle={{ flexGrow: 1, backgroundColor: 'white' }}
|
|
enableOnAndroid
|
|
// extraScrollHeight={20}
|
|
keyboardShouldPersistTaps="handled"
|
|
refreshControl={<RefreshControl refreshing={false} onRefresh={refreshAll} />}
|
|
automaticallyAdjustKeyboardInsets={true}
|
|
>
|
|
<View style={tw`p-4 bg-white flex-1`}>
|
|
{children}
|
|
</View>
|
|
</KeyboardAwareScrollView>
|
|
);
|
|
}
|
|
|
|
export default AppContainer;
|