freshyo/packages/ui/src/components/app-container.tsx
2026-09-05 11:12:47 +05:30

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;