2022-06-24 20:51:19 +00:00
|
|
|
import React from 'react';
|
2022-07-14 13:46:29 +00:00
|
|
|
import { View, Pressable } from 'react-native';
|
2022-06-24 20:51:19 +00:00
|
|
|
|
|
|
|
import { useTheme } from '../../theme';
|
|
|
|
import { CustomIcon } from '../CustomIcon';
|
|
|
|
import styles from './styles';
|
|
|
|
import { IFooterProps } from './interfaces';
|
|
|
|
|
2022-06-28 14:41:52 +00:00
|
|
|
const BUTTON_HIT_SLOP = { top: 15, right: 15, bottom: 15, left: 15 };
|
|
|
|
|
2022-07-20 12:29:18 +00:00
|
|
|
const Footer = ({ onSearchPressed, onBackspacePressed }: IFooterProps): React.ReactElement => {
|
2022-06-24 20:51:19 +00:00
|
|
|
const { colors } = useTheme();
|
|
|
|
return (
|
|
|
|
<View style={[styles.footerContainer, { backgroundColor: colors.bannerBackground }]}>
|
2022-07-20 12:29:18 +00:00
|
|
|
<Pressable
|
|
|
|
onPress={onSearchPressed}
|
|
|
|
hitSlop={BUTTON_HIT_SLOP}
|
|
|
|
style={({ pressed }) => [[styles.footerButtonsContainer, { opacity: pressed ? 0.7 : 1 }]]}>
|
2022-07-14 13:46:29 +00:00
|
|
|
<CustomIcon color={colors.auxiliaryTintColor} size={24} name='search' />
|
2022-07-20 12:29:18 +00:00
|
|
|
</Pressable>
|
2022-06-24 20:51:19 +00:00
|
|
|
|
2022-07-14 13:46:29 +00:00
|
|
|
<Pressable onPress={onBackspacePressed} hitSlop={BUTTON_HIT_SLOP} style={({ pressed }) => [{ opacity: pressed ? 0.7 : 1 }]}>
|
2022-07-14 14:52:49 +00:00
|
|
|
<CustomIcon color={colors.auxiliaryTintColor} size={24} name='backspace' />
|
2022-07-14 13:46:29 +00:00
|
|
|
</Pressable>
|
2022-06-24 20:51:19 +00:00
|
|
|
</View>
|
|
|
|
);
|
2022-07-20 12:29:18 +00:00
|
|
|
};
|
2022-06-24 20:51:19 +00:00
|
|
|
|
|
|
|
export default Footer;
|