-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/#185: 구글 로그인 & 회원가입 #191
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
Changes from all commits
01c0e5f
528d6e3
c2472e0
0dcf5a6
9e08f07
a914672
346a772
1be5606
a31f29b
da83e3a
9d7c990
f543ca0
0d3338f
7565528
4785042
3ffa49b
947abdf
c358012
dfc7757
b8573e3
09c625c
f5ffcec
4861c5f
3ac3e78
a7e6efc
f51ad81
43e628b
fea6663
305ae66
2d342bb
fba1da2
15fc895
b067b27
3e8b04d
15244b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import React from 'react'; | ||
| import { JoinForm } from '@/features/Join'; | ||
| import { Metadata } from 'next'; | ||
| import GoogleJoinForm from '@/features/Join/components/GoogleJoinForm'; | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: '회원가입', | ||
|
|
@@ -12,8 +13,10 @@ export const metadata: Metadata = { | |
| }, | ||
| }; | ||
|
|
||
| function JoinPage() { | ||
| return <JoinForm />; | ||
| function JoinPage({ searchParams }: { searchParams: { type: string } }) { | ||
| const { type } = searchParams; | ||
|
|
||
| return type === 'google' ? <GoogleJoinForm /> : <JoinForm />; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 구글 로그인은 회원가입 플로우가 단축돼서 별도 컴포넌트로 만들었어요 |
||
| } | ||
|
|
||
| export default JoinPage; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,7 @@ function GenderSelector({ theme }: Props) { | |
| <button | ||
| type='button' | ||
| onClick={() => handleClick('남성')} | ||
| className={`${buttonStyle} ${(watch('personal_infos.gender.value') === '남성' || typeof window === 'undefined') && selected}`} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 흠 이것도 ssr 때문에 넣어놓은 걸로 기억하는데
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 다시한번 확인해볼게요 ~
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 생각해보니까 이건 지워도 될거같아요, 성별 선택이 required로 변경되면서 서버사이드에서 미리 선택할 필요 없다고 생각.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저번에도 남긴 것처럼 next는 기본적으로 모든 컴포넌트는 ssr로 동작하고, hydration이 클라이언트에서 이뤄지는 걸로 알고 있어요. 'use client' 라는 지시자가 이 컴포넌트를 완전히 클라이언트에서 렌더링 한다는 의미는 아닙니다
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 예전에 과제리뷰할때 서버에서 초기 데이터 패칭하고 클라이언트 컴포넌트로 초기데이터 prop 넘겨주는 방식으로 ssr 챙긴다고 했다가, next dev tools로 확인해 봤는데 초기데이터로 prop 받은 컴포넌트가 빈 html로 오고 있다고 ssr이 안되고 있다고 리뷰를 받은적이 있어서 뭐가 맞아요 ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 클라이언트 컴포넌트는 직렬화된 Json 같은 형태로 내려온다고 알고 있는데, 이것도 ssr이에요 ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저는 next.js 클라이언트 컴포넌트를 dynamic으로 불러오지 않는 이상 완전히 csr 되는게 아닌 걸로 알고 있고, html 뼈대 같은 정적인 틀은 ssr 되는 걸로 알고 있어요. 직렬화된 json으로 전달된다는 건 클라이언트 컴포넌트만 적용되는게 아니라 server + client component 조합의 react tree입니다 참고..
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 지민님이 보내주신 링크에도 클라이언트 사이드 상태 업데이트는 useEffect 나 useState를 사용하라는데, 이걸 지피티 한테 물어보니까 서버사이드에서 window === undefined로 선택한 상태와, 렌더링이 되면서 watch로 선택한 상태가 서로 불일치하는 하이드레이션 에러가 발생할 수 있다고 해요. 여기서는 해당되지 않는거 같은데 다른데에서 이런 방식 사용처가 있을경우 한번더 고민해보는게 좋을듯 합니다 ~
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 음 그런데 실제로는 우리가 이 폼의 값을 실시간으로 저장해놓지 않기 때문에(step 넘어가면 저장하는 걸로 알고 있음) 새로고침하면 클라이언트 상태가 초기화되어서 hydration 에러는 일어나지 않습니다. 그래서 초기값을 서버 = 클라이언트가 같은 값을 가지도록 설정한거구요 |
||
| className={`${buttonStyle} ${watch('personal_infos.gender.value') === '남성' && selected}`} | ||
| > | ||
| 남성 | ||
| </button> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| export const JOBS = [ | ||
| { id: 0, value: '선택' }, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이거 가입 시에 포함 안되게 필터링 하신거죠?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. jobs 선택이 필수여서 초기값을 변경했어요 |
||
| { id: 1, value: '학생' }, | ||
| { id: 2, value: '기획/마케팅/경영' }, | ||
| { id: 3, value: '디자인/크리에이티브' }, | ||
|
|
||
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.
여기서만 사용되는데 handleGoogleAuth라고 한번 더 감싸야 하는 이유가 있나요?
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.
그렇긴 하네요 바로 handleGoogleSignIn 해도 될듯