From 844f7f994b551d5a6cb11971a1e577aeb4085497 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:05:45 -0500 Subject: [PATCH] Reset cosmos-kit example --- .../src/app/_components/place-bet-dialog.tsx | 5 ++--- .../src/app/_components/wallet-button.tsx | 11 +++-------- examples/wagemos-cosmoskit-nextjs/src/app/page.tsx | 5 ++--- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/examples/wagemos-cosmoskit-nextjs/src/app/_components/place-bet-dialog.tsx b/examples/wagemos-cosmoskit-nextjs/src/app/_components/place-bet-dialog.tsx index 445aa4ca..36fe1983 100644 --- a/examples/wagemos-cosmoskit-nextjs/src/app/_components/place-bet-dialog.tsx +++ b/examples/wagemos-cosmoskit-nextjs/src/app/_components/place-bet-dialog.tsx @@ -37,7 +37,6 @@ import { SelectValue, } from '../../components/ui/select' import { useToast } from '../../components/ui/use-toast' -import { ROUND_ACCOUNT_ID, ROUND_CHAIN_NAME } from '../_lib/constants' const placeBetSchema = z.object({ amount: z.coerce @@ -64,8 +63,8 @@ export function PlaceBetDialog({ round }: { round: RoundResponse }) { const { mutateAsync: placeBetAsync, isLoading } = betting.mutations.usePlaceBet({ - accountId: stringToAccountId(ROUND_ACCOUNT_ID), - chainName: ROUND_CHAIN_NAME, + accountId: stringToAccountId('neutron-18'), + chainName: 'neutron', }) const onSubmit: SubmitHandler> = useCallback( diff --git a/examples/wagemos-cosmoskit-nextjs/src/app/_components/wallet-button.tsx b/examples/wagemos-cosmoskit-nextjs/src/app/_components/wallet-button.tsx index df7d1d71..5a688706 100644 --- a/examples/wagemos-cosmoskit-nextjs/src/app/_components/wallet-button.tsx +++ b/examples/wagemos-cosmoskit-nextjs/src/app/_components/wallet-button.tsx @@ -3,11 +3,8 @@ import { useChain } from '@cosmos-kit/react' import { useCallback } from 'react' import { Button } from '../../components/ui/button' import { useToast } from '../../components/ui/use-toast' -import { ROUND_CHAIN_NAME } from '../_lib/constants' -function DisconnectButton({ - chainName = ROUND_CHAIN_NAME, -}: { chainName?: string }) { +function DisconnectButton({ chainName = 'neutron' }: { chainName?: string }) { const { disconnect, address } = useChain(chainName) const { toast } = useToast() @@ -47,9 +44,7 @@ function DisconnectButton({ ) } -function ConnectButton({ - chainName = ROUND_CHAIN_NAME, -}: { chainName?: string }) { +function ConnectButton({ chainName = 'neutron' }: { chainName?: string }) { const { connect } = useChain(chainName) const { toast } = useToast() @@ -68,7 +63,7 @@ function ConnectButton({ } export function WalletButton({ - chainName = ROUND_CHAIN_NAME, + chainName = 'neutron', }: { chainName?: string }) { const { isWalletConnected: isConnected } = useChain(chainName) if (isConnected) { diff --git a/examples/wagemos-cosmoskit-nextjs/src/app/page.tsx b/examples/wagemos-cosmoskit-nextjs/src/app/page.tsx index 42430513..9bb8c303 100644 --- a/examples/wagemos-cosmoskit-nextjs/src/app/page.tsx +++ b/examples/wagemos-cosmoskit-nextjs/src/app/page.tsx @@ -18,13 +18,12 @@ import { RoundWinningTeam, } from './_components/round' import { WalletButton } from './_components/wallet-button' -import { ROUND_ACCOUNT_ID, ROUND_CHAIN_NAME } from './_lib/constants' export default function Home() { const { data, isLoading, isError } = betting.queries.useListRounds({ args: {}, - accountId: stringToAccountId(ROUND_ACCOUNT_ID), - chainName: ROUND_CHAIN_NAME, + accountId: stringToAccountId('neutron-18'), + chainName: 'neutron', }) if (isLoading) return

Loading...

if (isError) return

Error