From 763b7d17f586d63fc58bc74922e73b096f901e5c Mon Sep 17 00:00:00 2001 From: jmderby Date: Tue, 29 Oct 2024 16:11:30 -0700 Subject: [PATCH] fixed issue with dialog styles --- .../ui/react-ui/src/components/auth/AuthForm.tsx | 4 ++-- .../src/components/auth/AuthFormDialog.tsx | 8 +++++++- .../auth/methods/web3/Web3ConnectButton.tsx | 13 ++++--------- .../auth/methods/web3/Web3ProviderButton.tsx | 10 +++------- .../components/auth/methods/web3/Web3Providers.tsx | 3 +-- .../components/auth/methods/web3/Web3SignIn.tsx | 14 +++++--------- .../ui/react-ui/src/components/common/Dialog.tsx | 3 ++- packages/client/ui/react-ui/tsup.config.ts | 2 +- 8 files changed, 25 insertions(+), 32 deletions(-) diff --git a/packages/client/ui/react-ui/src/components/auth/AuthForm.tsx b/packages/client/ui/react-ui/src/components/auth/AuthForm.tsx index 49d99cd20..44ef83b28 100644 --- a/packages/client/ui/react-ui/src/components/auth/AuthForm.tsx +++ b/packages/client/ui/react-ui/src/components/auth/AuthForm.tsx @@ -36,17 +36,17 @@ export function AuthForm({ className }: { className?: string }) { ) : null} - {loginMethods.includes("web3") ? : null} {loginMethods.includes("google") ? : null} {loginMethods.includes("farcaster") ? ( ) : null} + {loginMethods.includes("web3") ? : null} {step === "initial" || step === "otp" ? ( ) : null} diff --git a/packages/client/ui/react-ui/src/components/auth/AuthFormDialog.tsx b/packages/client/ui/react-ui/src/components/auth/AuthFormDialog.tsx index 8909686ba..add1d56b3 100644 --- a/packages/client/ui/react-ui/src/components/auth/AuthFormDialog.tsx +++ b/packages/client/ui/react-ui/src/components/auth/AuthFormDialog.tsx @@ -2,12 +2,18 @@ import { VisuallyHidden } from "@radix-ui/react-visually-hidden"; import { useAuthForm } from "@/providers/auth/AuthFormProvider"; import { AuthForm } from "./AuthForm"; import { Dialog, DialogContent, DialogDescription, DialogTitle } from "../common/Dialog"; +import { useEffect } from "react"; export default function AuthFormDialog({ open }: { open: boolean }) { const { appearance, setDialogOpen } = useAuthForm(); + // todo come up with a better solution for this! + useEffect(() => { + document.body.style.overflow = open ? "hidden" : ""; + }, [open]); + return ( - + e.preventDefault()} onOpenAutoFocus={(e) => e.preventDefault()} diff --git a/packages/client/ui/react-ui/src/components/auth/methods/web3/Web3ConnectButton.tsx b/packages/client/ui/react-ui/src/components/auth/methods/web3/Web3ConnectButton.tsx index 82c80a7db..7b6b6f8e4 100644 --- a/packages/client/ui/react-ui/src/components/auth/methods/web3/Web3ConnectButton.tsx +++ b/packages/client/ui/react-ui/src/components/auth/methods/web3/Web3ConnectButton.tsx @@ -37,19 +37,14 @@ export function Web3ConnectButton({ ); diff --git a/packages/client/ui/react-ui/src/components/auth/methods/web3/Web3Providers.tsx b/packages/client/ui/react-ui/src/components/auth/methods/web3/Web3Providers.tsx index fa7b2e5c2..323944f3f 100644 --- a/packages/client/ui/react-ui/src/components/auth/methods/web3/Web3Providers.tsx +++ b/packages/client/ui/react-ui/src/components/auth/methods/web3/Web3Providers.tsx @@ -24,7 +24,7 @@ export function Web3Providers() { Connect wallet -
+
- {/* metamask stuff */} ); diff --git a/packages/client/ui/react-ui/src/components/auth/methods/web3/Web3SignIn.tsx b/packages/client/ui/react-ui/src/components/auth/methods/web3/Web3SignIn.tsx index 6fad76a77..679355885 100644 --- a/packages/client/ui/react-ui/src/components/auth/methods/web3/Web3SignIn.tsx +++ b/packages/client/ui/react-ui/src/components/auth/methods/web3/Web3SignIn.tsx @@ -13,16 +13,14 @@ export function Web3SignIn() { return ( ); } diff --git a/packages/client/ui/react-ui/src/components/common/Dialog.tsx b/packages/client/ui/react-ui/src/components/common/Dialog.tsx index e5db38183..1d4a1d03f 100644 --- a/packages/client/ui/react-ui/src/components/common/Dialog.tsx +++ b/packages/client/ui/react-ui/src/components/common/Dialog.tsx @@ -33,7 +33,8 @@ interface DialogContentProps extends React.ComponentPropsWithoutRef, DialogContentProps>( ({ className, children, showCloseButton = true, closeButtonColor, closeButtonRingColor, ...props }, ref) => ( - + {/* Because we're using modal={false}, the regular overlay is not shown. We need to add our own overlay */} +