use-ink / contracts-ui

Web application for deploying wasm smart contracts on Substrate chains that include the FRAME contracts pallet
https://contracts-ui.substrate.io/
GNU General Public License v3.0
61 stars 45 forks source link

feat: settings page custom endpoint #435

Closed peetzweg closed 1 year ago

peetzweg commented 1 year ago

Initially described in #263.

As we don't have a too elaborate app state management I made a bit of workaround. When user edit the custom endpoint they need to press "Use now", which saves the new RPC url to LocalStorage and redirect the user to the root of the app with the rpc= url query to be used than.

Unfortunately if the user enters a rpc which is not reachable, the app is "stuck" on the ConnectionError component and unable to open the settings to fix the currently used RPC url. The user needs to connect to a working RPC and only than is able to to open the settings page again.

Not yet found a good solution how to make the /settings page available without the <AwaitApis/> context provider. Happy to get suggestions.

demo

netlify[bot] commented 1 year ago

Deploy Preview for contracts-ui ready!

Name Link
Latest commit 1bd9de3a95db4dcc37c3e8370c9e3111e06d5fbd
Latest deploy log https://app.netlify.com/sites/contracts-ui/deploys/641ac48e8b763d0008b251c0
Deploy Preview https://deploy-preview-435--contracts-ui.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

peetzweg commented 1 year ago

As discussed, with @statictype, I refactored the Settings page into a Modal to be part of the Sidebar so it's always accessible.

demo