File tree Expand file tree Collapse file tree
packages/pluggableWidgets/safe-area-view-native/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { createElement } from "react" ;
22import { View } from "react-native" ;
33import { flattenStyles } from "@mendix/piw-native-utils-internal" ;
4-
54import { SafeAreaViewStyle , defaultSafeAreaViewStyle } from "./ui/Styles" ;
65import { 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
98export 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} ;
You can’t perform that action at this time.
0 commit comments