import React from 'react'; import { TouchableRipple, useTheme } from 'react-native-paper'; import { StyleSheet, View } from 'react-native'; import * as Animatable from 'react-native-animatable'; import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'; import GENERAL_STYLES from '../../constants/Styles'; interface Props { focused: boolean; label: string | undefined; icon: string; focusedIcon: string; onPress: () => void; } Animatable.initializeRegistryWithDefinitions({ focusIn: { 0: { // @ts-ignore scale: 1, translateY: 0, }, 0.4: { // @ts-ignore scale: 1.3, translateY: 6, }, 0.6: { // @ts-ignore scale: 1.1, translateY: 6, }, 0.8: { // @ts-ignore scale: 1.25, translateY: 6, }, 1: { // @ts-ignore scale: 1.2, translateY: 6, }, }, focusOut: { 0: { // @ts-ignore scale: 1.2, translateY: 6, }, 1: { // @ts-ignore scale: 1, translateY: 0, }, }, }); function TabSideIcon(props: Props) { const theme = useTheme(); const color = props.focused ? theme.colors.primary : theme.colors.disabled; let icon = props.focused ? props.focusedIcon : props.icon; return ( {props.label} ); } const styles = StyleSheet.create({ ripple: { flex: 1, justifyContent: 'center', }, text: { ...GENERAL_STYLES.centerHorizontal, fontSize: 10, }, }); export default TabSideIcon;