Repository navigation
feat: hide Hardhat network from home page in production/staging - #75
Conversation
The Hardhat network link is now only shown on the home page when: - Running in development mode, OR - Explicitly included in REACT_APP_OPENSCAN_NETWORKS The network remains accessible via direct URL navigation to /31337
|
🚀 Preview: https://pr-75--openscan.netlify.app |
| const allNetworks = getEnabledNetworks(); | ||
| const environment = process.env.REACT_APP_ENVIRONMENT; | ||
| const isDevelopment = environment === "development"; | ||
| const envNetworks = process.env.REACT_APP_OPENSCAN_NETWORKS; |
There was a problem hiding this comment.
It is unclear how and where to add the networks to enable localhost development.
We can add it to a .env.example file or instructions in README.md.
There was a problem hiding this comment.
Added readme documentation about REACT_APP_OPENSCAN_NETWORKS on the readme, but teh rest is very clear, if you run it locally with npm start you will see localhost as an option on home, this PR only removes the localhost button on the home for staging and production deploys.
So if a developer using hardhat/anvil download the repo and runs the explorer with npm start it would be able to navigate on localhost with no problems.
Even so, localhost is still usabe on stagin and production via url path.
This pull request updates the logic for displaying enabled networks on the Home page. The main improvement is that the "Hardhat" network (chain ID 31337) is now hidden from the home page unless the application is running in development mode or it is explicitly enabled via the
REACT_APP_OPENSCAN_NETWORKSenvironment variable.closes #53
Network display logic improvements:
enabledNetworkslogic inHome.tsxto filter out the Hardhat network (chain ID 31337) from the home page unless the app is running in development or Hardhat is explicitly listed in theREACT_APP_OPENSCAN_NETWORKSenvironment variable.