vega-frontend-monorepo/apps/trading/components/vega-wallet-connect-button/index.tsx
Matthew Russell ed8db76af7
Task/AgGrid and responsive nav font size (#130)
* add custom properties to style ag grid tables

* use theme styles, make nav text sizes responsive

* move row and header heights to parent

* use max-w-full
2022-03-24 11:08:57 -07:00

30 lines
651 B
TypeScript

import { useVegaWallet } from '@vegaprotocol/wallet';
interface VegaWalletButtonProps {
setConnectDialog: (isOpen: boolean) => void;
}
export const VegaWalletButton = ({
setConnectDialog,
}: VegaWalletButtonProps) => {
const { disconnect, keypairs } = useVegaWallet();
const isConnected = keypairs !== null;
const handleClick = () => {
if (isConnected) {
disconnect();
} else {
setConnectDialog(true);
}
};
return (
<button
onClick={handleClick}
className="ml-auto inline-block text-ui sm:text-body-large"
>
{isConnected ? 'Disconnect' : 'Connect Vega wallet'}
</button>
);
};