2021-10-20 19:29:21 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React from 'react';
|
2021-11-11 14:32:56 +00:00
|
|
|
import { TouchableOpacity } from 'react-native-gesture-handler';
|
2021-10-20 19:29:21 +00:00
|
|
|
|
|
|
|
import { Icon } from '../../../base/icons';
|
|
|
|
|
|
|
|
import styles from './styles';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback to invoke when the {@code HeaderNavigationButton} is clicked/pressed.
|
|
|
|
*/
|
|
|
|
onPress: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The ImageSource to be rendered as image.
|
|
|
|
*/
|
|
|
|
src: Object,
|
|
|
|
|
|
|
|
/**
|
2021-11-04 21:10:43 +00:00
|
|
|
* The component's external style.
|
2021-10-20 19:29:21 +00:00
|
|
|
*/
|
2021-11-11 14:32:56 +00:00
|
|
|
style?: Object
|
2021-10-20 19:29:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const HeaderNavigationButton = ({ onPress, src, style }: Props) => (
|
2021-11-11 14:32:56 +00:00
|
|
|
<TouchableOpacity
|
|
|
|
onPress = { onPress }
|
|
|
|
style = { styles.headerNavigationButton } >
|
2021-10-20 19:29:21 +00:00
|
|
|
<Icon
|
|
|
|
size = { 20 }
|
|
|
|
src = { src }
|
2021-11-11 14:32:56 +00:00
|
|
|
style = { [ styles.headerNavigationIcon, style ] } />
|
|
|
|
</TouchableOpacity>
|
2021-10-20 19:29:21 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
export default HeaderNavigationButton;
|