Back Button
The main task that the Back Button performs is to provide a seemingly native way to navigate back in the routing history. However, We does not restrict the developer in the ways of using the Back Button and allows them to handle the component click event as required in the application.
When working with this component, it is important to understand that, like other Mini Apps components, clicking it does not inherently trigger any built-in action. Its handling is the responsibility of the developer.
window.OpenWeb3.WebApp.BackButton.show()
window.OpenWeb3.WebApp.BackButton.onClick(()=> {
window.OpenWeb3.WebApp.BackButton.hide()
})
Main Button
The Main Button is a component that is usually used when it is necessary to perform some final action.
An example of the use case of this component is sending data. For example, a Mini App may involve selecting products from a catalog and filling a user's shopping cart. At the moment when products appear in the cart, the developer can display the Main Button, clicking on which will cause the creation and processing of the order.
This is a moderately sized yet simple component that offers limited functionality. The developer has the ability to control the button text, its active state, button and inner loader visibility. It is also possible to update text and background colors.
window.OpenWeb3.WebApp.MainButton.show()
window.OpenWeb3.WebApp.MainButton.onClick(()=> {
window.OpenWeb3.WebApp.MainButton.hide()
})