-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from naya-h2/feat/metaTag
✨ feat: 페이지별 메타태그 설정
- Loading branch information
Showing
19 changed files
with
596 additions
and
440 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
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 |
---|---|---|
|
@@ -8,13 +8,15 @@ import { usePathname, useRouter } from "next/navigation"; | |
import { useState } from "react"; | ||
import { SubmitHandler, useForm } from "react-hook-form"; | ||
import toast from "react-hot-toast"; | ||
import MetaTag from "@/components/MetaTag"; | ||
import Button from "@/components/button"; | ||
import InputText from "@/components/input/InputText"; | ||
import PinkLayout from "@/components/layout/PinkLayout"; | ||
import useEnterNext from "@/hooks/useEnterNext"; | ||
import { deleteCookies, setCookies, setSession } from "@/store/session/cookies"; | ||
import { ERROR_MESSAGES, REG_EXP } from "@/utils/signupValidation"; | ||
import { SHOT_SIGNIN } from "@/constants/confetti"; | ||
import { META_TAG } from "@/constants/metaTag"; | ||
import { OAUTH } from "@/constants/oauth"; | ||
import ArrowLeft from "@/public/icon/arrow-left_lg.svg"; | ||
import Logo from "@/public/icon/logo.svg"; | ||
|
@@ -93,74 +95,77 @@ const SignInPage = () => { | |
}; | ||
|
||
return ( | ||
<PinkLayout size="narrow"> | ||
<header className="flex h-72 w-full justify-between bg-white-white px-20 pb-12 pt-36"> | ||
<button onClick={() => router.back()}> | ||
<ArrowLeft /> | ||
</button> | ||
</header> | ||
<div className="flex-center flex-col px-20 pt-80 pc:pb-20"> | ||
<Link href="/"> | ||
<Logo /> | ||
</Link> | ||
<form ref={formSection} onSubmit={handleSubmit(handleSignin)} className="flex-center mt-40 w-full flex-col pb-16"> | ||
<InputText | ||
name="email" | ||
placeholder="[email protected]" | ||
control={control} | ||
onKeyDown={handleEnterNext} | ||
rules={{ required: ERROR_MESSAGES.email.emailField, pattern: { value: REG_EXP.CHECK_EMAIL, message: ERROR_MESSAGES.email.emailPattern } }} | ||
noButton | ||
/> | ||
<InputText | ||
name="password" | ||
type="password" | ||
placeholder="8자 이상 입력해주세요." | ||
control={control} | ||
rules={{ required: ERROR_MESSAGES.password.passwordField, pattern: { value: REG_EXP.CHECK_PASSWORD, message: ERROR_MESSAGES.password.passwordPattern } }} | ||
onKeyDown={handleEnterNext} | ||
/> | ||
<div className={`mt-16 overflow-hidden transition-all ${submitState.isLoading ? "w-4/5" : "w-full"} ${submitState.isError ? "animate-[brrr_0.2s_0.2s]" : ""}`}> | ||
<Button isSubmit isDisabled={!formState.isValid || !!formState.errors.email || !!formState.errors.password || submitState.isLoading}> | ||
<div className="relative h-full w-full"> | ||
<span className={`absolute w-max transition-all ${formState.isSubmitted ? "top-48" : "absolute-center"}`}>로그인</span> | ||
<span className={`absolute w-max transition-all ${submitState.isLoading ? "absolute-center" : "-top-48"}`}> | ||
<LoadingDot /> | ||
</span> | ||
<span className={`absolute w-max transition-all ${submitState.isLoading ? "top-48" : formState.isSubmitted ? "absolute-center" : "top-48"}`}> | ||
{submitState.isError ? "다시 로그인하기" : "성공!"} | ||
</span> | ||
</div> | ||
</Button> | ||
</div> | ||
</form> | ||
<div className="flex-center mb-56 gap-20 text-14 font-500 text-gray-500"> | ||
<Link href={`/signup?email=${watch("email")}`} scroll={false}> | ||
회원가입 | ||
</Link> | ||
<div className="h-16 border" /> | ||
<Link href="">비밀번호 찾기</Link> | ||
</div> | ||
<div className="flex w-full flex-col gap-20"> | ||
<Link | ||
href={OAUTH.kakao()} | ||
onClick={() => setCookies("pathname", pathname, { path: "/" })} | ||
className="flex-center w-full gap-8 rounded-sm bg-[#FEE500] py-16 text-16 font-500" | ||
> | ||
<KakaoLogo /> | ||
<p>카카오 계정으로 로그인</p> | ||
</Link> | ||
<Link | ||
href={OAUTH.naver()} | ||
onClick={() => setCookies("pathname", pathname, { path: "/" })} | ||
className="flex-center w-full gap-8 rounded-sm bg-[#03CF5D] py-16 text-16 font-500 text-white-white" | ||
> | ||
<NaverLogo fill="white" /> | ||
<p>네이버 계정으로 로그인</p> | ||
<> | ||
<MetaTag title={META_TAG.signin["title"]} description={META_TAG.signin["description"]} /> | ||
<PinkLayout size="narrow"> | ||
<header className="flex h-72 w-full justify-between bg-white-white px-20 pb-12 pt-36"> | ||
<button onClick={() => router.back()}> | ||
<ArrowLeft /> | ||
</button> | ||
</header> | ||
<div className="flex-center flex-col px-20 pt-80 pc:pb-20"> | ||
<Link href="/"> | ||
<Logo /> | ||
</Link> | ||
<form ref={formSection} onSubmit={handleSubmit(handleSignin)} className="flex-center mt-40 w-full flex-col pb-16"> | ||
<InputText | ||
name="email" | ||
placeholder="[email protected]" | ||
control={control} | ||
onKeyDown={handleEnterNext} | ||
rules={{ required: ERROR_MESSAGES.email.emailField, pattern: { value: REG_EXP.CHECK_EMAIL, message: ERROR_MESSAGES.email.emailPattern } }} | ||
noButton | ||
/> | ||
<InputText | ||
name="password" | ||
type="password" | ||
placeholder="8자 이상 입력해주세요." | ||
control={control} | ||
rules={{ required: ERROR_MESSAGES.password.passwordField, pattern: { value: REG_EXP.CHECK_PASSWORD, message: ERROR_MESSAGES.password.passwordPattern } }} | ||
onKeyDown={handleEnterNext} | ||
/> | ||
<div className={`mt-16 overflow-hidden transition-all ${submitState.isLoading ? "w-4/5" : "w-full"} ${submitState.isError ? "animate-[brrr_0.2s_0.2s]" : ""}`}> | ||
<Button isSubmit isDisabled={!formState.isValid || !!formState.errors.email || !!formState.errors.password || submitState.isLoading}> | ||
<div className="relative h-full w-full"> | ||
<span className={`absolute w-max transition-all ${formState.isSubmitted ? "top-48" : "absolute-center"}`}>로그인</span> | ||
<span className={`absolute w-max transition-all ${submitState.isLoading ? "absolute-center" : "-top-48"}`}> | ||
<LoadingDot /> | ||
</span> | ||
<span className={`absolute w-max transition-all ${submitState.isLoading ? "top-48" : formState.isSubmitted ? "absolute-center" : "top-48"}`}> | ||
{submitState.isError ? "다시 로그인하기" : "성공!"} | ||
</span> | ||
</div> | ||
</Button> | ||
</div> | ||
</form> | ||
<div className="flex-center mb-56 gap-20 text-14 font-500 text-gray-500"> | ||
<Link href={`/signup?email=${watch("email")}`} scroll={false}> | ||
회원가입 | ||
</Link> | ||
<div className="h-16 border" /> | ||
<Link href="">비밀번호 찾기</Link> | ||
</div> | ||
<div className="flex w-full flex-col gap-20"> | ||
<Link | ||
href={OAUTH.kakao()} | ||
onClick={() => setCookies("pathname", pathname, { path: "/" })} | ||
className="flex-center w-full gap-8 rounded-sm bg-[#FEE500] py-16 text-16 font-500" | ||
> | ||
<KakaoLogo /> | ||
<p>카카오 계정으로 로그인</p> | ||
</Link> | ||
<Link | ||
href={OAUTH.naver()} | ||
onClick={() => setCookies("pathname", pathname, { path: "/" })} | ||
className="flex-center w-full gap-8 rounded-sm bg-[#03CF5D] py-16 text-16 font-500 text-white-white" | ||
> | ||
<NaverLogo fill="white" /> | ||
<p>네이버 계정으로 로그인</p> | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
</PinkLayout> | ||
</PinkLayout> | ||
</> | ||
); | ||
}; | ||
export default SignInPage; |
Oops, something went wrong.