Styling the searchbar in wix's react-native-navigation v2 - react-native

I'm using the search bar in a react-native app (iOS 11+).
These are the options I gave to my screen:
options: {
topBar: {
title: {
text: 'MyTitle',
testID: TOP_APPS_ID,
},
searchBar: true,
searchBarHiddenWhenScrolling: true,
},
},
And it does display the search bar:
However, I would like to remove the bottom border it adds by default.
How can I achieve this? I tried setting "noBorder" to true in the topBar options but it still shows the border.

Related

Fluent UI React how to change nav link icon color?

I want to change the nav link icon color. If I set the primary color by creating a custom theme it won't effect.
<ThemeProvider
theme={{
palette: {
themePrimary: getTheme().palette.teal,
}
}}
>
Actually it worked on hover but not on normal view. I tried setting the iconProps but it didn't work either.
links: [
{
name: "Overview",
icon: "WebAppBuilderFragment",
iconProps: { color: "white" },
},
],
How can I change these icons color?
IconProps is an object with following props. Use styles to set icon color:
links: [
{
name: "Overview",
iconProps: {
iconName: 'WebAppBuilderFragment',
styles: {
root: { color: '#f00' },
},
},
},
],
Codepen working example.

How to hide back button on ios with wix react native navigation

I have been stuck on this problem all morning. I have read multiple GitHub issues and StackOverflow posts and nothing has worked.
I want to remove the blue back button in the top left of the below pic.
I have noticed I am having trouble customizing the top bar altogether. I cannot add a title to the back button etc (this hint might indicate what is wrong).
Navigation.setRoot
Navigation.events().registerAppLaunchedListener(() => {
Reactotron.log('5');
Navigation.setRoot({
root: {
stack: {
children: [{
component: {
id: STARTING_SCREEN,
name: STARTING_SCREEN
}
}],
}
},
layout: {
orientation: 'portrait',
},
}).then(()=>Reactotron.log('7'));
Navigation.push
SplashScreen (root screen) -> AccessScreen (next screen).
Navigation.push(this.props.componentId, {
component: {
name: screen
},
options: {
topBar: {
backButton: {
visible: false,
}
}
}
It's almost as if I am specifying the backButton options in the wrong place.
A tricky workaround
leftButtons: [
{
id: 'something',
text: '',
},
],
the text: '' will keep a empty space, so will hide the button.
Actually not hide, but yea you can say that too.
You're good to go!!
Use it but only working for ios
Navigation.setDefaultOptions({
topBar: {
backButton: {
visible: false
}
},
})
or you can customize topBar
Navigation.push(this.props.componentId, {
component: {
name: screen
},
options: {
topBar: {
backButton: {
background: YourComponent
}
}
}

React Native Navigation Custom Header

I am using react-native-navigation (not react-navigation) and I want to customize the tab bar and top bar. How do I do this?
You need to hide the default top bar and use own custom top bar in your component.
component: {
name: 'Your component',
options: {
topBar: {
visible: false,
height: 0,
},
},
},

SearchBar react-native-navigation V2 Android

I am using Wix's navigation V2, I want to add a search field in the top bar, this is how I am pushing the screen that shows a list of item
Navigation.push(this.props.componentId, {
component: {
name: 'app.SearchEvent',
passProps: {
eventName: this.state.eventName,
},
options: {
topBar: {
drawBehind: false,
searchBar: true,
searchBarHiddenWhenScrolling: true,
searchBarPlaceholder: 'Recherche...',
},
},
},
});
I've seen an example inplayground of the docs but it's also not working in Android, playground example
So how could I add it?
Considering current version, 2.7.1, and according to the official documentation (https://wix.github.io/react-native-navigation/#/docs/styling?id=ios-specific-options), those properties are iOS +11 specific.
They're not meant to work on Android.
searchBar: true, // iOS 11+ native UISearchBar inside topBar
searchBarHiddenWhenScrolling: true,
searchBarPlaceholder: 'Search', // iOS 11+ SearchBar placeholder

Cannot use vector icon on wix navigation bar

I can use vector icon everywhere but the navigation bar. It's display nothing.
rightButtons: [
{
icon: iconsMap['ios-home'], // This one not work
id: 'add'
},
{
icon: require('./../../assets/homeicon.png'), // this one work
id: 'Test'
},
],
Here is my full project
https://github.com/Knight1988/RNWixNavigationReduxStarter