himelbrand / react-native-numeric-input

a stylish numeric input for react native
MIT License
150 stars 98 forks source link

Enable styles for buttons as well as enable disabling and enabling buttons #66

Open Monir-Shembesh opened 4 years ago

Monir-Shembesh commented 4 years ago

Sorry for the hassle of making one pull request to all features, but thought it would make sense.

I am currently working on a project and found out that I need to disable the increment and decrement buttons when the user reaches the max or min values specified.

Therefore, the following was done:

1- add expected props to the typescript interface following a previous name convention used with the icon styles 2- change the style prop on the increment and decrement to be an array 3- spread the upcoming props that are related to the button styles if true other wise just use {} 4- add a disabled prop to the buttons 5- write a condition inside the disabled prop that checks if the max/min reached as well if the user passed the disablers props disableIncButtonOnMaxReach and disableDecButtonOnMaxReach

Happy to make any necessary changes after reviewing

himelbrand commented 2 years ago

Cool, thanks! If you still wish to merge this, please add the new props to README

himelbrand commented 2 years ago

Thanks a lot for your contribution!

Monir-Shembesh commented 2 years ago

Hi, yes please merge it i have updated the README, revised the code, as well as fixed a typo in the types file.

Monir-Shembesh commented 2 years ago

@himelbrand can you please merge this pull request?

himelbrand commented 2 years ago

I'll review it this weekend, I missed the notification sorry