From 01c1832ad3568904f28c3e034aeb0af97a7c82f6 Mon Sep 17 00:00:00 2001 From: Munchies Date: Fri, 21 Jun 2024 09:12:34 +1000 Subject: [PATCH] Add React import, update connector type, refactor Button component styling, create Input component with label handling. - Added React import for Account.tsx - Updated connector type to 'any' in Account.tsx - Refactored Button component styling in Button.tsx - Created Input component with label handling in Input.tsx --- .../src/components/Account/Account.tsx | 7 +- .../src/components/AuthModal/AuthModal.tsx | 18 +--- .../components/AuthOptions/AuthOptions.tsx | 22 ++--- .../src/components/Button/Button.tsx | 11 ++- .../src/components/EmailLogin/EmailLogin.tsx | 78 ++++++++---------- .../moon-react/src/components/Input/Input.tsx | 31 +++++++ .../moon-react/src/components/Input/index.ts | 1 + .../moon-react/src/components/Modal/Modal.tsx | 22 ++++- .../components/Oauth2Button/Oauth2Button.tsx | 1 + .../SignInAnonymously/SignInAnonymously.tsx | 2 +- .../components/SocialLogins/SocialLogins.tsx | 82 +++++++++---------- .../WalletConnectorList.tsx | 40 ++++----- .../WebAuthnComponent/WebAuthnComponent.tsx | 1 + packages/moon-react/src/constants.ts | 8 +- packages/moon-react/src/context/Context.tsx | 52 ++++++------ .../moon-react/src/hooks/useConnectToMoon.ts | 4 +- .../src/hooks/useWalletConnectors.tsx | 3 +- 17 files changed, 204 insertions(+), 179 deletions(-) create mode 100644 packages/moon-react/src/components/Input/Input.tsx create mode 100644 packages/moon-react/src/components/Input/index.ts diff --git a/packages/moon-react/src/components/Account/Account.tsx b/packages/moon-react/src/components/Account/Account.tsx index 0eb8431..fd407e7 100644 --- a/packages/moon-react/src/components/Account/Account.tsx +++ b/packages/moon-react/src/components/Account/Account.tsx @@ -1,6 +1,7 @@ import { useEffect } from "react"; import { useMoonSDK } from "../../context"; import { useAccount, useConnect, useSwitchChain } from "wagmi"; +import React from "react"; function Account() { const { address, status } = useAccount(); @@ -38,7 +39,7 @@ function Account() { const getBalance = async (wallet: string) => { // moon connector console.log(connectors); - const conn = connectors.find((connector) => connector.name === "Moon"); + const conn = connectors.find((connector: any) => connector.name === "Moon"); console.log(conn); setWallet(wallet); console.log("wallet", wallet); @@ -99,7 +100,7 @@ function Account() {