Skip to content

Commit

Permalink
change type to ProviderType
Browse files Browse the repository at this point in the history
  • Loading branch information
ordinalspractice committed Jan 17, 2025
1 parent 20e3a00 commit 027a7cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 32 deletions.
22 changes: 2 additions & 20 deletions www/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import { useEffect, useState } from "react";
import {
useLaserEyes,
UNISAT,
MAGIC_EDEN,
OYL,
PHANTOM,
LEATHER,
XVERSE,
OKX,
} from "@omnisat/lasereyes";
import { useLaserEyes, MAGIC_EDEN, ProviderType } from "@omnisat/lasereyes";
import init, { verify } from "@/bip322.js";
import VerifyForm from "@/components/VerifyForm";
import ConnectWalletForm from "@/components/ConnectWallet";
Expand Down Expand Up @@ -77,16 +68,7 @@ function App() {
phantom: hasPhantom,
};

const handleConnect = async (
walletName:
| typeof UNISAT
| typeof MAGIC_EDEN
| typeof OYL
| typeof PHANTOM
| typeof LEATHER
| typeof XVERSE
| typeof OKX
) => {
const handleConnect = async (walletName: ProviderType) => {
if (provider === walletName) {
disconnect();
} else {
Expand Down
Binary file modified www/src/bip322_bg.wasm
Binary file not shown.
19 changes: 7 additions & 12 deletions www/src/components/ConnectWallet.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import { Button } from "@/components/ui/button";
import { SUPPORTED_WALLETS, WalletIcon } from "@omnisat/lasereyes";
import {
ProviderType,
SUPPORTED_WALLETS,
WalletIcon,
} from "@omnisat/lasereyes";
import FormWrapper from "./FormWrapper";

type WalletName =
| "unisat"
| "magic-eden"
| "oyl"
| "phantom"
| "leather"
| "xverse"
| "okx";

interface ConnectWalletFormProps {
provider: string | null;
hasWallet: {
[key: string]: boolean;
};
onConnect: (walletName: WalletName) => Promise<void>;
onConnect: (walletName: ProviderType) => Promise<void>;
onDisconnect: () => void;
}
const ConnectWalletForm = ({
Expand Down Expand Up @@ -64,7 +59,7 @@ const ConnectWalletForm = ({
) : (
<Button
className={`${baseButtonClass} bg-white/90 text-black backdrop-blur-sm`}
onClick={() => onConnect(wallet.name as WalletName)}
onClick={() => onConnect(wallet.name)}
>
<WalletIcon walletName={wallet.name} size={40} />
</Button>
Expand Down

0 comments on commit 027a7cd

Please sign in to comment.