MCPcopy
hub / github.com/BlueWallet/BlueWallet / SafeArea

Function SafeArea

components/SafeArea.tsx:13–46  ·  view source on GitHub ↗
(props: SafeAreaProps)

Source from the content-addressed store, hash-verified

11}
12
13const SafeArea = (props: SafeAreaProps) => {
14 const { style, floatingButtonHeight, ignoreTopInset = false, ...otherProps } = props;
15 const { colors } = useTheme();
16 const insets = useSafeAreaInsets();
17
18 const padding = useMemo(
19 () =>
20 props.orientation === 'portrait'
21 ? {
22 paddingTop: ignoreTopInset ? 0 : insets.top,
23 paddingBottom: insets.bottom,
24 }
25 : {
26 paddingTop: ignoreTopInset ? 0 : insets.top,
27 paddingBottom: insets.bottom + (floatingButtonHeight ?? 0),
28 paddingLeft: insets.left,
29 paddingRight: insets.right,
30 },
31 [insets, props.orientation, floatingButtonHeight, ignoreTopInset],
32 );
33
34 const componentStyle = useMemo(() => {
35 return StyleSheet.compose(
36 {
37 flex: 1,
38 backgroundColor: colors.background,
39 ...padding,
40 },
41 style,
42 );
43 }, [colors.background, padding, style]);
44
45 return <View style={componentStyle} {...otherProps} />;
46};
47
48export default SafeArea;

Callers

nothing calls this directly

Calls 1

useThemeFunction · 0.90

Tested by

no test coverage detected