@@ -55,8 +55,6 @@ interface LocationProps {
55
55
}
56
56
57
57
const DEFAULT_DIRECTION = PanningProvider . Directions . DOWN ;
58
- const TOP_INSET = Constants . isIphoneX ? Constants . getSafeAreaInsets ( ) . top : Constants . isIOS ? 20 : 0 ;
59
- const BOTTOM_INSET = Constants . isIphoneX ? Constants . getSafeAreaInsets ( ) . bottom : Constants . isIOS ? 20 : 0 ;
60
58
61
59
const DialogDismissibleView = ( props : Props ) => {
62
60
const { direction = DEFAULT_DIRECTION , visible : propsVisible , containerStyle, style, children, onDismiss} = props ;
@@ -65,6 +63,8 @@ const DialogDismissibleView = (props: Props) => {
65
63
66
64
const width = useRef < number > ( Constants . screenWidth ) ;
67
65
const height = useRef < number > ( Constants . screenHeight ) ;
66
+ const TOP_INSET = useRef < number > ( Constants . isIphoneX ? Constants . getSafeAreaInsets ( ) . top : Constants . isIOS ? 20 : 0 ) ;
67
+ const BOTTOM_INSET = useRef < number > ( Constants . isIphoneX ? Constants . getSafeAreaInsets ( ) . bottom : Constants . isIOS ? 20 : 0 ) ;
68
68
const thresholdX = useRef < number > ( 0 ) ;
69
69
const thresholdY = useRef < number > ( 0 ) ;
70
70
const dragsCounter = useRef < number > ( 0 ) ;
@@ -85,11 +85,11 @@ const DialogDismissibleView = (props: Props) => {
85
85
result . left = Constants . screenWidth - left ;
86
86
break ;
87
87
case PanningProvider . Directions . UP :
88
- result . top = - top - height . current - TOP_INSET ;
88
+ result . top = - top - height . current - TOP_INSET . current ;
89
89
break ;
90
90
case PanningProvider . Directions . DOWN :
91
91
default :
92
- result . top = Constants . screenHeight - top + BOTTOM_INSET ;
92
+ result . top = Constants . screenHeight - top + BOTTOM_INSET . current ;
93
93
break ;
94
94
}
95
95
0 commit comments