From 00057474f4c5523e678bb012efff6422320426ff Mon Sep 17 00:00:00 2001 From: aquaman122 Date: Sat, 28 Sep 2024 13:54:52 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useSignup.ts | 15 ++++++++++++++- src/pages/Login.tsx | 18 +++++++++++------- src/pages/Signup.tsx | 7 ------- src/pages/User.tsx | 10 ---------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/hooks/useSignup.ts b/src/hooks/useSignup.ts index eb790d3a..fd853cce 100644 --- a/src/hooks/useSignup.ts +++ b/src/hooks/useSignup.ts @@ -53,9 +53,22 @@ export const useSignup = (): any => { setActiveButtonSheet(!activeButtonSheet); }; + const formLink = (link: string) => { + if (link && !link.startsWith('https://')) { + return `https://${link}`; + } + if (link && !link.startsWith('http://')) { + return `http://${link}`; + } + return link; + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any const onSubmit = handleSubmit((data: any) => { - signupMutation.mutate(data); + const formattedLink = formLink(data.link); + const formattedData = { ...data, link: formattedLink }; + + signupMutation.mutate(formattedData); }); return { diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index a8a87a10..48b9b19f 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -1,8 +1,8 @@ import Layout from '@/components/layout/Layout'; import { useNavigate } from 'react-router-dom'; import kakaoImage from '@/assets/images/kakao_login_large_wide.png'; -import naverImage from '@/assets/images/naver_login.png'; import ChizzImage from '@/assets/icons/main_cheese_icon.svg'; +import { SiNaver } from 'react-icons/si'; import { useAuth } from '@/hooks/useAuth'; import { useRefreshTokenOnSuccess } from '@/components/home/queries'; @@ -26,17 +26,21 @@ const Login = () => { kakaoButton
- naverButton + className="w-full h-12 bg-[#1ec800] text-white text-lg rounded-lg flex items-center cursor-pointer hover:bg-[#17b000] focus:ring-2 focus:ring-offset-2 focus:ring-[#17b000] focus:outline-none" + aria-label="네이버 로그인" + > +
+ +
+ 네이버 로그인 +
diff --git a/src/pages/Signup.tsx b/src/pages/Signup.tsx index 82d99cd5..3de6f6e2 100644 --- a/src/pages/Signup.tsx +++ b/src/pages/Signup.tsx @@ -42,18 +42,11 @@ const Signup = () => { const nickname = watch('nickname'); const Selectbank = watch('bankName'); const accountNumber = watch('accountNumber'); - const link = watch('link'); useEffect(() => { setIsFormValid(!!(nickname && Selectbank && accountNumber)); }, [nickname, Selectbank, accountNumber]); - useEffect(() => { - if (link && !link.startsWith('https://')) { - setValue('link', `https://${link}`); - } - }, [link, setValue]); - return ( navigate('/')} /> diff --git a/src/pages/User.tsx b/src/pages/User.tsx index afb67046..ae2c5fd9 100644 --- a/src/pages/User.tsx +++ b/src/pages/User.tsx @@ -4,16 +4,6 @@ import UserProfile from '@/components/user/UserProfile'; import LoginProvider from '@/provider/loginProvider'; const User = () => { - // const [value, setValue] = useState<{ - // roadAddress: string; - // jibun: string; - // zonecode: string; - // }>({ - // roadAddress: '', - // jibun: '', - // zonecode: '', - // }); - return (