2022-06-09 23:37:07 +02:00
|
|
|
import React, { useCallback } from 'react';
|
|
|
|
|
import { useNavigation } from '@react-navigation/native';
|
2023-06-19 23:03:17 +02:00
|
|
|
import XmarkIcon from '@/assets/icons/xmark.svg';
|
2022-06-09 23:37:07 +02:00
|
|
|
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(() => {
|
|
|
|
|
navigation.goBack();
|
|
|
|
|
}, [navigation]);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Container>
|
|
|
|
|
<TouchableOpacity onPress={handlePress}>
|
|
|
|
|
<XmarkIcon />
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
</Container>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default BackButton;
|