TheWirv / react-native-wallet-passes

React Native module to handle Wallet passes on iOS and Android.
MIT License
10 stars 4 forks source link

Android: Implement button when `canAddPasses` resolves to true #7

Open pke opened 2 years ago

pke commented 2 years ago

I think it would be possible and make a nice API if one could always use <AddWalletButton> on both Android and iOS systems. On Android it could be implemented as a component with a render function.

<AddWalletButton>
{(addPass) => (
  <MyAndroidAddButton onPress={addPass} title="Add To Wallet"/>
)}
</AddWalletButton>

The render function is only ever called if canAddPasses evaluates to true. On iOS its never called, cause the button is rendered natively.

What do you think?