From f8eb6e73c3006babf4730650eeb11d50af401014 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 15 Oct 2020 18:54:09 -0300 Subject: [PATCH] Adding top padding ot prevent notch cut --- examples/components/Panel/Panel.tsx | 17 +++++++++-------- src/Panel.tsx | 17 +++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/examples/components/Panel/Panel.tsx b/examples/components/Panel/Panel.tsx index 10a3014..79dbe9e 100644 --- a/examples/components/Panel/Panel.tsx +++ b/examples/components/Panel/Panel.tsx @@ -1,21 +1,22 @@ import React, {Component} from 'react'; import { - StyleSheet, - ScrollView, - View, - TouchableHighlight, - TouchableWithoutFeedback, Animated, Dimensions, PanResponder, + ScrollView, + StyleSheet, + TouchableHighlight, + TouchableWithoutFeedback, + View, } from 'react-native'; - import {Bar} from './Bar'; import {Close} from './Close'; -let FULL_HEIGHT = Dimensions.get('window').height; +let NOTCH_PREVENTION = 14; + +let FULL_HEIGHT = Dimensions.get('window').height - NOTCH_PREVENTION; let FULL_WIDTH = Dimensions.get('window').width; -let PANEL_HEIGHT = FULL_HEIGHT - 100; +let PANEL_HEIGHT = FULL_HEIGHT - NOTCH_PREVENTION; const STATUS = { CLOSED: 0, diff --git a/src/Panel.tsx b/src/Panel.tsx index 31c07b0..c16db97 100644 --- a/src/Panel.tsx +++ b/src/Panel.tsx @@ -1,21 +1,22 @@ import * as React from 'react'; import { - StyleSheet, - ScrollView, - View, - TouchableHighlight, - TouchableWithoutFeedback, Animated, Dimensions, PanResponder, + ScrollView, + StyleSheet, + TouchableHighlight, + TouchableWithoutFeedback, + View, } from 'react-native'; - import { Bar } from './Bar'; import { Close } from './Close'; -let FULL_HEIGHT = Dimensions.get('window').height; +let NOTCH_PREVENTION = 14; + +let FULL_HEIGHT = Dimensions.get('window').height - NOTCH_PREVENTION; let FULL_WIDTH = Dimensions.get('window').width; -let PANEL_HEIGHT = FULL_HEIGHT - 100; +let PANEL_HEIGHT = FULL_HEIGHT - NOTCH_PREVENTION; const STATUS = { CLOSED: 0,