here is my connect wallet function which is called when I click on connect wallet button
const connectWallet = async () => {
if(window.ethereum){
try{
await window.ethereum.request({ method: "eth_requestAccounts"}).then(res=>{
setAddress(res[0]);
web3 = new Web3(window.ethereum)
setWeb3(web3)
const vm = AdmissionContract(web3)
setVmContract(vm)
})
}catch(err){
setError(err.message)
}
}else{
alert("install metamask extension!!")
}}
Now I want a button which will call a function that disconnect this connected account