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

Allow toolbar actions #14

Merged
merged 1 commit into from
Dec 4, 2015
Merged

Allow toolbar actions #14

merged 1 commit into from
Dec 4, 2015

Conversation

Ehesp
Copy link
Contributor

@Ehesp Ehesp commented Dec 2, 2015

@binggg Proof of concept at the moment as I'm having an issue, which I'll explain.

This PR allows you to do the following:

<Toolbar
        title='MyAwesomeApp'
    navIconName='menu'
    titleColor='#ffffff'
    actions={ [
            { icon: 'settings', onPress: function() {
            console.log('pressed settings');
        } },
        { icon: 'magnify', onPress: () => {
            console.log('pressed magnify');
        } }
    ] }
    style={ styles.toolbar }
/>

Which results in:

image

  • It fixes a bug(?) where the navIconName was always set to menu, now it defaults to menu.

The issue I can't figure out though is the onPress function is never triggered. I've tried to trace it back to the Ripple component, it looks like onPress is never getting triggered on that component. When adding it, it complains the proptype passed down from IconButton is not a function!

Let me know what you think anyway.

binggg added a commit that referenced this pull request Dec 4, 2015
@binggg binggg merged commit 71e2377 into binggg:master Dec 4, 2015
binggg added a commit that referenced this pull request Dec 4, 2015
@Ehesp
Copy link
Contributor Author

Ehesp commented Dec 4, 2015

Be aware there is an outstanding issue here, the action icons don't actually do anything right now as the press handler doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants