SocketDotTech / plugin

Seamless bridging experience into a single fully customizable React Component
https://www.npmjs.com/package/@socket.tech/plugin
MIT License
40 stars 17 forks source link

🍰 feat: added action/onChange handlers #42

Closed salil-naik closed 2 years ago

salil-naik commented 2 years ago

Added a bunch of onChange handlers like onSourceTokenChange, onSourceNetworkChange, onBridgeSuccess, etc. The functions will pass the relevant data* to the developer when actions are performed by the user in the widget.

Please review the implementation in file src/components/Input.tsx It takes the functions as props and calls them on certain user actions like tokenChange and networkChange.

Implementation in file src/components/TxModal/index.tsx is in progress but is also the major one. Here, the function is called when the bridging is completed successfully (all steps completed).

*Data as specified here and here