-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from Yeungnam-Nyang/feature/MyProfile
Feature/my profile
- Loading branch information
Showing
49 changed files
with
895 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,4 +75,4 @@ function App() { | |
); | ||
} | ||
|
||
export default App; | ||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export default function Button({ text, type, isValid, onClick }) { | ||
// text : 버튼 이름 | ||
// type : 버튼 제출 타입 | ||
// isValid : 입력값 유효 할 시 버튼 색 변경 및 클릭 가능 | ||
// onClick : 클릭 시 실행 함수 | ||
|
||
return isValid ? ( | ||
// 버튼 활성화 | ||
<button | ||
type={type} | ||
onClick={onClick} | ||
className="font-['BagelFatOne'] text-white w-10/12 m-auto h-16 gap-4 flex bg-black text-xl justify-center | ||
items-center shadow-2xl hover:scale-110 duration-500 rounded-[40px]" | ||
> | ||
{text} | ||
</button> | ||
) : ( | ||
// 버튼 비활성화 | ||
<button | ||
type={type} | ||
disabled | ||
className="font-['BagelFatOne'] text-black w-10/12 m-auto h-16 gap-4 flex bg-white text-xl justify-center | ||
items-center shadow-2xl rounded-[40px]" | ||
> | ||
{text} | ||
</button> | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
export default function Title({ text, select = "paw" }) { | ||
return ( | ||
<div className="flex items-center p-3 gap-4 "> | ||
<img | ||
alt="foot" | ||
src={ | ||
select === "fire" | ||
? `${import.meta.env.VITE_PUBLIC_URL}/assets/images/icon_fire.png` | ||
: `${import.meta.env.VITE_PUBLIC_URL}/assets/images/icon_pow.png` | ||
} | ||
className="w-12 h-auto" | ||
/> | ||
<h1 className="font-['Bungee'] text-4xl">{text}</h1> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ html { | |
|
||
@media (max-width: 768px) { | ||
html { | ||
font-size: 14px; | ||
font-size: 14px; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function FriendList() { | ||
return <></>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
.popup{ position: fixed; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
background: rgba(0, 0, 0, 0.5); /* 반투명 배경 */ | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.popup-inner{ | ||
background: white; | ||
padding: 1.25rem; | ||
border-radius: 0.5rem; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); | ||
display: flex; | ||
flex-direction: column; /* 세로로 쌓이도록 설정 */ | ||
border-radius: 0.5rem; | ||
width: 31.25rem; | ||
height: 18.75rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,89 @@ | ||
import React from 'react'; | ||
import React, { useState } from 'react'; | ||
import Logo from '../../components/common/Logo'; | ||
import Button from "../../components/common/Button"; | ||
import './FindPassword.css'; | ||
import axios from 'axios'; | ||
|
||
export default function FindPassword() { | ||
return <> | ||
<div className='Findpw-Container'> | ||
<Logo /> | ||
<Button text={""} isValid={true} /> | ||
</div> | ||
|
||
</>; | ||
const [userId, setUserId] = useState(""); | ||
const [userQuestion, setQuestion] = useState(''); | ||
const [userAnswer, setAnswer] = useState(''); | ||
const [tempPassword, setTempPassword] = useState(''); | ||
const [showPopup, setShowPopup] = useState(false); | ||
const API_URL=import.meta.env.VITE_SERVER_URL; | ||
const questions = [ | ||
"당신이 태어난 도시의 이름은 무엇입니까?", | ||
"당신의 첫 번째 학교 이름은 무엇입니까?", | ||
"당신이 가장 좋아하는 음식은 무엇입니까?", | ||
"당신의 첫 번째 애완동물 이름은 무엇입니까?", | ||
"당신의 어머니의 이름은 무엇입니까?", | ||
]; | ||
|
||
const handleButtonClick = async () => { | ||
try { | ||
// 서버로 요청 보낼 데이터s | ||
const requestData = { | ||
userId, | ||
userQuestion, | ||
userAnswer | ||
}; | ||
|
||
// 서버로 POST 요청 보내기 | ||
const response = await axios.post(`${API_URL}/api/send/new-password`, requestData); | ||
|
||
// 서버로부터 임시 비밀번호 받기 | ||
setTempPassword(response.data.tempPassword); | ||
setShowPopup(true); // 팝업 띄우기 | ||
} catch (error) { | ||
alert('정보를 확인해주세요. 오류가 발생했습니다.'); | ||
console.error(error); | ||
} | ||
}; | ||
|
||
return ( | ||
<> | ||
<div className='Find-Container'> | ||
<Logo /> | ||
<h2 className='Find-tittle'>FIND PW</h2> | ||
<input | ||
type="text" | ||
value={userId} | ||
onChange={(e) => setUserId(e.target.value)} | ||
placeholder="아이디를 입력하세요." | ||
className="input-field" | ||
/> | ||
<select | ||
id="questionDropdown" | ||
value={userQuestion} | ||
onChange={(e) => setQuestion(e.target.value)} | ||
className="Select" | ||
> | ||
<option value="">질문을 선택하세요.</option> | ||
{questions.map((question, index) => ( | ||
<option key={index} value={question}>{question}</option> | ||
))} | ||
</select> | ||
<input | ||
type="text" | ||
value={userAnswer} | ||
onChange={(e) => setAnswer(e.target.value)} | ||
placeholder="답변을 입력하세요." | ||
className="input-field" | ||
/> | ||
<Button type="button" text={"임시 PW 받기"} isValid={true} onClick={handleButtonClick} /> | ||
</div> | ||
|
||
{/* 팝업 모달 */} | ||
{showPopup && ( | ||
<div className="popup"> | ||
<div className="popup-inner"> | ||
|
||
<p>{tempPassword}</p> {/* 서버에서 받은 임시 비밀번호 표시 */} | ||
|
||
<Button text={"닫기"} isValid={true} onClick={() => setShowPopup(false)}/> | ||
</div> | ||
</div> | ||
)} | ||
</> | ||
); | ||
} |
Oops, something went wrong.