Network selector
If your application can switch between Mainnet and Testnet networks you may want to add the network selector widget to the CSPR.click navigation bar.
Network selector set up
Define an array with the list of networks your application supports:
Create a state value to store the current network. For example, with useState()
hook, but you can use any other method.
Define a networkSettings
object with the list of networks, the current network, and a callback method to handle network selection by the user. Add this object to the topBarSettings
prop in the <ClickUI>
component:
Customize the network icons
You can also specify your custom icons for each of the networks:
Last updated