Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const SafeAreaLayout = (props: SafeAreaLayoutProps): LayoutElement => {
const theme: ThemeType = useTheme();
const safeAreaInsets: EdgeInsets = useSafeArea();
const { insets, style, ...layoutProps } = props;
const toStyleProp = (inset: SaveAreaInset): ViewStyle => {
switch (inset) {
case SaveAreaInset.BOTTOM:
return { paddingBottom: safeAreaInsets.bottom };
case SaveAreaInset.TOP:
return {
backgroundColor: theme['background-basic-color-3'],
paddingTop: safeAreaInsets.top,
};
}
};