Skip to content

Releases: vonovak/react-navigation-header-buttons

v2.1.0

27 Jul 14:26
Compare
Choose a tag to compare

v2.0.0

16 Jul 22:56
Compare
Choose a tag to compare

v2 includes a slightly redesigned api that allows for easier support of use cases such as disabled item state or custom ripple effect on the buttons. There are breaking changes, but if you followed the previous advice on "How to integrate in your project", migration should be easy. There are no changes to styling of the buttons.

Breaking:

  • cancelButtonLabel prop was removed, provide custom onOverflowMenuPress if you relied on this prop.

to get the same behavior and customize the cancel label used on ActionSheetIOS, the replacement will look more or less like this

const onOverflowMenuPressIOS = ({ hiddenButtons }) => {
  let actionTitles = hiddenButtons.map(btn => btn.props.title);
  actionTitles.push('your cancel label');

  ActionSheetIOS.showActionSheetWithOptions(
    {
      options: actionTitles,
      cancelButtonIndex: actionTitles.length - 1,
    },
    (buttonIndex: number) => {
      if (buttonIndex !== actionTitles.length - 1) {
        hiddenButtons[buttonIndex].props.onPress();
      }
    }
  );
};
  • IconElement was renamed to ButtonElement
  • HeaderButtons expects different props now - instead of IconComponent, iconSize and color you're expected to pass HeaderButtonComponent prop

If you were using this library together with react-native-vector-icons, you will also be required to import HeaderButton and wrap it in your own component providing the IconComponent, iconSize and color props, as documented here.

Please see the example screens or run the improved example app.

v1.2.0

21 Jun 06:20
Compare
Choose a tag to compare

This release includes a new onOverflowMenuPress?: ({ hiddenButtons: Array<React.Element<*>> })=>any prop which you can use to handle tapping on the overflow button. This may be handy if the default handlers do not fit your needs.

onOverflowMenuPress accepts a single parameter - an object with hiddenButtons key.

v1.1.0

18 Jun 18:50
Compare
Choose a tag to compare

this release includes

  • support for testIDs for e2e tests
  • minor adjustments to flow and TS typings

v1.0.0

18 May 22:04
Compare
Choose a tag to compare

OverflowIcon is now required if you need overflow buttons. No default OverflowIcon is provided. There are no other steps needed to upgrade.

v0.0.8

11 May 22:26
Compare
Choose a tag to compare

you can now import HeaderButtons with predefined IconComponent, see the comparison. Please note this was removed in 1.0.0

ex:

import { IoniconHeaderButtons, Item } from 'react-navigation-header-buttons'

static navigationOptions = {
  title: 'Usage With Icons',
  headerRight: (
    <IoniconHeaderButtons color="blue">
      <Item title="add" iconName="ios-search" onPress={() => console.warn('add')} />
      <Item title="select" onPress={() => console.warn('edit')} />
    </IoniconHeaderButtons>
  ),
};

v0.0.7

06 Apr 17:55
Compare
Choose a tag to compare
  • if you do not define onPress prop, the rendered button won't respond to touches

v0.0.6

05 Apr 17:05
Compare
Choose a tag to compare
  • added TS definitions

v0.0.5

13 Mar 21:41
Compare
Choose a tag to compare
  • improve location of ripple on the default overflow button
  • improve right margin of the default overflow button
  • new overflowButtonWrapperStyle prop