Skip to content

Commit

Permalink
Add info what environment dapp is running on (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karolina Kosiorowska authored Oct 20, 2023
2 parents 3d0f375 + 8155034 commit d6b8789
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/shared/hooks/tenderly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function useResetTenderlyFork() {
if (
process.env.ALLOW_TENDERLY_RESET !== "true" ||
process.env.USE_TENDERLY_FORK !== "true" ||
process.env.TENDERLY_ACCESS_KEY === undefined ||
process.env.TENDERLY_FORK_HEAD === undefined ||
process.env.TENDERLY_FORK_HEAD === ""
) {
Expand Down
13 changes: 13 additions & 0 deletions src/ui/Nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ const NAV_ITEMS = [
// },
]

function EnvironmentInfo() {
if (process.env.USE_LOCALHOST_FORK === "true") {
return <span>🏝️ Using localhost</span>
}

if (process.env.USE_TENDERLY_FORK === "true") {
return <span>⚡️ Using fork</span>
}

return null
}

export default function Nav(): JSX.Element {
const { isConnected, connect } = useConnect()
const resetTenderlyFork = useResetTenderlyFork()
Expand Down Expand Up @@ -73,6 +85,7 @@ export default function Nav(): JSX.Element {
/>
)
)}
<EnvironmentInfo />
</nav>
</div>
<div className="logo_container">
Expand Down

0 comments on commit d6b8789

Please sign in to comment.