Fix android crashes and add modal exit button
This commit is contained in:
28
src/screens/modals/Player/components/Backbutton.tsx
Normal file
28
src/screens/modals/Player/components/Backbutton.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import { useNavigation } from '@react-navigation/native';
|
||||
import XmarkIcon from 'assets/icons/xmark.svg';
|
||||
import { TouchableOpacity } from 'react-native';
|
||||
import styled from 'styled-components/native';
|
||||
|
||||
const Container = styled.View`
|
||||
padding: 6px 12px;
|
||||
`;
|
||||
|
||||
function BackButton() {
|
||||
const navigation = useNavigation();
|
||||
|
||||
const handlePress = useCallback(() => {
|
||||
console.log(navigation.canGoBack());
|
||||
navigation.goBack();
|
||||
}, [navigation]);
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<TouchableOpacity onPress={handlePress}>
|
||||
<XmarkIcon />
|
||||
</TouchableOpacity>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
export default BackButton;
|
||||
Reference in New Issue
Block a user