-
Notifications
You must be signed in to change notification settings - Fork 6
Feat: 로그인 페이지 UI 구현 #24
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import Image from "next/image"; | ||
| import React, { InputHTMLAttributes, useState } from "react"; | ||
|
|
||
| interface AuthInputProps extends InputHTMLAttributes<HTMLInputElement> { | ||
| text: string; | ||
| } | ||
|
|
||
| const AuthInput = ({ text, type, ...props }: AuthInputProps) => { | ||
| const [isPasswordVisible, setIsPasswordVisible] = useState(false); | ||
|
|
||
| const toggleClick = () => { | ||
| setIsPasswordVisible((prev) => !prev); | ||
| }; | ||
|
|
||
| return ( | ||
| <div className="mb-6"> | ||
| <label htmlFor={type} className="text-[14px] block mb-[12px]"> | ||
| {text} | ||
| </label> | ||
| <div className="relative"> | ||
| <input | ||
| {...props} | ||
| type={isPasswordVisible ? "text" : type} | ||
| className="w-full h-[60px] rounded-lg border border-gray300 px-[15px] py-[18px] pr-[40px] outline-purple100" | ||
| /> | ||
| {type === "password" && ( | ||
| <Image | ||
| src={ | ||
| isPasswordVisible | ||
| ? "/icons/eyes_open.svg" | ||
| : "/icons/eyes_close.svg" | ||
| } | ||
| width={16} | ||
| height={16} | ||
| alt={isPasswordVisible ? "비밀번호 숨기기" : "비밀번호 보기"} | ||
| onClick={toggleClick} | ||
| className="absolute top-1/2 right-4 transform -translate-y-1/2 cursor-pointer" | ||
| /> | ||
| )} | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default AuthInput; | ||
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,20 @@ | ||
| import Image from "next/image"; | ||
|
|
||
| const SnsLogin = () => { | ||
| return ( | ||
| <div className="flex items-center justify-between bg-gray300 rounded-lg px-6 py-3 mt-8"> | ||
| <span>소셜 로그인</span> | ||
| <div className="flex gap-4"> | ||
| <Image src="/icons/google.svg" width="42" height="42" alt="구글" /> | ||
| <Image | ||
| src="/icons/kakaotalk.svg" | ||
| width="42" | ||
| height="42" | ||
| alt="카카오톡" | ||
| /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default SnsLogin; |
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,15 @@ | ||
| import Image from "next/image"; | ||
| import { ReactNode } from "react"; | ||
|
|
||
| const AuthLayout = ({ children }: { children: ReactNode }) => { | ||
| return ( | ||
| <div className="mx-auto bg-gray100 flex flex-col items-center justify-center h-screen"> | ||
| <div> | ||
| <Image src="/icons/logo.svg" width="211" height="38" alt="로고" /> | ||
| </div> | ||
| {children} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default AuthLayout; |
|
Collaborator
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. 이렇게 제외시키는 거군요 👍 |
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,42 @@ | ||
| import AuthInput from "@/components/Auth/AuthInput"; | ||
| import SnsLogin from "@/components/Auth/SnsLogin"; | ||
| import Button from "@/components/Button"; | ||
| import AuthLayout from "@/components/Layout/AuthLayout"; | ||
| import Link from "next/link"; | ||
|
|
||
| const Login = () => { | ||
| return ( | ||
| <AuthLayout> | ||
| <p className="mt-[16px] text-base font-normal"> | ||
| 회원이 아니신가요?{" "} | ||
| <Link | ||
| href="/signup" | ||
| className="cursor-pointer text-purple100 underline font-semibold" | ||
| > | ||
| 회원 가입하기 | ||
| </Link> | ||
| </p> | ||
| <form | ||
| className="w-full sm:max-w-[325px] md:max-w-[400px] mt-[30px]" | ||
| aria-labelledby="login-form" | ||
| > | ||
| <AuthInput | ||
| text="이메일" | ||
| type="text" | ||
| placeholder="이메일을 입력해주세요." | ||
| /> | ||
| <AuthInput | ||
| text="비밀번호" | ||
| type="password" | ||
| placeholder="비밀번호를 입력해주세요." | ||
| /> | ||
| <Button width="w-full" height="h-[53px]" className="mt-[30px]"> | ||
| 로그인 | ||
| </Button> | ||
| <SnsLogin /> | ||
| </form> | ||
| </AuthLayout> | ||
| ); | ||
| }; | ||
|
|
||
| export default Login; |
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.
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.
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.
htmlFor에 type을 넣는 이유가 있나요 ?.?
추가로 input와 이어주려면 id에 type을 넣어줘야하는건가요?
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.
회원가입 페이지를 만들때 비밀번호와 비밀번호 인풋이 같은 타입으로 들어갈거같은데 괜찮을까용