Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

left navbar icon hitSlop feature #9

Closed
zeritte opened this issue Jun 13, 2019 · 0 comments
Closed

left navbar icon hitSlop feature #9

zeritte opened this issue Jun 13, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@zeritte
Copy link

zeritte commented Jun 13, 2019

We should be able to increase touchable area of left navbar icon.
When using navbar component of galio, user has to click exactly on top of go back or open drawer icon. however; this really reduces the user experience.
this is related to galio-org/galio#94

Being able to add hit slop to left navbar icon
With the help of a few lines of code; users of galio may add hitSlop to left navbar icon. example code is given below.

What about right icon?
Since right can be rendered in a whole component, I don't think we need to specify rightHitSlop.

example code:

renderRight = () => {
    const { white, title, navigation } = this.props;
    const { routeName } = navigation.state;

    if (title === "Title") {
      return [
        //some things
      ];
    }
}
<NavBar
   back={back}
   title={title}
   style={styles.navbar}
   transparent={transparent}
   right={this.renderRight()}
   leftHitSlop={{ top: 30, bottom: 30, left: 30, right: 30 }} // important part!!!
   leftStyle={{ paddingVertical: -12, flex: 0.3 }}
   leftIconColor={white ? theme.COLORS.WHITE : theme.COLORS.ICON}
   titleStyle={[
      styles.title,
      { color: theme.COLORS[white ? "WHITE" : "ICON"] }
          ]}
   onLeftPress={this.handleLeftPress}
/>
@zeritte zeritte added the enhancement New feature or request label Jun 13, 2019
@zeritte zeritte closed this as completed Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant