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

Remove theme picker #50

Merged
merged 4 commits into from
Jan 17, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
www/bip322*
**/node_modules
**/dist
.vite
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
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
73 changes: 0 additions & 73 deletions www/src/components/theme-provider.tsx

This file was deleted.

16 changes: 9 additions & 7 deletions www/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { LaserEyesProvider, MAINNET } from "@omnisat/lasereyes";
import { ThemeProvider } from "@/components/theme-provider";
import "./index.css";
import App from "./App.tsx";

createRoot(document.getElementById("root")!).render(
document.documentElement.classList.add("dark");
const root = document.getElementById("root")!;
root.classList.add("dark");

createRoot(root).render(
<StrictMode>
<ThemeProvider defaultTheme="dark" storageKey="vite-ui-theme">
<LaserEyesProvider config={{ network: MAINNET }}>
<App />
</LaserEyesProvider>
</ThemeProvider>
<LaserEyesProvider config={{ network: MAINNET }}>
<App />
</LaserEyesProvider>
</StrictMode>
);

Loading