From 38fcb47023bf8e8e2d3f86503e1501908f10947f Mon Sep 17 00:00:00 2001 From: Rael Date: Sat, 8 Feb 2025 02:42:09 +0900 Subject: [PATCH 01/15] =?UTF-8?q?=F0=9F=94=A7=20config:=20gitignore=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umc-master/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/umc-master/.gitignore b/umc-master/.gitignore index 7a9d1bc..c6ce2fe 100644 --- a/umc-master/.gitignore +++ b/umc-master/.gitignore @@ -24,3 +24,4 @@ dist-ssr *.sw? .vercel +.env \ No newline at end of file From a115218c2736ed3fa2e86d2f527035b3c287e64f Mon Sep 17 00:00:00 2001 From: Rael Date: Sat, 8 Feb 2025 02:56:31 +0900 Subject: [PATCH 02/15] =?UTF-8?q?=E2=9C=A8=20feat:=20=EC=A0=84=EC=B2=B4=20?= =?UTF-8?q?=EC=9D=B4=EC=9A=A9=EC=95=BD=EA=B4=80=20=EC=B2=B4=ED=81=AC?= =?UTF-8?q?=EB=B0=95=EC=8A=A4=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/Signup_components/AgreementForm.tsx | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/umc-master/src/pages/auth/Signup_components/AgreementForm.tsx b/umc-master/src/pages/auth/Signup_components/AgreementForm.tsx index f0eff45..96c3573 100644 --- a/umc-master/src/pages/auth/Signup_components/AgreementForm.tsx +++ b/umc-master/src/pages/auth/Signup_components/AgreementForm.tsx @@ -3,7 +3,7 @@ import Typography from "@components/common/typography"; import styled, { useTheme } from "styled-components"; import ImgAdd from "@assets/add.svg"; import ImgRemove from "@assets/remove.svg"; -import { useEffect, useState } from "react"; +import { useState } from "react"; interface AgreementItemProps { isRequired: boolean; // 필수 여부 @@ -67,10 +67,14 @@ const AgreementForm: React.FC = ({ onCheckRequired }) => { }); // 전체 동의 체크박스 - const handleAllAgreeChange = (checked: boolean) => { - setIsAllAgreed(checked); + const handleAllAgreeChange = () => { + const newCheckedState = !isAllAgreed; + setIsAllAgreed(newCheckedState); const updatedItems = { - terms: checked, privacy: checked, thirdinfo: checked, marketing: checked, + terms: newCheckedState, + privacy: newCheckedState, + thirdinfo: newCheckedState, + marketing: newCheckedState, }; setCheckedItems(updatedItems); onCheckRequired(updatedItems.terms && updatedItems.privacy); @@ -79,22 +83,13 @@ const AgreementForm: React.FC = ({ onCheckRequired }) => { const handleCheckboxChange = (key: string, checked: boolean) => { setCheckedItems((prevState) => { const updatedItems = { ...prevState, [key]: checked }; + const allChecked = Object.values(updatedItems).every(Boolean); + setIsAllAgreed(allChecked); onCheckRequired(updatedItems.terms && updatedItems.privacy); return updatedItems; }); }; - useEffect(() => { - if (isAllAgreed) { - setCheckedItems({ - terms: true, privacy: true, thirdinfo: true, marketing: true, - }); - onCheckRequired(true); - } else { - onCheckRequired(checkedItems.terms && checkedItems.privacy); - } - }, [isAllAgreed, checkedItems, onCheckRequired]); - return ( Date: Sat, 8 Feb 2025 03:18:46 +0900 Subject: [PATCH 03/15] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Typo:=20=ED=95=84?= =?UTF-8?q?=EC=9A=94=EC=97=86=EB=8A=94=20=EC=BD=94=EB=93=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umc-master/src/pages/auth/Login_components/InputForm.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/umc-master/src/pages/auth/Login_components/InputForm.tsx b/umc-master/src/pages/auth/Login_components/InputForm.tsx index 154e78b..0601541 100644 --- a/umc-master/src/pages/auth/Login_components/InputForm.tsx +++ b/umc-master/src/pages/auth/Login_components/InputForm.tsx @@ -1,5 +1,3 @@ -/* eslint-disable react/prop-types */ -/* eslint-disable @typescript-eslint/no-unused-vars */ import Typography from "@components/common/typography"; import styled from "styled-components"; import Input from "@components/Input/Input"; From 8d0df3282822206b16bfa1878c46c5e590229c76 Mon Sep 17 00:00:00 2001 From: Rael Date: Sat, 8 Feb 2025 03:19:26 +0900 Subject: [PATCH 04/15] =?UTF-8?q?=E2=9C=A8=20feat:=20=EB=B9=84=EB=B0=80?= =?UTF-8?q?=EB=B2=88=ED=98=B8=20=EC=9E=85=EB=A0=A5=20=EC=83=81=ED=83=9C=20?= =?UTF-8?q?=EA=B2=80=EC=A6=9D=20=EB=B0=8F=20=EC=97=90=EB=9F=AC=EB=A9=94?= =?UTF-8?q?=EC=8B=9C=EC=A7=80=20=EC=B6=94=EA=B0=80=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/Signup_components/PasswordForm.tsx | 46 +++++++++++++++---- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/umc-master/src/pages/auth/Signup_components/PasswordForm.tsx b/umc-master/src/pages/auth/Signup_components/PasswordForm.tsx index 3fd0414..852f3ac 100644 --- a/umc-master/src/pages/auth/Signup_components/PasswordForm.tsx +++ b/umc-master/src/pages/auth/Signup_components/PasswordForm.tsx @@ -1,6 +1,8 @@ /* eslint-disable react/prop-types */ import Typography from "@components/common/typography"; import Input from "@components/Input/Input"; +import useInput from "@hooks/useInput"; +import { validatePasswordFormat } from "@utils/validation"; import { useEffect, useState } from "react"; import { styled, useTheme } from "styled-components"; @@ -8,17 +10,45 @@ import { styled, useTheme } from "styled-components"; const PasswordForm: React.FC<{ onCheckRequired: (isValid: boolean) => void }> = ({ onCheckRequired }) => { const theme = useTheme(); - - const [password, setPassword] = useState(''); const [confirmPassword, setConfirmPassword] = useState(''); + const [passwordErrorMessage, setPasswordErrorMessage] = useState(''); + const [confirmPasswordErrorMessage, setConfirmPasswordErrorMessage] = useState(''); + const [isPasswordValid, setIsPasswordValid] = useState(false); + + // 비밀번호 상태 검증 및 에러메세지 + const { + input: password, + errorMessage: passwordInputErrorMessage, + changeHandler: passwordChangeHandler, + } = useInput({ + initialValue: "", + validate: async (value) => { + const error = validatePasswordFormat(value); + setIsPasswordValid(!error); // 형식이 맞으면 true, 아니면 false + return error; + } + }); + + // 비밀번호 확인 오류 메시지 실시간 변동 + useEffect(() => { + if (confirmPassword && password !== confirmPassword) { + setConfirmPasswordErrorMessage("비밀번호가 일치하지 않습니다."); + } else { + setConfirmPasswordErrorMessage(""); + } + }, [confirmPassword, password]); + + useEffect(() => { + setPasswordErrorMessage(passwordInputErrorMessage || ""); + }, [passwordInputErrorMessage]); useEffect(() => { - if (password && confirmPassword && password === confirmPassword) { + if (isPasswordValid && confirmPassword && password === confirmPassword) { onCheckRequired(true); } else { onCheckRequired(false); } - }, [password, confirmPassword]); + }, [isPasswordValid, password, confirmPassword]); return ( @@ -27,14 +57,14 @@ const PasswordForm: React.FC<{ onCheckRequired: (isValid: boolean) => void }> = style={{color: theme.colors.primary[700]}} >비밀번호 입력 (필수) * setPassword(e.target.value)} + onChange={passwordChangeHandler} /> void }> = export default PasswordForm; -const Container = styled.div` +const Container = styled.form` display: flex; flex-direction: column; align-items: flex-start; From 1efefebae1c20cadff96ee9c8e7cdfd071181482 Mon Sep 17 00:00:00 2001 From: Rael Date: Sat, 8 Feb 2025 05:00:54 +0900 Subject: [PATCH 05/15] =?UTF-8?q?=E2=9C=A8=20feat:=20=EB=8B=89=EB=84=A4?= =?UTF-8?q?=EC=9E=84=20=EC=83=81=ED=83=9C=20=EA=B2=80=EC=A6=9D=20=EB=B0=8F?= =?UTF-8?q?=20=EC=97=90=EB=9F=AC=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/Signup_components/PrivacyForm.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx b/umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx index 3fc82cb..e91a95d 100644 --- a/umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx +++ b/umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx @@ -17,14 +17,27 @@ const PrivacyForm: React.FC<{ onCheckRequired: (isValid: boolean) => void }> = ( const [districts, setDistricts] = useState([]); const [nickname, setNickname] = useState(""); + const [errorMessage, setErrorMessage] = useState(""); // 닉네임 입력값을 업데이트하는 함수 const handleNicknameChange = (e: React.ChangeEvent) => { const newNickname = e.target.value; setNickname(newNickname); + const nicknameRegex = /^[a-zA-Z0-9ㄱ-ㅎ가-힣._]+$/; - // 닉네임이 0글자 이상일 때만 "다음" 버튼을 활성화 - onCheckRequired(newNickname.length > 0); + if (newNickname.length === 0) { + setErrorMessage("닉네임을 입력해주세요."); + onCheckRequired(false); + } else if (newNickname.length > 11) { + setErrorMessage("닉네임을 최대 10자까지 입력 가능합니다."); + onCheckRequired(false); + } else if (!nicknameRegex.test(newNickname)) { + setErrorMessage("닉네임은 한글, 영문, 숫자, '.', '_' 만 사용할 수 있습니다."); + onCheckRequired(false); + } else { + setErrorMessage(""); + onCheckRequired(true); + } }; // 도시 선택시 구 목록을 업데이트하는 함수 @@ -105,6 +118,7 @@ const PrivacyForm: React.FC<{ onCheckRequired: (isValid: boolean) => void }> = ( style={{color: theme.colors.primary[700]}} >닉네임 (필수) * Date: Fri, 21 Feb 2025 00:42:36 +0900 Subject: [PATCH 06/15] =?UTF-8?q?=E2=9C=A8=20feat:=20=EB=8B=89=EB=84=A4?= =?UTF-8?q?=EC=9E=84=20=EC=97=90=EB=9F=AC=EB=A9=94=EC=84=B8=EC=A7=80=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx b/umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx index cbab484..b2f1f22 100644 --- a/umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx +++ b/umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx @@ -26,6 +26,7 @@ const PrivacyForm: React.FC<{ const handleNicknameChange = (e: React.ChangeEvent) => { const newNickname = e.target.value; setNickname(newNickname); + onNicknameChange(newNickname); const nicknameRegex = /^[a-zA-Z0-9ㄱ-ㅎ가-힣._]+$/; if (newNickname.length === 0) { From 681e3207cdeaba1adbeca7ff6431717c38cd9177 Mon Sep 17 00:00:00 2001 From: rael Date: Fri, 21 Feb 2025 00:51:03 +0900 Subject: [PATCH 07/15] =?UTF-8?q?=F0=9F=92=84=20UI:=20=ED=9A=8C=EC=9B=90?= =?UTF-8?q?=EA=B0=80=EC=9E=85=20=EB=8B=A8=EA=B3=84=20UI=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/auth/Signup_components/SignupState.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/umc-master/src/pages/auth/Signup_components/SignupState.tsx b/umc-master/src/pages/auth/Signup_components/SignupState.tsx index 48f1bf3..d31c7e4 100644 --- a/umc-master/src/pages/auth/Signup_components/SignupState.tsx +++ b/umc-master/src/pages/auth/Signup_components/SignupState.tsx @@ -28,7 +28,8 @@ const SignupState: React.FC = ({ sectionCount }) => { {step} @@ -51,7 +52,7 @@ const Sequence = styled.div` position: relative; display: flex; align-items: center; - gap: 160px; + gap: 130px; ` const Step = styled.div` @@ -85,7 +86,7 @@ const Num = styled.div<{ isActive: boolean }>` const Line = styled.div` position: absolute; top: 30px; - left: 5px; + left: 15px; width: 99%; height: 1px; border: 1px dotted ${({ theme }) => theme.colors.text.lightGray}; From d711b42ff2ef1c590e64c1c10e35063faa31cdb8 Mon Sep 17 00:00:00 2001 From: rael Date: Fri, 21 Feb 2025 00:53:15 +0900 Subject: [PATCH 08/15] =?UTF-8?q?=E2=9C=A8=20feat:=20=EB=B9=84=EB=B0=80?= =?UTF-8?q?=EB=B2=88=ED=98=B8=20=EC=97=90=EB=9F=AC=EB=A9=94=EC=84=B8?= =?UTF-8?q?=EC=A7=80=20=EC=B6=94=EA=B0=80=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umc-master/src/pages/auth/Signup_components/PasswordForm.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/umc-master/src/pages/auth/Signup_components/PasswordForm.tsx b/umc-master/src/pages/auth/Signup_components/PasswordForm.tsx index 570f81a..01ebcf3 100644 --- a/umc-master/src/pages/auth/Signup_components/PasswordForm.tsx +++ b/umc-master/src/pages/auth/Signup_components/PasswordForm.tsx @@ -14,6 +14,7 @@ const PasswordForm: React.FC<{ const theme = useTheme(); + const [confirmPassword, setConfirmPassword] = useState(''); const [passwordErrorMessage, setPasswordErrorMessage] = useState(''); const [confirmPasswordErrorMessage, setConfirmPasswordErrorMessage] = useState(''); @@ -56,8 +57,8 @@ const PasswordForm: React.FC<{ const handlePasswordChange = (e: React.ChangeEvent) => { const newPassword = e.target.value; - setPassword(newPassword); onPasswordChange(newPassword); // 상위 컴포넌트에 전달 + passwordChangeHandler(e); console.log("비밀번호: ", newPassword); }; From 89099cade07d5f68530cdf85bf1d91d820425ebc Mon Sep 17 00:00:00 2001 From: rael Date: Fri, 21 Feb 2025 01:08:37 +0900 Subject: [PATCH 09/15] =?UTF-8?q?=E2=9C=A8=20feat:=20=ED=9A=8C=EC=9B=90?= =?UTF-8?q?=EA=B0=80=EC=9E=85=20=EC=84=B1=EA=B3=B5!=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umc-master/src/pages/auth/SignUpPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/umc-master/src/pages/auth/SignUpPage.tsx b/umc-master/src/pages/auth/SignUpPage.tsx index 48f542f..2efce23 100644 --- a/umc-master/src/pages/auth/SignUpPage.tsx +++ b/umc-master/src/pages/auth/SignUpPage.tsx @@ -43,7 +43,8 @@ const handleNicknameChange = (nickname: string) => { }; const handleHashtagChange = (hashtags: string[]) => { - setHashtag(hashtags); + const hashtagStrings = hashtags.map(hashtag => hashtag.toString()); + setHashtag(hashtagStrings); }; const handleSignUpComplete = async () => { From f21df71cb2c143bee63375e901ef4f508a06f15d Mon Sep 17 00:00:00 2001 From: rael Date: Fri, 21 Feb 2025 01:53:52 +0900 Subject: [PATCH 10/15] =?UTF-8?q?=E2=9C=A8=20feat:=20=EC=9D=B4=EB=A9=94?= =?UTF-8?q?=EC=9D=BC=20=EC=A4=91=EB=B3=B5=20=ED=99=95=EC=9D=B8=20=EB=B0=8F?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=20=EC=95=A0=EB=8B=88=EB=A9=94=EC=9D=B4?= =?UTF-8?q?=EC=85=98=20=EC=B6=94=EA=B0=80=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/Signup_components/EmailForm.tsx | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/umc-master/src/pages/auth/Signup_components/EmailForm.tsx b/umc-master/src/pages/auth/Signup_components/EmailForm.tsx index 647b5c9..bc8465d 100644 --- a/umc-master/src/pages/auth/Signup_components/EmailForm.tsx +++ b/umc-master/src/pages/auth/Signup_components/EmailForm.tsx @@ -30,7 +30,7 @@ const EmailForm: React.FC<{ const [emailSent, setEmailSent] = useState(false); const [verified, setVerified] = useState(false); const [timer, setTimer] = useState(180); - const [retryEnabled, setRetryEnabled] = useState(false); + const [isEmailDuplicate, setIsEmailDuplicate] = useState(false); const fullEmail = localPart && domain ? `${localPart}@${domain}` : ""; @@ -49,9 +49,7 @@ const EmailForm: React.FC<{ timerInterval = setInterval(() => { setTimer((prev) => prev - 1); }, 1000); - } else if (timer === 0) { - setRetryEnabled(true); - } + } return () => { if (timerInterval) { clearInterval(timerInterval); @@ -115,6 +113,25 @@ const EmailForm: React.FC<{ console.log("이메일 입력:", updatedFullEmail); }; + // 이메일 중복 체크 + const checkEmailDuplicate = async () => { + if (!fullEmail) { + alert("이메일을 입력해주세요."); + return; + } + try { + const response = await axiosInstance.post("/check-email", { email: fullEmail }); + if (!response.data.isSuccess) { // isSuccess가 false일 때 사용 가능한 이메일 + setIsEmailDuplicate(false); + alert("이메일이 이미 존재합니다."); + } else { + setIsEmailDuplicate(true); + alert("사용 가능한 이메일입니다."); + } + } catch (error) { + alert("이메일 중복 확인에 실패했습니다."); + } + }; const handleRetry = () => { setLocalPart(""); @@ -123,7 +140,6 @@ const EmailForm: React.FC<{ setEmailSent(false); setVerified(false); setTimer(180); - setRetryEnabled(false); }; return ( @@ -147,7 +163,7 @@ const EmailForm: React.FC<{ {emails.map((email) => ( ))} - @@ -175,7 +199,7 @@ const EmailForm: React.FC<{ variant="titleXxxSmall" style={{color: theme.colors.red[500]}} >남은 시간: {Math.floor(timer / 60)}분 {timer % 60}초 - From 8a5096c56d382b88d4c8241b7af7818045837d5f Mon Sep 17 00:00:00 2001 From: rael Date: Fri, 21 Feb 2025 01:54:08 +0900 Subject: [PATCH 11/15] =?UTF-8?q?=E2=9C=A8=20feat:=20api=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umc-master/src/apis/authApi.ts | 50 ++++++++++------------------------ 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/umc-master/src/apis/authApi.ts b/umc-master/src/apis/authApi.ts index 55d9c5c..0052887 100644 --- a/umc-master/src/apis/authApi.ts +++ b/umc-master/src/apis/authApi.ts @@ -1,38 +1,18 @@ -// import axiosInstance from '@apis/axios-instance'; +import axiosInstance from '@apis/axios-instance'; -// interface UserSignup { -// email: string; -// password: string; -// nickname: string; -// hashtags: string[]; -// } +interface UserSignup { + email: string; + password: string; + nickname: string; + hashtags: string[]; +} -// export const postSignup = async ({ email, password, nickname, hashtags } : UserSignup) => { -// const { data } = await axiosInstance.post(`/signup`, { -// email, -// password, -// nickname, -// hashtags, -// }); -// return data; -// }; - -import axios from 'axios'; - -export const postSignup = async () => { - try { - const response = await axios.post('https://api.hmaster.shop/api/v1/signup', { - email: 'ekos555@naver.com', - password: 'asfa1234!@', - nickname: 'rael', - hashtags: ['봄', '패션', '청소', '요리', '재활용', '주택'] - }, { - headers: { - 'Content-Type': 'application/json' - } - }); - console.log('회원가입 성공:', response.data); - } catch (error) { - console.error('회원가입 오류:', error); - } +export const postSignup = async ({ email, password, nickname, hashtags }: UserSignup) => { + const { data } = await axiosInstance.post(`/signup`, { + email, + password, + nickname, + hashtags, + }); + return data; }; From 53f51b0a6bb261171671d75471b9297c5a4b4620 Mon Sep 17 00:00:00 2001 From: rael Date: Fri, 21 Feb 2025 01:54:29 +0900 Subject: [PATCH 12/15] =?UTF-8?q?=E2=9C=A8=20feat:=20=ED=9A=8C=EC=9B=90?= =?UTF-8?q?=EA=B0=80=EC=9E=85=20=ED=9B=84=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A1=9C=20=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umc-master/src/pages/auth/SignUpPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/umc-master/src/pages/auth/SignUpPage.tsx b/umc-master/src/pages/auth/SignUpPage.tsx index 2efce23..369d34f 100644 --- a/umc-master/src/pages/auth/SignUpPage.tsx +++ b/umc-master/src/pages/auth/SignUpPage.tsx @@ -51,8 +51,8 @@ const handleSignUpComplete = async () => { try { const userSignupData = { email, password, nickname, hashtags }; console.log("회원가입 확인:", userSignupData) - await postSignup(); - navigate("/main"); + await postSignup(userSignupData); + navigate("/login"); } catch (error) { console.error("회원가입 오류:", error); alert("회원가입에 실패했습니다. 다시 시도해주세요."); From 578f97ef49ba26b1c15eddc480060f9ee7ceb9be Mon Sep 17 00:00:00 2001 From: rael Date: Fri, 21 Feb 2025 01:54:52 +0900 Subject: [PATCH 13/15] =?UTF-8?q?=E2=9C=A8=20feat:=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=ED=95=84=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=97=85=EB=A1=9C?= =?UTF-8?q?=EB=93=9C=20=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/Signup_components/PrivacyForm.tsx | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx b/umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx index b2f1f22..570687c 100644 --- a/umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx +++ b/umc-master/src/pages/auth/Signup_components/PrivacyForm.tsx @@ -5,6 +5,7 @@ import { styled, useTheme } from "styled-components"; import CameraImg from "@assets/cameraImg.svg" import { addressOptions, busanDistricts, chungcheongbukDistricts, chungcheongnamDistricts, daeguDistricts, daejeonDistricts, gangwonDistricts, gwangjuDistricts, gyeonggiDistricts, gyeongsangbukDistricts, gyeongsangnamDistricts, incheonDistricts, jejuDistricts, jeollabukDistricts, jeollanamDistricts, sejongDistricts, seoulDistricts } from "../dummydata/region_dummy"; import { useState } from "react"; +import gray_character from '@assets/gray-character.png'; interface District { value: string; @@ -16,9 +17,11 @@ const PrivacyForm: React.FC<{ onNicknameChange: (nickname: string) => void; }> = ({ onCheckRequired, onNicknameChange }) => { + const theme = useTheme(); + + const [profileImageUrl, setProfileImageUrlLocal] = useState(gray_character); const [selectedCity, setSelectedCity] = useState("default"); const [districts, setDistricts] = useState([]); - const [nickname, setNickname] = useState(""); const [errorMessage, setErrorMessage] = useState(""); @@ -103,17 +106,34 @@ const PrivacyForm: React.FC<{ break; } }; - - const theme = useTheme(); + + const handleImageChange = (e: React.ChangeEvent) => { + const file = e.target.files?.[0]; + if (file) { + const reader = new FileReader(); + reader.onloadend = () => { + const imageUrl = reader.result as string; + setProfileImageUrlLocal(imageUrl); // 로컬 상태 업데이트 + // api 연결 + }; + reader.readAsDataURL(file); + } + }; + return ( - 프로필 사진 (선택) - - + + document.getElementById('fileInput')?.click()} + /> + @@ -181,11 +201,13 @@ const Profile = styled.div` gap: 30px; ` -const ProfileImg = styled.div` +const ProfileImage = styled.img` width: 140px; height: 140px; background-color: rgb(230, 230, 230); border-radius: 50%; + object-fit: cover; /* 이미지 비율 유지하면서 잘리도록 설정 */ + object-position: center; /* 이미지의 중심을 기준으로 정렬 */ ` const Img = styled.img` @@ -197,6 +219,10 @@ const Img = styled.img` cursor: pointer; ` +const InputImg = styled.input` + display: none; +` + const Privacy = styled.div` width: 500px; height: 162px; From d981e47aa0a1f1923ace873774b895babae062cf Mon Sep 17 00:00:00 2001 From: rael Date: Fri, 21 Feb 2025 02:15:53 +0900 Subject: [PATCH 14/15] =?UTF-8?q?=E2=9C=A8=20feat:=20=EC=9D=B4=EB=A9=94?= =?UTF-8?q?=EC=9D=BC=20=EC=A4=91=EB=B3=B5=20=ED=99=95=EC=9D=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/auth/Signup_components/EmailForm.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/umc-master/src/pages/auth/Signup_components/EmailForm.tsx b/umc-master/src/pages/auth/Signup_components/EmailForm.tsx index bc8465d..59ecae6 100644 --- a/umc-master/src/pages/auth/Signup_components/EmailForm.tsx +++ b/umc-master/src/pages/auth/Signup_components/EmailForm.tsx @@ -101,6 +101,8 @@ const EmailForm: React.FC<{ onEmailChange(updatedFullEmail); console.log("도메인 변경:", updatedFullEmail); + + setIsEmailDuplicate(false); // 중복 확인 버튼을 다시 활성화 }; const handleEmailChange = (e: React.ChangeEvent) => { @@ -111,6 +113,8 @@ const EmailForm: React.FC<{ onEmailChange(updatedFullEmail); console.log("이메일 입력:", updatedFullEmail); + + setIsEmailDuplicate(false); // 중복 확인 버튼을 다시 활성화 }; // 이메일 중복 체크 @@ -121,15 +125,12 @@ const EmailForm: React.FC<{ } try { const response = await axiosInstance.post("/check-email", { email: fullEmail }); - if (!response.data.isSuccess) { // isSuccess가 false일 때 사용 가능한 이메일 - setIsEmailDuplicate(false); - alert("이메일이 이미 존재합니다."); - } else { + if (response.data.isSuccess) { setIsEmailDuplicate(true); alert("사용 가능한 이메일입니다."); } } catch (error) { - alert("이메일 중복 확인에 실패했습니다."); + alert("이메일이 이미 존재합니다."); } }; From dc5822d315f87d013d177ba22aa21f57dd3e57c1 Mon Sep 17 00:00:00 2001 From: rael Date: Fri, 21 Feb 2025 03:54:50 +0900 Subject: [PATCH 15/15] =?UTF-8?q?=F0=9F=92=84=20UI:=20=ED=9A=8C=EC=9B=90?= =?UTF-8?q?=EA=B0=80=EC=9E=85=20=EC=84=B1=EA=B3=B5=20alert=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umc-master/src/pages/auth/SignUpPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/umc-master/src/pages/auth/SignUpPage.tsx b/umc-master/src/pages/auth/SignUpPage.tsx index 369d34f..0036ff2 100644 --- a/umc-master/src/pages/auth/SignUpPage.tsx +++ b/umc-master/src/pages/auth/SignUpPage.tsx @@ -52,6 +52,7 @@ const handleSignUpComplete = async () => { const userSignupData = { email, password, nickname, hashtags }; console.log("회원가입 확인:", userSignupData) await postSignup(userSignupData); + alert("회원가입 성공!"); navigate("/login"); } catch (error) { console.error("회원가입 오류:", error);