Skip to content

Commit 1e4dd08

Browse files
Harun.KarahanUrazAkgultan
authored andcommitted
safeAreaView update
1 parent 33008b5 commit 1e4dd08

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,23 @@
11
import { createElement } from "react";
22
import { View } from "react-native";
33
import { flattenStyles } from "@mendix/piw-native-utils-internal";
4-
54
import { SafeAreaViewStyle, defaultSafeAreaViewStyle } from "./ui/Styles";
65
import { SafeAreaViewProps } from "../typings/SafeAreaViewProps";
7-
import { useSafeAreaInsets } from "react-native-safe-area-context";
6+
import { SafeAreaView as SafeAreaViewComponent } from "react-native-safe-area-context";
87

98
export const SafeAreaView = (props: SafeAreaViewProps<SafeAreaViewStyle>): JSX.Element => {
109
const styles = flattenStyles(defaultSafeAreaViewStyle, props.style);
11-
const insets = useSafeAreaInsets();
1210

1311
return (
14-
<View
15-
style={{
16-
flex: 1,
17-
...{
18-
backgroundColor: styles.container.backgroundColor,
19-
marginTop: insets.top,
20-
marginBottom: insets.bottom,
21-
marginLeft: insets.left,
22-
marginRight: insets.right
23-
}
24-
}}
12+
<SafeAreaViewComponent
13+
edges={["top", "left", "right"]}
14+
style={{ flex: 1, ...{ backgroundColor: styles.container.backgroundColor } }}
2515
pointerEvents={"box-none"}
2616
testID={props.name}
2717
>
2818
<View style={styles.container} pointerEvents={"box-none"}>
2919
{props.content}
3020
</View>
31-
</View>
21+
</SafeAreaViewComponent>
3222
);
3323
};

0 commit comments

Comments
 (0)