How to hide my userInfo element

Should i write it this way or how?

Moralis.onAccountsChanged(async function(accounts) {
    await Moralis.unlink(address);
    if (user) {
        const confirmed = unlinked(
            "Are you sure you want to unlink this address from your account?"
        );
        if (confirmed) {
            alert("Address unlink!");
            console.log("Address unlinked");
        }
    }
});

documentation: https://docs.moralis.io/moralis-server/web3/web3#linking

I don’t know what you did in that function
you can create a button that does only the unlink can calls
await Moralis.unlink(address);
but you’ll have to get current address in order to call Moralis.unlink