Skip to content

Commit

Permalink
Reset cosmos-kit example
Browse files Browse the repository at this point in the history
  • Loading branch information
adairrr committed Dec 9, 2024
1 parent 04f7635 commit 844f7f9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<z.infer<typeof placeBetSchema>> = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -68,7 +63,7 @@ function ConnectButton({
}

export function WalletButton({
chainName = ROUND_CHAIN_NAME,
chainName = 'neutron',
}: { chainName?: string }) {
const { isWalletConnected: isConnected } = useChain(chainName)
if (isConnected) {
Expand Down
5 changes: 2 additions & 3 deletions examples/wagemos-cosmoskit-nextjs/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <p>Loading...</p>
if (isError) return <p>Error</p>
Expand Down

0 comments on commit 844f7f9

Please sign in to comment.