import { useZigap } from 'zigap-utils';
import { useZigap } from 'zigap-utils';
...
const Component = () => {
const { userInfo, logout, isWindowLoaded } = useZigap();
const handleLogout = () => {
if(isWindowLoaded) {
logout();
window.location.reload();
}
}
return (
<div>
<p>Address: {userInfo.address}</p>
<p>Network: {userInfo.network}</p>
<p>Nickname: {userInfo.nickName}</p>
<p>Token: {userInfo.token}</p>
<p>Issued DateTime: {userInfo.issuedDateTime}</p>
<p>Expire DateTime: {userInfo.expireDateTime}</p>
<button onClick={handleLogout}> LOGOUT </button>
</div>
);
}
It is a function that delete only the stored local storage value. Refresh the page if necessary.