Display different views
Displaying different views is very simple. You just need to leverage the UI State.
For example, I have a form where my users can enter values into an input and submit a transaction. Then, I want to display a success message once a transaction is successful.
I have two different views. Let's call them form and success.
Because there are two different views, there will be two different prompt blocks.
The prompt above is displayed only if the view is set to form.
The view switches to success once the user clicks on the "WRAP" button and the deposit transaction is minted successfully.
The prompt above is displayed only if the view is set to success.
When the user clicks on the "New Swap" button he will set back the view to form.
The complete dApp treated in this example can be found here - RINKEBY
Last updated