11'use client' ;
22import React from 'react' ;
33import Image from 'next/image' ;
4- import { useSignMessage } from 'wagmi' ;
4+ import { useChainId , useSignMessage } from 'wagmi' ;
55import { useAccount } from 'wagmi' ;
6+ import { ConnectButton } from '@rainbow-me/rainbowkit' ;
67import Alert from '@mui/material/Alert' ;
78import Box from '@mui/material/Box' ;
89import Button from '@mui/material/Button' ;
@@ -17,7 +18,7 @@ export const MoneriumConnect = () => {
1718 const { authorize, siwe, error } = useAuth ( ) ;
1819 const { signMessageAsync } = useSignMessage ( ) ;
1920 const [ open , setOpen ] = React . useState ( ! ! ( error as Error ) ?. message ) ;
20-
21+ const chainId = useChainId ( ) ;
2122 const handleClose = (
2223 event ?: React . SyntheticEvent | Event ,
2324 reason ?: SnackbarCloseReason
@@ -34,7 +35,7 @@ export const MoneriumConnect = () => {
3435 address : `${ address } ` ,
3536 appName : 'SDK TEST APP' ,
3637 redirectUri : 'http://localhost:3000/dashboard' ,
37- chainId : 1 ,
38+ chainId : chainId ,
3839 privacyPolicyUrl : 'https://example.com/privacy-policy' ,
3940 termsOfServiceUrl : 'https://example.com/terms-of-service' ,
4041 } ) ;
@@ -94,13 +95,16 @@ export const MoneriumConnect = () => {
9495 Connect
9596 </ Button >
9697 </ Box >
97- < Button
98- size = "large"
99- variant = "outlined"
100- onClick = { ( ) => signInWithEthereum ( ) }
101- >
102- Sign In with Ethereum
103- </ Button >
98+ < div style = { { display : 'flex' , gap : '10px' , alignItems : 'center' } } >
99+ < ConnectButton />
100+ < Button
101+ size = "large"
102+ variant = "outlined"
103+ onClick = { ( ) => signInWithEthereum ( ) }
104+ >
105+ Sign In with Ethereum
106+ </ Button >
107+ </ div >
104108 </ Box >
105109 </ >
106110 ) ;
0 commit comments