@@ -22,7 +22,7 @@ import {
2222 TextField ,
2323 Theme ,
2424} from '@radix-ui/themes'
25- import { useIsMounted } from 'connectkit'
25+ import { useIsMounted , useModal } from 'connectkit'
2626import Link from 'next/link'
2727import { usePathname , useRouter } from 'next/navigation'
2828import { useCallback , useEffect , useState } from 'react'
@@ -44,6 +44,7 @@ export function HomeClientPage({ color: initialColor }: HomeClientPageProps) {
4444 const pathname = usePathname ( )
4545 const isMounted = useIsMounted ( )
4646 const { address } = useAccount ( )
47+ const { setOpen } = useModal ( )
4748
4849 const [ color , setColor ] = useState ( initialColor )
4950 const [ randomMintAmount , setRandomMintAmount ] = useState ( 1 )
@@ -212,10 +213,12 @@ export function HomeClientPage({ color: initialColor }: HomeClientPageProps) {
212213 < Button
213214 size = "4"
214215 onClick = { ( ) =>
215- mint ( {
216- args : [ color . r , color . g , color . b ] ,
217- value : parseEther ( '0.004' ) ,
218- } )
216+ address
217+ ? mint ( {
218+ args : [ color . r , color . g , color . b ] ,
219+ value : parseEther ( '0.004' ) ,
220+ } )
221+ : setOpen ( true )
219222 }
220223 loading = { mintPending }
221224 disabled = { mintRandomPending || allowlistMintPending }
@@ -250,10 +253,12 @@ export function HomeClientPage({ color: initialColor }: HomeClientPageProps) {
250253 < Button
251254 size = "4"
252255 onClick = { ( ) =>
253- mintRandom ( {
254- args : [ randomMintAmount ] ,
255- value : parseEther ( randomMintCost ) ,
256- } )
256+ address
257+ ? mintRandom ( {
258+ args : [ randomMintAmount ] ,
259+ value : parseEther ( randomMintCost ) ,
260+ } )
261+ : setOpen ( true )
257262 }
258263 loading = { mintRandomPending }
259264 disabled = { mintPending }
0 commit comments