blockful-io / external-resolver-dapp

https://external-resolver-dapp.vercel.app
2 stars 2 forks source link

feat: display informative banner when in testnet #181

Closed FrancoAguzzi closed 2 months ago

FrancoAguzzi commented 2 months ago

Feature Request

Describe the Feature Request

This feature is simple > we need a banner at the top of the page that informs visitors that they are connected to a testnet, whenever this is true.

Describe Preferred Solution

Preferred solution looks like ENS dApp banner (which can be found below) and preferred text is "You are viewing the ENS app on X" where X is the name of the network being used.

Captura de Tela 2024-09-11 às 09 15 42

Describe Alternatives

Alternatives should be used only if it is taking too much time to do the description above.

One alternative is to position the banner at the footer.

Additional Context

To identify if a user is not in mainnet you can use Wagmi's useAccount hook and extract chain information from there!

At some point one conditional will be necessary: "is he / she in mainnet?" To achieve this value, please try to use typed structs (e.g. chain === MainnetChain.name) instead of hardcoded values (e.g. chain === "mainnet")

pikonha commented 2 months ago

I think nameful should be lowercase. Other than that everything seems good to me. Image