From a45d93338fc7d7a5ed326934c8d36b74c47cf475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=8D=E9=97=B2=E7=8A=AC?= <76519998+xqvvu@users.noreply.github.com> Date: Tue, 29 Jul 2025 20:34:50 +0800 Subject: [PATCH] fix: fix the login container; fix the incorrect input of captcha enter trigger (#5327) --- .../support/user/safe/SendCodeAuthModal.tsx | 34 +++++++++++-------- .../src/pageComponents/login/LoginModal.tsx | 2 +- .../app/src/pageComponents/login/index.tsx | 4 +-- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/projects/app/src/components/support/user/safe/SendCodeAuthModal.tsx b/projects/app/src/components/support/user/safe/SendCodeAuthModal.tsx index 01df67b6f..915dd0ba4 100644 --- a/projects/app/src/components/support/user/safe/SendCodeAuthModal.tsx +++ b/projects/app/src/components/support/user/safe/SendCodeAuthModal.tsx @@ -32,6 +32,20 @@ const SendCodeAuthModal = ({ runAsync: getCaptcha } = useRequest2(() => getCaptchaPic(username), { manual: false }); + const onSubmit = async ({ code }: { code: string }) => { + await onSendCode({ username, captcha: code }); + onClose(); + }; + + const onError = (err: any) => { + console.log(err); + }; + + const handleEnterKeyDown = (e: React.KeyboardEvent) => { + if (e.key.toLowerCase() !== 'enter') return; + handleSubmit(onSubmit, onError)(); + }; + return ( @@ -55,25 +69,17 @@ const SendCodeAuthModal = ({ /> - + - diff --git a/projects/app/src/pageComponents/login/LoginModal.tsx b/projects/app/src/pageComponents/login/LoginModal.tsx index d2cdf69ba..258dc01d1 100644 --- a/projects/app/src/pageComponents/login/LoginModal.tsx +++ b/projects/app/src/pageComponents/login/LoginModal.tsx @@ -23,7 +23,7 @@ const LoginModal = ({ onSuccess }: LoginModalProps) => { maxW="556px" maxH={['100vh', '90vh']} borderRadius={[0, '16px']} - overflow="auto" + overflow="hidden" > )} - + {/* main content area */} - + {pageType && DynamicComponent ? DynamicComponent : }