From 1691ade973474a258fc7a608ab8324d97c70803c Mon Sep 17 00:00:00 2001 From: aidanaden Date: Mon, 23 Sep 2024 18:12:29 +0800 Subject: [PATCH] feat: basic working mobile --- examples/start-tailwind/src/app.tsx | 30 ++- examples/start-tailwind/src/routes/index.tsx | 30 --- lefthook.yml | 35 ++++ packages/core/src/constants.ts | 54 +++++ packages/core/src/environment.ts | 8 - packages/core/src/events.ts | 6 +- packages/core/src/hardcoded-wallet-adapter.ts | 79 +++++++ packages/core/src/index.ts | 1 + packages/core/src/store.ts | 195 +++++++++++++----- packages/solid/src/useWallet.ts | 8 +- .../UnifiedWalletModal/Onboarding.tsx | 13 +- .../UnifiedWalletModal/WalletListItem.tsx | 35 ++-- .../components/UnifiedWalletModal/index.tsx | 130 ++++++------ .../components/UnifiedWalletModal/test.tsx | 38 ---- .../components/UnifiedWalletModal/types.ts | 15 -- packages/unified/src/contexts/index.ts | 1 - .../unified/HardcodedWalletStandardAdapter.ts | 77 ------- .../src/contexts/unified/localstorage.ts | 4 + .../src/contexts/unified/useUnifiedWallet.tsx | 114 +++------- packages/unified/src/custom-element.tsx | 5 +- 20 files changed, 457 insertions(+), 421 deletions(-) create mode 100644 lefthook.yml create mode 100644 packages/core/src/hardcoded-wallet-adapter.ts delete mode 100644 packages/unified/src/components/UnifiedWalletModal/test.tsx delete mode 100644 packages/unified/src/components/UnifiedWalletModal/types.ts delete mode 100644 packages/unified/src/contexts/unified/HardcodedWalletStandardAdapter.ts create mode 100644 packages/unified/src/contexts/unified/localstorage.ts diff --git a/examples/start-tailwind/src/app.tsx b/examples/start-tailwind/src/app.tsx index c90d41f..0d4cad8 100644 --- a/examples/start-tailwind/src/app.tsx +++ b/examples/start-tailwind/src/app.tsx @@ -5,9 +5,21 @@ import { Router } from "@solidjs/router" import { FileRoutes } from "@solidjs/start/router" import { Suspense } from "solid-js" import { WalletProvider } from "@solana-wallets-solid/solid" +import { UnifiedWalletProviderProps, UnifiedWalletButtonProps } from "@solana-wallets-solid/unified" import Nav from "~/components/Nav" +declare module "solid-js" { + namespace JSX { + interface IntrinsicElements { + "unified-wallet-modal": UnifiedWalletProviderProps + } + interface IntrinsicElements { + "unified-wallet-modal-button": UnifiedWalletButtonProps + } + } +} + export default function App() { // const adapters = [ // new CoinbaseWalletAdapter(), @@ -39,23 +51,7 @@ export default function App() { localStorageKey="unified:wallet-stoarge-key" env="devnet" > - +