File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 99 StyleSheet ,
1010 TouchableHighlight ,
1111 TouchableOpacity ,
12+ BackHandler ,
1213} from 'react-native' ;
1314import {
1415 IconButton ,
@@ -54,6 +55,17 @@ function Filter(props) {
5455
5556 const { axiosInstance} = useAuth ( ) ;
5657
58+ const backAction = React . useCallback ( ( ) => {
59+ Animated . timing ( springAnim , {
60+ toValue : height + 100 ,
61+ duration : 256 ,
62+ useNativeDriver : true ,
63+ } ) . start ( ( ) => {
64+ close ( ) ;
65+ } ) ;
66+ return true ;
67+ } , [ close ] ) ;
68+
5769 React . useEffect ( ( ) => {
5870 const slideIn = ( ) => {
5971 Animated . spring ( springAnim , {
@@ -79,6 +91,13 @@ function Filter(props) {
7991 getSkills ( ) ;
8092 } , [ ] ) ;
8193
94+ React . useEffect ( ( ) => {
95+ BackHandler . addEventListener ( 'hardwareBackPress' , backAction ) ;
96+
97+ return ( ) =>
98+ BackHandler . removeEventListener ( 'hardwareBackPress' , backAction ) ;
99+ } , [ ] ) ;
100+
82101 const handleClose = ( ) => {
83102 Animated . timing ( springAnim , {
84103 toValue : height + 100 ,
You can’t perform that action at this time.
0 commit comments