Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: 로그인 버튼 스타일 수정 #59

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/hooks/useSignup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
18 changes: 11 additions & 7 deletions src/pages/Login.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -26,17 +26,21 @@ const Login = () => {
<img
src={kakaoImage}
alt="kakaoButton"
className="w-full h-full object-cover cursor-pointer rounded-lg"
className="w-full h-full object-cover cursor-pointer rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-[#c8b612] focus:outline-none"
onClick={handleKakaoLogin}
/>
</div>
<div className="w-[320px] h-12 ">
<img
src={naverImage}
alt="naverButton"
className="w-full h-full object-cover cursor-pointer rounded-lg"
<button
onClick={handleNaverLogin}
/>
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="네이버 로그인"
>
<div className="flex items-center justify-center w-12 h-full rounded-l-lg">
<SiNaver size={24} />
</div>
<span className="flex-grow mr-6">네이버 로그인</span>
</button>
</div>
</div>
</div>
Expand Down
7 changes: 0 additions & 7 deletions src/pages/Signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Layout>
<Layout.Header title="회원가입" handleBack={() => navigate('/')} />
Expand Down
10 changes: 0 additions & 10 deletions src/pages/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<LoginProvider>
<div className="flex flex-col">
Expand Down