Skip to content

Commit 1314cae

Browse files
authored
Merge pull request #2589 from pyth-network/cprussin/add-network-selector-to-wallet-tester-page
feat(staking): add devnet switch to wallet tester
2 parents 2440b38 + 75bb108 commit 1314cae

File tree

1 file changed

+12
-1
lines changed
  • apps/staking/src/components/WalletTester

1 file changed

+12
-1
lines changed

apps/staking/src/components/WalletTester/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ import {
2121
StateType as UseAsyncStateType,
2222
} from "../../hooks/use-async";
2323
import { useData, StateType as UseDataStateType } from "../../hooks/use-data";
24+
import { useNetwork } from "../../hooks/use-network";
2425
import { useToast } from "../../hooks/use-toast";
2526
import { Button } from "../Button";
27+
import { Switch } from "../Switch";
2628

2729
const MAX_TEST_RETRIES = 10;
2830

@@ -65,13 +67,14 @@ const ConnectWallet = ({ isLoading }: { isLoading?: boolean | undefined }) => {
6567
const showModal = useCallback(() => {
6668
modal.setVisible(true);
6769
}, [modal]);
70+
const { isMainnet, toggleMainnet } = useNetwork();
6871

6972
return (
7073
<>
7174
<Description className="mb-10 text-neutral-400">
7275
Please connect your wallet to get started.
7376
</Description>
74-
<div className="flex justify-center">
77+
<div className="flex flex-col items-center gap-4">
7578
<Button
7679
className="px-10 py-4"
7780
size="nopad"
@@ -87,6 +90,14 @@ const ConnectWallet = ({ isLoading }: { isLoading?: boolean | undefined }) => {
8790
</>
8891
)}
8992
</Button>
93+
<Switch
94+
isSelected={isMainnet}
95+
postLabel="Mainnet"
96+
preLabel="Devnet"
97+
className="px-4 py-1"
98+
size="small"
99+
onChange={toggleMainnet}
100+
/>
90101
</div>
91102
</>
92103
);

0 commit comments

Comments
 (0)