Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the user to disconnect from the Cartridge Controller #12

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/dev-dist/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ define(['./workbox-20a2f87f'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812"
}, {
"url": "index.html",
"revision": "0.qiado3ofr4g"
"revision": "0.d3t8v1f51lg"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import { useConnect, useAccount } from "@starknet-react/core";
import { useConnect, useAccount, useDisconnect} from "@starknet-react/core";
import dojo from '../../img/dojo-icon.svg'

const ControllerConnectButton = () => {
const { connect, connectors } = useConnect();
const { address, status } = useAccount();
const { disconnect } = useDisconnect()

return (
<div>
{connectors.map((connector) => (
status === "connected" ? (
<button
key={connector.id}
className="connect-btn"
>
Account ...{address?.slice(-6)}
</button>
<div key={connector.id}>
<button className="connect-btn">
Account ...{address?.slice(-6)}
</button>
<button
onClick={() => disconnect()}
className="connect-btn"
>
Disconnect
</button>
</div>
) : (
<button
key={connector.id}
Expand Down