/* Dependencies */ import React, { Fragment } from 'react' import { StyleSheet, Text, View } from 'react-native' /* Libraries */ import { Surface, useTheme, TouchableRipple } from 'react-native-paper' import Icon from 'react-native-vector-icons/Ionicons' /* Types */ interface Option { disabled?: boolean icon: string key: string title: string } type Props = { backgroundColor?: string iconStyle?: { disabledColor?: string, focusedColor?: string, unfocusedColor?: string, }, onTabClick: () => void options: Option[] setTab: React.Dispatch> tab: string textStyle?: { disabledColor?: string, focusedColor?: string, unfocusedColor?: string, } } const TabBottom = ({ backgroundColor, iconStyle, onTabClick = () => {}, options, setTab, tab, textStyle }: Props) => { /* Styles */ const { colors } = useTheme({ colors: { accent: '#f9f9f9', disabled: '#d9d4d4' } }) const styles = StyleSheet.create({ container: { backgroundColor: backgroundColor ?? colors.primary, alignSelf: 'center', borderRadius: 15, bottom: 15, display: 'flex', height: 60, flexDirection: 'row', position: 'absolute', width: '95%' }, text: { fontSize: 12 }, view: { alignItems: 'center', display: 'flex', flex: 1, justifyContent: 'center' }, wrapper: { alignItems: 'center', display: 'flex', flex: 1, justifyContent: 'center' } }) return ( {options.map((item) => ( { setTab(item.key) onTabClick() }} style={styles.wrapper}> {item.title} ))} ) } TabBottom.displayName = 'Tab.Bottom' export default TabBottom