-
Notifications
You must be signed in to change notification settings - Fork 0
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
[ 4주차 기본/생각 과제 ] 로그인/회원가입 🍁 #7
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고했습니댜!!!!
우리 리팩하구 머지도 해보쟝 (나한테 하는 말)
함세도 하이팅 🖤
"dependencies": { | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오잉 axios가 설치가 안되어 있나용 ?! 확인 해보면 좋을것 같습니댜
import axios from "axios"; | ||
import React, { useState } from "react"; | ||
import { Link, useNavigate } from "react-router-dom"; | ||
import { St } from "../styles/Design"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 스타일 파일을 따로 만든 이유가 이쓸까요 ?!
궁금합니댜 💭!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는, , ,, 여러파일에서 동일한 styled component가 반복해서 쓰이면 그걸 매 파일마다 작성하기 귀찮아증후군이 있기 때문에 ,, 분리해서 import해서 사용하곤합니당 ,,
<Link to={"/signup"}> | ||
<St.RegisterButton type="button">회원가입</St.RegisterButton> | ||
</Link> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link 자체를 스타일링 하는 방법두 있어용!
RegisterLink = styled(Link)
이런식으로 가능합니다!
참고참고 ~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헐랭! 합세때 바로 써먹어봐야징 ,,
{/* <St.RegisterButton onClick={onRegisterBtnClick}> | ||
회원가입 | ||
</St.RegisterButton> */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
주석 지우기 얍!
setUserName(response.data.username); | ||
setNickName(response.data.nickname); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const {username, nickname} = responose.data
=> 이런식으로 구조분해 할당으로 가져오는것도 가능합니당!
}); | ||
useEffect(() => { | ||
if ( | ||
isExist === false && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요건 이렇게도 쓸 수 있을것 같아요!
!isExist &&
useEffect(() => { | ||
if ( | ||
isExist === false && | ||
!Object.values(userInfo).some((each) => each === "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헉 대박 이런 깔끔한 방법이 ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmi... 코테스터디에서 배운 some함수 과제할때 쏠쏠하게 활용중임니다 ..
// value={userInfo.password} | ||
// onChange={onInfoChange} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
주석 지우깅 !
{disabled ? ( | ||
<St.SubmitButton type="button" disabled isdisabled={disabled}> | ||
회원가입 | ||
</St.SubmitButton> | ||
) : ( | ||
<St.SubmitButton type="button" onClick={onRegisterBtnClick}> | ||
회원가입 | ||
</St.SubmitButton> | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disable 설정은 props로 내려줘서 props에 따라 styled-component에서 버튼 색을 다르게 구현해줄수 있구,
onClick도 disabled가 아닌 경우에만 가능하게 함수에서 설정 해줘도 좋을것 같습니당!
참고하깅 !
{ | ||
"dependencies": { | ||
"axios": "^1.6.2", | ||
"react-router-dom": "^6.19.0", | ||
"styled-components": "^6.1.1" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오잉 여깄다..! 왜 package.json이 두 개가 생겼지 ?!?!
확인 해봅시다!!!1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이번주도 넘 고생했댜!! 합세 파이팅팅
useEffect(() => { | ||
if ( | ||
isExist === false && | ||
!Object.values(userInfo).some((each) => each === "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이런 방법도 있었구만!!!
}, [isExist, userInfo]); | ||
|
||
const onInfoChange = (e) => { | ||
setUserInfo({ ...userInfo, [e.target.name]: e.target.value.toString() }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
문자열로 바꿔주는 섬세함 좋댜
<St.InputCategory>ID</St.InputCategory> | ||
<St.InputBox | ||
required | ||
name="id" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required는 뭔가여??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
원래 form 태그 + input 이런식으로 활용할때, input에 required가 추가되어있으면, 저 input을 채워야만 form이 제출되는걸로 알고있어용!! 이번엔 필요없던 내용같당 빼야겠다 헤헹
const [username, setUserName] = useState(""); | ||
const [nickname, setNickName] = useState(""); | ||
useEffect(() => { | ||
userId !== "" && getUserInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 코드는 결고ㅏ가 어떻게 나오는건가요??!!,,,
✨ 구현 기능 명세
🌱 기본 조건
.env
파일 사용하기🧩 기본 과제
[ 로그인 페이지 ]
/mypage/:userId
로 넘어갑니다. (여기서userId
는 로그인 성공시 반환 받은 사용자의 id)/signup
으로 이동합니다.[ 회원가입 페이지 ]
중복체크 버튼
회원가입 버튼
/login
으로 이동합니다.[ 마이 페이지 ]
/mypage/:userId
의 userId를 이용해 회원 정보를 조회합니다.🌠 심화 과제
[ 로그인 페이지 ]
createPortal
을 이용합니다.[ 회원가입 페이지 ]
비밀번호 확인
중복체크
생각과제
💎 PR Point
🥺 소요 시간, 어려웠던 점
5h
🌈 구현 결과물
https://www.notion.so/dosopt/4-f1ce1b05d2594c57851ebe92b5585a01?pvs=4