-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] 구글 로그인 회원가입 및 온보딩 페이지 구현 (#20)
* feat: 더미 사이드바 UI 구현 * feat: `Input` 컴포넌트 구현 * feat: `Checkbox` 구현 * feat: 회원가입 Form UI 구현 * feat: 로그인 Form 구현 * feat: 로그인 페이지 및 리다이렉트 구현 * docs: 이용 약관 작성 * feat: 회원가입 폼 UI 디자인 구현 * feat: 회원가입 서버 통신 로직 구현 * feat: 폼 제출간 로딩 구현 * feat: 온보딩 페이지 기초 레이아웃 구성 * feat: 온보딩 페이지 UI 구현 * feat: 온보딩 네트워크 통신 로직 구현 * feat: 유효성 검사 로직 일부 구현 * feat: 로그인 페이지 권한 검사 미들웨어 구현 * refactor: 미들웨어 추상화 * feat: 토큰 만료에 따른 refresh 로직 추가 * docs: 개인정보 처리방침 작성 * fix: 이용약관 및 개인정보 처리 방침 수정 * refactor: 메인 페이지 기본 딜레이 시간을 공용 함수에서 제거 * refactor: 권한 관리 미들웨어 리팩토링 * chore: 미사용 빌드 타임 스탬프 제거 * fix: 스토리북 패키지 의존성 수정 * fix: chromatic 워크플로우 수정 * chore: `SignUpForm` 스토리 제거 * feat: 스토리북에 msw 추가 * refactor: 테스트 환경 분리 * test: 유효성 검사 테스트 작성 * test: 퍼널 페이지 테스트 및 스토리 작성 * design: 스토리북 커스터마이징 * fix: 스토리북 데코레이터를 워크샵에서 관리하도록 수정 * fix: 에러 발생하는 스토리 빌드 제외 * fix: 스토리북 환경에서의 `prefetch` 비활성화 * refactor: `Storybook` 에러 해결을 위한 `Link` 래퍼 구현 related on: #22 * fix: 온보딩 뒤로 가기 제거
- Loading branch information
Showing
140 changed files
with
5,456 additions
and
288 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
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,3 +1,4 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"liveServer.settings.port": 5501 | ||
} |
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,3 @@ | ||
NEXT_PUBLIC_DOMAIN=http://localhost:3000 | ||
NEXT_PUBLIC_API_URL=https://dev.vook-api.seungyeop-lee.com | ||
NEXT_PUBLIC_GOOGLE_LOGIN_URL=https://dev.vook-api.seungyeop-lee.com/oauth2/authorization/google |
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 +1,3 @@ | ||
NEXT_PUBLIC_DOMAIN=https://stag.vook.seungyeop-lee.com | ||
NEXT_PUBLIC_API_URL=https://stag.vook-api.seungyeop-lee.com | ||
NEXT_PUBLIC_GOOGLE_LOGIN_URL=https://stag.vook-api.seungyeop-lee.com/oauth2/authorization/google |
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,29 @@ | ||
import '@testing-library/jest-dom' | ||
import { handlers } from '@vook-client/api' | ||
import { setupServer } from 'msw/node' | ||
import { cleanup } from '@testing-library/react' | ||
import { afterEach } from 'vitest' | ||
|
||
const mswServer = setupServer(...handlers) | ||
|
||
vi.mock('next/font/local', () => { | ||
return { | ||
default: () => {}, | ||
} | ||
}) | ||
|
||
vi.mock('next/navigation', () => ({ | ||
useRouter() { | ||
return { | ||
prefetch: () => null, | ||
} | ||
}, | ||
})) | ||
|
||
afterEach(() => { | ||
cleanup() | ||
}) | ||
|
||
beforeAll(() => mswServer.listen()) | ||
|
||
afterAll(() => mswServer.close()) |
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,7 @@ | ||
import { style } from '@vanilla-extract/css' | ||
|
||
import { SIDE_BAR_WIDTH } from '@/styles/layout' | ||
|
||
export const mainArea = style({ | ||
marginLeft: SIDE_BAR_WIDTH, | ||
}) |
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,16 @@ | ||
import React, { PropsWithChildren } from 'react' | ||
|
||
import { Sidebar } from '@/components/Sidebar' | ||
|
||
import { mainArea } from './layout.css' | ||
|
||
const Layout = ({ children }: PropsWithChildren) => { | ||
return ( | ||
<div className={mainArea}> | ||
<Sidebar /> | ||
{children} | ||
</div> | ||
) | ||
} | ||
|
||
export default Layout |
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,48 @@ | ||
'use client' | ||
|
||
import { userInfoService, UserStatus } from '@vook-client/api' | ||
import Cookies from 'js-cookie' | ||
import { useRouter } from 'next/navigation' | ||
import { useEffect } from 'react' | ||
|
||
interface AuthCallbackQueryParams { | ||
searchParams: { | ||
access: string | ||
refresh: string | ||
} | ||
} | ||
|
||
const AuthCallbackPage = ({ | ||
searchParams: { access, refresh }, | ||
}: AuthCallbackQueryParams) => { | ||
const router = useRouter() | ||
|
||
useEffect(() => { | ||
Cookies.set('access', access, { | ||
secure: true, | ||
}) | ||
Cookies.set('refresh', refresh, { | ||
secure: true, | ||
}) | ||
|
||
const checkUserRegistered = async () => { | ||
const userInfo = await userInfoService.getUserInfo({ | ||
access, | ||
refresh, | ||
}) | ||
const isRegistered = userInfo.result.status === UserStatus.Registered | ||
|
||
if (isRegistered) { | ||
router.push('/') | ||
return | ||
} | ||
router.push('/signup') | ||
} | ||
|
||
checkUserRegistered() | ||
}, [access, refresh, router]) | ||
|
||
return null | ||
} | ||
|
||
export default AuthCallbackPage |
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,10 @@ | ||
import { style } from '@vanilla-extract/css' | ||
|
||
export const loginLayout = style({ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
|
||
width: '100dvw', | ||
height: '100dvh', | ||
}) |
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,9 @@ | ||
import React, { PropsWithChildren } from 'react' | ||
|
||
import { loginLayout } from './layout.css' | ||
|
||
const Layout = ({ children }: PropsWithChildren) => { | ||
return <div className={loginLayout}>{children}</div> | ||
} | ||
|
||
export default Layout |
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,5 @@ | ||
import { style } from '@vanilla-extract/css' | ||
|
||
export const loginFormArea = style({ | ||
width: 380, | ||
}) |
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,15 @@ | ||
import React from 'react' | ||
|
||
import { LoginForm } from '@/components/LoginForm' | ||
|
||
import { loginFormArea } from './page.css' | ||
|
||
const LoginPage = () => { | ||
return ( | ||
<div className={loginFormArea}> | ||
<LoginForm /> | ||
</div> | ||
) | ||
} | ||
|
||
export default LoginPage |
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,10 @@ | ||
import { style } from '@vanilla-extract/css' | ||
|
||
export const loginLayout = style({ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
|
||
width: '100dvw', | ||
height: '100dvh', | ||
}) |
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,9 @@ | ||
import { PropsWithChildren } from 'react' | ||
|
||
import { loginLayout } from './layout.css' | ||
|
||
const Layout = ({ children }: PropsWithChildren) => { | ||
return <div className={loginLayout}>{children}</div> | ||
} | ||
|
||
export default Layout |
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,5 @@ | ||
const Loading = () => { | ||
return <div /> | ||
} | ||
|
||
export default Loading |
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,5 @@ | ||
import { style } from '@vanilla-extract/css' | ||
|
||
export const signupForm = style({ | ||
width: 380, | ||
}) |
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,13 @@ | ||
import { SignUpForm } from '@/components/SignUpForm' | ||
|
||
import { signupForm } from './page.css' | ||
|
||
const SignUpPage = () => { | ||
return ( | ||
<div className={signupForm}> | ||
<SignUpForm /> | ||
</div> | ||
) | ||
} | ||
|
||
export default SignUpPage |
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,6 @@ | ||
import { style } from '@vanilla-extract/css' | ||
|
||
export const termsLayout = style({ | ||
width: 780, | ||
margin: '30px auto', | ||
}) |
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,9 @@ | ||
import { PropsWithChildren } from 'react' | ||
|
||
import { termsLayout } from './layout.css' | ||
|
||
const Layout = ({ children }: PropsWithChildren) => { | ||
return <div className={termsLayout}>{children}</div> | ||
} | ||
|
||
export default Layout |
Oops, something went wrong.