Skip to content

Commit

Permalink
remove changes to example
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorJTClarke committed Apr 25, 2024
1 parent 0f697da commit 6bcdc6c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 74 deletions.
12 changes: 2 additions & 10 deletions example/next/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Center, HStack, Spacer, Stack, Text, useColorMode } from "@chakra-ui/react";
import { useAccount, getRecentChainIds, useCapsule } from "graz";
import { useAccount, useCapsule } from "graz";
import type { NextPage } from "next";
import dynamic from "next/dynamic";
import { BalanceList } from "ui/balance-list";
import { ChainSwitcher } from "ui/chain-switcher";
import { ChainSigner } from "ui/chain-signer";
import { ConnectButton } from "ui/connect-button";
import { ConnectStatus } from "ui/connect-status";
import { ToggleTheme } from "ui/toggle-theme";
Expand All @@ -15,16 +14,11 @@ const LeapSocialLogin = dynamic(
);

const HomePage: NextPage = () => {
const recentChainIds = getRecentChainIds() || [];
const latestChainId = recentChainIds[recentChainIds.length - 1] || 'cosmoshub-4';

const { data: accountData } = useAccount({
chainId: latestChainId,
multiChain: false,
chainId: "cosmoshub-4",
});
const { client, modalState, onAfterLoginSuccessful, setModalState, onLoginFailure } = useCapsule();
const { colorMode } = useColorMode();

return (
<Center minH="100vh">
<Stack bgColor="whiteAlpha.100" boxShadow="md" maxW="md" p={4} rounded="md" spacing={4} w="full">
Expand All @@ -40,8 +34,6 @@ const HomePage: NextPage = () => {
Wallet address: <b>{accountData.bech32Address}</b>
</Text>

{latestChainId && <ChainSigner />}

<BalanceList />
<ChainSwitcher />
</>
Expand Down
51 changes: 0 additions & 51 deletions example/next/ui/chain-signer.tsx

This file was deleted.

12 changes: 1 addition & 11 deletions example/next/ui/chain-switcher.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, ButtonGroup, Stack, Text } from "@chakra-ui/react";
import { useAccount, useSuggestChainAndConnect } from "graz";
import { osmosistestnet, stargaze } from "graz/chains";
import { osmosistestnet } from "graz/chains";
import type { FC } from "react";

export const ChainSwitcher: FC = () => {
Expand Down Expand Up @@ -29,16 +29,6 @@ export const ChainSwitcher: FC = () => {
>
{osmosistestnet.chainId}
</Button>
<Button
colorScheme={account ? "green" : "gray"}
onClick={() =>
suggestAndConnect({
chainInfo: stargaze,
})
}
>
{stargaze.chainId}
</Button>
</ButtonGroup>
</Stack>
);
Expand Down
3 changes: 1 addition & 2 deletions example/next/utils/graz.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { cosmoshub, osmosistestnet, stargaze } from "graz/chains";
import { cosmoshub, osmosistestnet } from "graz/chains";

export const chains = [
{ ...cosmoshub, rpc: "https://rpc.cosmos.directory/cosmoshub", rest: "https://rest.cosmos.directory/cosmoshub" },
osmosistestnet,
stargaze,
];

0 comments on commit 6bcdc6c

Please sign in to comment.