Skip to content

Commit

Permalink
Remove theme picker (#50)
Browse files Browse the repository at this point in the history
Co-authored-by: raphjaph <[email protected]>
  • Loading branch information
ordinalspractice and raphjaph authored Jan 17, 2025
1 parent bb2c6b5 commit 12d413f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 112 deletions.
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>
);

0 comments on commit 12d413f

Please sign in to comment.