rescript-react-native / paper

ReScript bindings for react-native-paper
MIT License
14 stars 15 forks source link

Allow BottomNavigation with no badges on icons #11

Closed leoparis89 closed 2 years ago

leoparis89 commented 2 years ago

Enables the use of BottomNavigation with no badges. In the present state, is you put an empty string for a badge like this:

{
    "key": "account",
    "title": "account",
    "icon": "credit-card",
    "color": "blue",
    "badge": "",
    "accessibilityLabel": "myLabel",
    "testID": "myId",
  }

You get this unwanted behavior:

Capture d’écran 2022-03-25 à 16 38 09

Now you can just do

{
    "key": "account",
    "title": "account",
    "icon": "credit-card",
    "color": "blue",
    "badge": None,
    "accessibilityLabel": "myLabel",
    "testID": "myId",
  }
Capture d’écran 2022-03-25 à 16 39 46
  {
    "key": "account",
    "title": "account",
    "icon": "credit-card",
    "color": "blue",
    "badge": Some("33"),
    "accessibilityLabel": "cool",
    "testID": "myid",
  }
Capture d’écran 2022-03-25 à 16 41 51

Also put option type on the other non mandatory route props.