Kureev / react-native-navbar

Navbar component for React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

header text with icons

udarts opened this issue · comments

Is it possible to add icons to the buttons? For example: < back or forward >

Hi @udarts!

Yeah, it is possible. You can take a look on CustomElements example in examples folder. In particular, this is what you're looking for: https://github.com/react-native-community/react-native-navbar/blob/master/examples/CustomElements/components/Bulbazavr.js

And what about adding fonticons (like fontawesome) as i icon? Together with the NavigationBar I meant.

Nothing different. Install font icons you want and use them inside react-native-navbar ¯\_(ツ)_/¯

Sorry to ask again, but I installed the following: https://github.com/entria/react-native-fontawesome
Somehow you can't simply say:
<NavigationBar style={styles.navbar} title={titleConfig} leftButton={{ title: '<FontAwesome>{Icons.chevronLeft}</FontAwesome> home', handler: () => goBack(), tintColor: 'white', }} tintColor="transparent" />
Because that doesn't work. Any ideas?

Hi @udarts! I would like to help you, but "that doesn't work" doesn't give me any insights of what's happening, how to reproduce your issue or what exactly doesn't work 😐 Please, add more details and I'll take a look

With doesn't work, I meant, the code I showed above, just prints the text: {Icons.chevronLeft} home
The example you posted earlier was using an image, while I want to use fonticons. There is no option in the react-native-navbar that allows icons. Normally I would see something like:

<NavigationBar leftButtonIcon="chevronLeft" />

Might be nice to have that feature implemented.