-
Notifications
You must be signed in to change notification settings - Fork 16
feat(fe): impl kakao login #3628
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
Open
dayeoni
wants to merge
22
commits into
feat/remove-whitelist
Choose a base branch
from
t2754-impl-kakao-login-v2
base: feat/remove-whitelist
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6e9cbcd
feat(fe): impl login page layout
dayeoni e3d709b
feat(fe): impl login page
dayeoni ba52610
feat(fe): add logo and text
dayeoni f23fc5a
Update apps/frontend/components/auth/LogInPage/LogInPage.tsx
dayeoni 16d7ef8
Update apps/frontend/app/(client)/login/layout.tsx
dayeoni 88c7054
feat(fe): imple id and pw field
dayeoni 8631289
feat(fe): social icon images
dayeoni 658839f
feat(fe): impl login section
dayeoni 399ab23
fix(fe): fix id field autocomplete
dayeoni cc0799e
feat(fe): add login page layout
dayeoni 5c26de4
feat(fe): add signup page layout
dayeoni 5147446
feat(fe): integrate account recovery into login page
dayeoni 77ff803
feat(fe): implement social login button
dayeoni 3ae80d5
feat(fe): add reusable social login info modal
dayeoni 73ba1cb
feat(fe): add social unlinked modal to login page
dayeoni 3f33fd6
fix(fe): fix info modal icon import path
dayeoni 6c8562e
feat(fe): capture and store oauthToken from kakao signup redirect
dayeoni f2e3eef
feat(fe): establish nextauth session after kakao login redirect via r…
dayeoni cca5da7
feat(fe): implement social login handler formatting
dayeoni 7e97b19
fix(fe): center logo vertically within login/signup background image
dayeoni fad9e9c
feat(fe): link social account after login and show social login promo…
dayeoni 73166cc
refactor(fe): apply gemini review suggestions for login page
dayeoni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,45 @@ | ||
| import { SignUpHeader } from '@/components/auth/SignUpPage/SignUpHeader' | ||
| import codedangLogoWhite from '@/public/logos/codedang-with-text-white.svg' | ||
| import Image from 'next/image' | ||
| import { HeaderTitleProvider } from '../(main)/_contexts/HeaderTitleContext' | ||
|
|
||
| export default function LogInLayout({ | ||
| children | ||
| }: { | ||
| children: React.ReactNode | ||
| }) { | ||
| return ( | ||
| <HeaderTitleProvider> | ||
| <div className="flex min-h-dvh w-full flex-col items-center overflow-x-hidden"> | ||
| <SignUpHeader /> | ||
| <main className="relative flex min-h-dvh w-full max-w-[1920px] flex-1 pt-[60px] xl:px-[30px]"> | ||
| <div | ||
| className="absolute inset-0 bg-cover bg-center bg-no-repeat" | ||
| style={{ backgroundImage: "url('/signup/background.png')" }} | ||
| /> | ||
| <div className="relative z-10 flex w-full flex-1"> | ||
| <section className="relative z-0 hidden flex-1 xl:block"> | ||
| <div className="absolute left-[254px] top-[50dvh] z-0 flex w-[260px] -translate-y-1/2 flex-col items-center gap-[15px]"> | ||
| <Image | ||
| src={codedangLogoWhite} | ||
| alt="Codedang" | ||
| width={260} | ||
| height={56} | ||
| className="h-auto w-full" | ||
| priority | ||
| /> | ||
| <p className="text-sub3_sb_16 text-white"> | ||
| 온라인 코딩 교육 & 대회 플랫폼 | ||
| </p> | ||
| </div> | ||
| </section> | ||
|
|
||
| <section className="relative z-20 flex flex-1 items-start justify-center px-4 pb-10 pt-10 lg:justify-end lg:px-0 lg:pr-[117px]"> | ||
| {children} | ||
| </section> | ||
| </div> | ||
| </main> | ||
| </div> | ||
| </HeaderTitleProvider> | ||
| ) | ||
| } |
This file contains hidden or 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,61 +1,12 @@ | ||
| 'use client' | ||
|
|
||
| import { AuthModal } from '@/components/auth/AuthModal' | ||
| import { | ||
| Dialog, | ||
| DialogContent, | ||
| DialogHeader, | ||
| DialogTitle | ||
| } from '@/components/shadcn/dialog' | ||
| import { useSession } from '@/libs/hooks/useSession' | ||
| import { useAuthModalStore } from '@/stores/authModal' | ||
| import type { Route } from 'next' | ||
| import { useRouter, useSearchParams } from 'next/navigation' | ||
| import { useEffect } from 'react' | ||
|
|
||
| export default function LoginPage() { | ||
| const { currentModal, hideModal, showSignIn } = useAuthModalStore( | ||
| (state) => state | ||
| ) | ||
| const session = useSession() | ||
| const router = useRouter() | ||
| const searchParams = useSearchParams() | ||
|
|
||
| useEffect(() => { | ||
| showSignIn() | ||
| }, [showSignIn]) | ||
|
|
||
| useEffect(() => { | ||
| if (session) { | ||
| const redirectUrl = searchParams.get('redirectUrl') | ||
| if (redirectUrl) { | ||
| router.push(redirectUrl as Route) | ||
| } else { | ||
| router.push('/') | ||
| } | ||
| } | ||
| }, [session, router, searchParams]) | ||
| import { LogInPage } from '@/components/auth/LogInPage/LogInPage' | ||
| import { Suspense } from 'react' | ||
|
|
||
| export default function Page() { | ||
| return ( | ||
| <Dialog open={currentModal !== ''} onOpenChange={hideModal}> | ||
| <DialogContent | ||
| onOpenAutoFocus={(e) => { | ||
| e.preventDefault() | ||
| }} | ||
| onInteractOutside={(e) => { | ||
| e.preventDefault() | ||
| }} | ||
| onEscapeKeyDown={(e) => { | ||
| e.preventDefault() | ||
| }} | ||
| hideCloseButton={true} | ||
| className="!h-[620px] !w-[380px] rounded-[10px]" | ||
| > | ||
| <DialogHeader className="hidden"> | ||
| <DialogTitle /> | ||
| </DialogHeader> | ||
| <AuthModal /> | ||
| </DialogContent> | ||
| </Dialog> | ||
| <Suspense> | ||
| <LogInPage /> | ||
| </Suspense> | ||
| ) | ||
| } | ||
This file contains hidden or 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 hidden or 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,120 @@ | ||
| 'use client' | ||
|
|
||
| import { Button } from '@/components/shadcn/button' | ||
| import { Checkbox } from '@/components/shadcn/checkbox' | ||
| import { | ||
| Dialog, | ||
| DialogContent, | ||
| DialogFooter, | ||
| DialogHeader, | ||
| DialogTitle | ||
| } from '@/components/shadcn/dialog' | ||
| import { cn } from '@/libs/utils' | ||
| import Image from 'next/image' | ||
| import { useState } from 'react' | ||
|
|
||
| interface InfoModalButton { | ||
| text: string | ||
| onClick: () => void | ||
| } | ||
|
|
||
| interface InfoModalProps { | ||
| open: boolean | ||
| onOpenChange: (open: boolean) => void | ||
| title: string | ||
| description?: string | ||
| primaryButton: InfoModalButton | ||
| secondaryButton?: InfoModalButton | ||
| className?: string | ||
| dismissForTodayLabel?: string | ||
| onDismissForToday?: () => void | ||
| } | ||
|
|
||
| export function InfoModal({ | ||
| open, | ||
| onOpenChange, | ||
| title, | ||
| description, | ||
| primaryButton, | ||
| secondaryButton, | ||
| className, | ||
| dismissForTodayLabel, | ||
| onDismissForToday | ||
| }: InfoModalProps) { | ||
| const [hideToday, setHideToday] = useState(false) | ||
|
|
||
| const withDismissCheck = (onClick: () => void) => () => { | ||
| if (hideToday) { | ||
| onDismissForToday?.() | ||
| } | ||
| onClick() | ||
| } | ||
| return ( | ||
| <Dialog open={open} onOpenChange={onOpenChange}> | ||
| <DialogContent | ||
| className={cn( | ||
| 'inline-flex w-[456px] flex-col items-start gap-6 !rounded-2xl border-none bg-white px-8 pb-6 pt-8 shadow-lg', | ||
| className | ||
| )} | ||
| onInteractOutside={(event) => event.preventDefault()} | ||
| onEscapeKeyDown={(event) => event.preventDefault()} | ||
| onOpenAutoFocus={(event) => event.preventDefault()} | ||
| > | ||
| <DialogHeader className="flex flex-col items-start gap-2 space-y-0"> | ||
| <Image | ||
| src="/icons/icon-info-blue.svg" | ||
| alt="info" | ||
| width={42} | ||
| height={42} | ||
| /> | ||
|
|
||
| <div className="flex flex-col gap-2"> | ||
| <DialogTitle className="text-head5_sb_24 whitespace-pre-wrap text-left"> | ||
| {title} | ||
| </DialogTitle> | ||
|
|
||
| {description && ( | ||
| <p className="text-body1_m_16 text-left text-[#474747]"> | ||
| {description} | ||
| </p> | ||
| )} | ||
| </div> | ||
| </DialogHeader> | ||
|
|
||
| <DialogFooter className="flex w-full flex-col gap-3 sm:flex-col"> | ||
| <div className="flex w-full flex-row gap-3"> | ||
| {secondaryButton && ( | ||
| <Button | ||
| type="button" | ||
| onClick={withDismissCheck(secondaryButton.onClick)} | ||
| className="border-primary text-sub3_sb_16 text-primary h-[50px] flex-1 rounded-xl border bg-white hover:bg-blue-50" | ||
| > | ||
| {secondaryButton.text} | ||
| </Button> | ||
| )} | ||
|
|
||
| <Button | ||
| type="button" | ||
| onClick={withDismissCheck(primaryButton.onClick)} | ||
| className="bg-primary text-sub3_sb_16 h-[50px] flex-1 rounded-xl" | ||
| > | ||
| {primaryButton.text} | ||
| </Button> | ||
| </div> | ||
|
|
||
| {dismissForTodayLabel && onDismissForToday && ( | ||
| <label className="flex items-center gap-2"> | ||
| <Checkbox | ||
| checked={hideToday} | ||
| onCheckedChange={(checked) => setHideToday(checked === true)} | ||
| /> | ||
| <span className="text-caption2_m_12 text-[#474747]"> | ||
| {dismissForTodayLabel} | ||
| </span> | ||
| </label> | ||
| )} | ||
| </DialogFooter> | ||
| </DialogContent> | ||
| </Dialog> | ||
| ) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.