@@ -5,6 +5,7 @@ import type {BackdropProps} from '@components/Modal/BottomDockedModal/types';
5
5
import { PressableWithoutFeedback } from '@components/Pressable' ;
6
6
import useLocalize from '@hooks/useLocalize' ;
7
7
import useThemeStyles from '@hooks/useThemeStyles' ;
8
+ import variables from '@styles/variables' ;
8
9
import CONST from '@src/CONST' ;
9
10
10
11
const easing = Easing . bezier ( 0.76 , 0.0 , 0.24 , 1.0 ) . factory ( ) ;
@@ -15,6 +16,7 @@ function Backdrop({
15
16
onBackdropPress,
16
17
animationInTiming = CONST . MODAL . ANIMATION_TIMING . DEFAULT_IN ,
17
18
animationOutTiming = CONST . MODAL . ANIMATION_TIMING . DEFAULT_OUT ,
19
+ backdropOpacity = variables . overlayOpacity ,
18
20
} : BackdropProps ) {
19
21
const styles = useThemeStyles ( ) ;
20
22
const { translate} = useLocalize ( ) ;
@@ -43,6 +45,13 @@ function Backdrop({
43
45
return FadeOut . duration ( animationOutTiming ) ;
44
46
} , [ animationOutTiming ] ) ;
45
47
48
+ const backdropStyle = useMemo (
49
+ ( ) => ( {
50
+ opacity : backdropOpacity ,
51
+ } ) ,
52
+ [ backdropOpacity ] ,
53
+ ) ;
54
+
46
55
if ( ! customBackdrop ) {
47
56
return (
48
57
< PressableWithoutFeedback
@@ -51,7 +60,7 @@ function Backdrop({
51
60
onPress = { onBackdropPress }
52
61
>
53
62
< Animated . View
54
- style = { [ styles . modalBackdrop , style ] }
63
+ style = { [ styles . modalBackdrop , backdropStyle , style ] }
55
64
entering = { Entering }
56
65
exiting = { Exiting }
57
66
/>
@@ -64,7 +73,7 @@ function Backdrop({
64
73
entering = { Entering }
65
74
exiting = { Exiting }
66
75
>
67
- < View style = { [ styles . modalBackdrop , style ] } > { ! ! customBackdrop && customBackdrop } </ View >
76
+ < View style = { [ styles . modalBackdrop , backdropStyle , style ] } > { ! ! customBackdrop && customBackdrop } </ View >
68
77
</ Animated . View >
69
78
) ;
70
79
}
0 commit comments