From 1c2d2ab1ca55ce1418d185740aebef955a05b770 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Sun, 31 May 2020 17:18:53 +0200 Subject: [PATCH] Fixed padding breaking other components offsets --- App.js | 9 +++---- src/components/Tabbar/CustomTabBar.js | 36 ++++++++++++--------------- src/utils/withSafeArea.js | 14 ----------- 3 files changed, 19 insertions(+), 40 deletions(-) delete mode 100644 src/utils/withSafeArea.js diff --git a/App.js b/App.js index 1daf54a..6a20c0f 100644 --- a/App.js +++ b/App.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import {Platform, StatusBar, View, YellowBox} from 'react-native'; +import {Platform, SafeAreaView, StatusBar, View, YellowBox} from 'react-native'; import LocaleManager from './src/managers/LocaleManager'; import AsyncStorageManager from "./src/managers/AsyncStorageManager"; import CustomIntroSlider from "./src/components/Overrides/CustomIntroSlider"; @@ -17,7 +17,6 @@ import URLHandler from "./src/utils/URLHandler"; import {setSafeBounceHeight} from "react-navigation-collapsible"; import SplashScreen from 'react-native-splash-screen' import {OverflowMenuProvider} from "react-navigation-header-buttons"; -import {SafeAreaProvider} from "react-native-safe-area-context"; // Native optimizations https://reactnavigation.org/docs/react-native-screens // Crashes app when navigating away from webview on android 9+ @@ -193,16 +192,14 @@ export default class App extends React.Component { - + - + diff --git a/src/components/Tabbar/CustomTabBar.js b/src/components/Tabbar/CustomTabBar.js index 12ee0da..9909ded 100644 --- a/src/components/Tabbar/CustomTabBar.js +++ b/src/components/Tabbar/CustomTabBar.js @@ -3,8 +3,6 @@ import {withTheme} from 'react-native-paper'; import TabIcon from "./TabIcon"; import TabHomeIcon from "./TabHomeIcon"; import {Animated} from 'react-native'; -import {withSafeArea} from "../../utils/withSafeArea"; -import {EdgeInsets} from "react-native-safe-area-context"; type Props = { state: Object, @@ -12,7 +10,6 @@ type Props = { navigation: Object, theme: Object, collapsibleStack: Object, - safeArea: EdgeInsets } type State = { @@ -130,24 +127,23 @@ class CustomTabBar extends React.Component { render() { this.props.navigation.addListener('state', this.onRouteChange); return ( - - {this.props.state.routes.map(this.renderIcon)} - + + {this.props.state.routes.map(this.renderIcon)} + ); } } -export default withSafeArea(withTheme(CustomTabBar)); +export default withTheme(CustomTabBar); diff --git a/src/utils/withSafeArea.js b/src/utils/withSafeArea.js deleted file mode 100644 index dfbe533..0000000 --- a/src/utils/withSafeArea.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import {useSafeArea} from 'react-native-safe-area-context'; - -export const withSafeArea = (Component: any) => { - return React.forwardRef((props: any, ref: any) => { - let safeArea = useSafeArea(); - // safeArea.bottom = 0; - return ; - }); -};