Skip to content

Commit 2856a48

Browse files
Merge pull request #1503 from ssvlabs/stage
Stage to Main (fix: explorer url)
2 parents 499b0d6 + 6c529f7 commit 2856a48

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ VITE_MIXPANEL_TOKEN=$MIXPANEL_TOKEN
2020
# ---------------------------------------------------------
2121

2222
# Mainnet + Hoodi
23-
VITE_SSV_NETWORKS='[{"networkId":560048,"api":"https://api.stage.ops.ssvlabsinternal.com/api","apiVersion":"v4","apiNetwork":"hoodi","explorerUrl":"https://hoodi-explorer.stage.ssv.network","insufficientBalanceUrl":"https://faucet.stage.ssv.network","googleTagSecret":"GTM-K3GR7M5","tokenAddress":"0x746c33ccc28b1363c35c09badaf41b2ffa7e6d56","setterContractAddress":"0x0aaace4e8affc47c6834171c88d342a4abd8f105","getterContractAddress":"0x9143b8c25efa53f28de4cbefd0b6dfd66d43fea6", "bAppContractAddress" : "0x40d959B95e7c56962D6d388d87921c03734b9C2C"}]'
23+
VITE_SSV_NETWORKS='[{"networkId":560048,"api":"https://api.stage.ops.ssvlabsinternal.com/api","apiVersion":"v4","apiNetwork":"hoodi","explorerUrl":"https://explorer.stage.ssv.network","insufficientBalanceUrl":"https://faucet.stage.ssv.network","googleTagSecret":"GTM-K3GR7M5","tokenAddress":"0x746c33ccc28b1363c35c09badaf41b2ffa7e6d56","setterContractAddress":"0x0aaace4e8affc47c6834171c88d342a4abd8f105","getterContractAddress":"0x9143b8c25efa53f28de4cbefd0b6dfd66d43fea6", "bAppContractAddress" : "0x40d959B95e7c56962D6d388d87921c03734b9C2C"}]'

.github/workflows/build_deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
\"apiVersion\": \"v4\",
2525
\"apiNetwork\": \"hoodi\",
2626
\"api\": \"https://api.stage.ops.ssvlabsinternal.com/api\",
27-
\"explorerUrl\": \"https://hoodi-explorer.stage.ssv.network\",
27+
\"explorerUrl\": \"https://explorer.stage.ssv.network\",
2828
\"insufficientBalanceUrl\": \"https://faucet.stage.ssv.network\",
2929
\"googleTagSecret\": \"${{ secrets.STAGE_GOOGLE_TAG_SECRET }}\",
3030
\"tokenAddress\": \"0x746c33ccc28b1363c35c09badaf41b2ffa7e6d56\",
@@ -53,7 +53,7 @@ jobs:
5353
\"apiVersion\": \"v4\",
5454
\"apiNetwork\": \"hoodi\",
5555
\"api\": \"https://api.ssv.network/api\",
56-
\"explorerUrl\": \"https://hoodi.explorer.ssv.network\",
56+
\"explorerUrl\": \"https://explorer.ssv.network\",
5757
\"insufficientBalanceUrl\": \"https://faucet.ssv.network\",
5858
\"googleTagSecret\": \"${{ secrets.STAGE_GOOGLE_TAG_SECRET }}\",
5959
\"tokenAddress\": \"0x9F5d4Ec84fC4785788aB44F9de973cF34F7A038e\",

src/app/layouts/dashboard/navbar.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import { useLinks } from "@/hooks/use-links";
2323
import { useAccountState } from "@/hooks/account/use-account-state";
2424
import { textVariants } from "@/components/ui/text";
2525
import { DropdownMenuGroup } from "@radix-ui/react-dropdown-menu";
26+
import { useSSVNetworkDetails } from "@/hooks/use-ssv-network-details";
27+
import urlJoin from "url-join";
2628

2729
export type NavbarProps = {
2830
// TODO: Add props or remove this type
@@ -36,6 +38,11 @@ export const Navbar: FCProps = ({ className, ...props }) => {
3638
const links = useLinks();
3739
const { accountRoutePath, dvtRoutePath } = useAccountState();
3840
const pathname = useLocation().pathname;
41+
const ssvNetworkDetails = useSSVNetworkDetails();
42+
const explorerUrl = urlJoin(
43+
links.ssv.explorer,
44+
ssvNetworkDetails.apiNetwork.toLowerCase(),
45+
);
3946

4047
return (
4148
<div
@@ -119,7 +126,7 @@ export const Navbar: FCProps = ({ className, ...props }) => {
119126
DVT
120127
</NavLink>
121128
<NavLink
122-
to={links.ssv.explorer}
129+
to={explorerUrl}
123130
target="_blank"
124131
className={textVariants({
125132
variant: "body-3-medium",
@@ -229,7 +236,7 @@ export const Navbar: FCProps = ({ className, ...props }) => {
229236
</DropdownMenuItem>
230237
<DropdownMenuSeparator />
231238
<DropdownMenuItem className="h-[52px]" asChild>
232-
<NavLink to={links.ssv.explorer} target="_blank">
239+
<NavLink to={explorerUrl} target="_blank">
233240
Explorer <HiOutlineExternalLink className="text-gray-600" />
234241
</NavLink>
235242
</DropdownMenuItem>

src/components/ui/ssv-explorer-btn.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export const SsvExplorerBtn: SsvExplorerBtnFC = ({ className, ...props }) => {
3333
const clearedProps = omit(props, ["operatorId", "validatorId"]);
3434
const href = urlJoin(
3535
network.explorerUrl,
36-
isOperator ? "operators" : "validators",
36+
network.apiNetwork.toLowerCase(),
37+
isOperator ? "operator" : "validator",
3738
id.toString(),
3839
);
3940

src/hooks/use-links.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ export const useLinks = () => {
77
const { chain } = useAccount();
88
return useMemo(() => {
99
const prefix = chain?.testnet ? `${chain.name.toLowerCase()}.` : "";
10-
const ssvPrefix = isProduction ? "" : `.stage`;
10+
const explorerEnv = isProduction ? "" : `.stage`;
1111
return {
1212
beaconcha: `https://${prefix}beaconcha.in`,
1313
launchpad: `https://${prefix}launchpad.ethereum.org`,
1414
etherscan: `https://${prefix}etherscan.io`,
1515
ssv: {
16-
explorer: `https://${isProduction ? prefix : ""}explorer${ssvPrefix}.ssv.network`,
16+
explorer: `https://explorer${explorerEnv}.ssv.network/`,
1717
docs: `https://docs.ssv.network`,
1818
forum: `https://forum.ssv.network/`,
1919
governanceForum: `https://forum.ssv.network/`,

0 commit comments

Comments
 (0)