Last active
August 7, 2017 18:08
-
-
Save Renatello/3424c5f900d2738db19d1425c9344d10 to your computer and use it in GitHub Desktop.
React native tab bar icon with title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TabIcon = ({ selected, title, icon }) => { | |
const selectColor = selected ? AppColors.tabbar.iconSelected : AppColors.tabbar.iconDefault; | |
return ( | |
<View> | |
<Icon | |
name={icon} | |
size={26} | |
color={selectColor} | |
/> | |
<Text>{title}</Text> | |
</View> | |
); | |
} | |
<Scene | |
key={'map'} | |
{...navbarPropsTabs} | |
title={'Map'} | |
icon={props => TabIcon({ ...props, icon: 'location-on', title: 'Map' })} | |
analyticsDesc={'Map'} | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment