Skip to content

Support both react-native-vector-icons & react-native-icons, docs, and tests#4

Open
bartonhammond wants to merge 2 commits into
mhollweck:masterfrom
bartonhammond:master
Open

Support both react-native-vector-icons & react-native-icons, docs, and tests#4
bartonhammond wants to merge 2 commits into
mhollweck:masterfrom
bartonhammond:master

Conversation

@bartonhammond
Copy link
Copy Markdown

Nice component - I have my modified version here: https://github.com/bartonhammond/snowflake which is what I'm wanting to merge with yours.

I use it thusly:

  • Login - toggles the display of Password fields
  • Profile - displays the email-verified field which is read only

This merge would do the following:

  • Extract out the hard dependancy of Icon - pass it in as a property of type PropTypes.func
  • Support the user pass property of react-native-vector-icons or react-native-icons
  • Add support for passing the text property for display next to icon
  • I need the text all the time but it should be conditional
  • Add support for a "read-only" non feedback version (for display only )
  • Add testing with jest (Had to drop to react-native to 0.0.15 as 0.0.16 is babel6 and...well I'm not up on that)
    • npm install
    • npm test
    • coverage is on by default, 4 tests, with 52% coverage...easily enhanced
    • should be able to now use Travis or similar CI
  • Added documentation using docker

I think there might be some style properties that apply to one Icon and not the other. A switch statement could be necessary to style both maybe. With this merge it looks exactly like you see in my demo. If I have the transparency and background the icon disappears. Maybe you can figure out what properties are in common....It's close now though.

In my app I am calling it thusly:

    /**
    * Toggle the display of the Password and PasswordAgain fields
    */
    import Icon from 'react-native-vector-icons/FontAwesome';
    let itemCheckBox =
    <ItemCheckbox
        icon={Icon}
        text="Show Password"
        disabled={this.props.auth.form.isFetching}
        onCheck={() => {
            this.props.actions.onAuthFormFieldChange('showPassword',true)}
        }
        onUncheck={() => {
            this.props.actions.onAuthFormFieldChange('showPassword',false)}
        }
    />;

hope this helps....I have all this done in my project so why lose it? it's up to you.. good luck -barton

@mhollweck
Copy link
Copy Markdown
Owner

Thanks @bartonhammond! I'll look into it over the weekend!

@sibelius
Copy link
Copy Markdown

sibelius commented Feb 1, 2016

I think you should drop the support for the react-native-icons

is this going to master any time soon?

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.

3 participants