-
Notifications
You must be signed in to change notification settings - Fork 51
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
[김나은] week14 #523
The head ref may contain hidden characters: "part3-\uAE40\uB098\uC740-week14"
[김나은] week14 #523
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
|
||
import HeroImg from "@/src/image/hero.png"; | ||
|
||
const HeaderHome = () => ( | ||
<Header> | ||
<MainHeader> | ||
<MainTitle> | ||
<MainTitleGradient> | ||
<BackgroundClipText>세상의 모든 정보</BackgroundClipText>를<br /> | ||
<Span>쉽게 저장하고 </Span> | ||
<Span>관리해 보세요</Span> | ||
</MainTitleGradient> | ||
</MainTitle> | ||
<AddLinkButton href="signup" className="button add_link"> | ||
링크 추가하기 | ||
</AddLinkButton> | ||
<MainImage src={HeroImg} alt="메인 이미지" className="main_image" /> | ||
</MainHeader> | ||
</Header> | ||
); | ||
|
||
const Header = styled.header` | ||
padding: 7rem 36rem 0 36rem; | ||
background: #f0f6ff; | ||
width: 100%; | ||
`; | ||
|
||
const MainHeader = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-end; | ||
align-items: center; | ||
gap: 4rem; | ||
align-self: stretch; | ||
`; | ||
|
||
const MainTitle = styled.h1` | ||
text-align: center; | ||
font-size: 6.4rem; | ||
font-weight: 700; | ||
line-height: 8rem; | ||
color: #000; | ||
min-width: 708px; | ||
`; | ||
|
||
const MainTitleGradient = styled.span` | ||
background-image: linear-gradient(91deg, #6d6afe 17.28%, #ff9f9f 74.98%); | ||
`; | ||
|
||
const BackgroundClipText = styled.span` | ||
background-clip: text; | ||
-webkit-background-clip: text; | ||
color: transparent; | ||
`; | ||
|
||
const Span = styled.span``; | ||
|
||
// const TitleBreakMiddle = styled.br` | ||
// display: none; | ||
// `; | ||
|
||
const AddLinkButton = styled(Link)` | ||
width: 35rem; | ||
padding: 1.6rem 2rem; | ||
`; | ||
|
||
const MainImage = styled(Image)` | ||
width: 120rem; | ||
height: 59rem; | ||
`; | ||
|
||
export default HeaderHome; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import styled from "styled-components"; | ||
import Logo from "@/src/image/logo.svg"; | ||
|
||
interface HeaderProps { | ||
checkMember: string; | ||
signSrc: string; | ||
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. 이곳도 타입이 string 이면 협업자가 봤을때 어떤 값을 넣어야할지 SignHeader 파일을 뜯어봐야하는데요 |
||
toSignText: string; | ||
} | ||
|
||
const SignHeader = ({ checkMember, signSrc, toSignText }: HeaderProps) => { | ||
return ( | ||
<Header> | ||
<LogoBtn href="/"> | ||
<LogoImg src={Logo} alt="로고 이미지" /> | ||
</LogoBtn> | ||
<Text> | ||
{checkMember} | ||
<ToSign href={signSrc}>{toSignText}</ToSign> | ||
</Text> | ||
</Header> | ||
); | ||
}; | ||
|
||
const Header = styled.header` | ||
display: flex; | ||
flex-direction: column; | ||
row-gap: 1.6rem; | ||
`; | ||
|
||
const LogoBtn = styled(Link)` | ||
display: flex; | ||
align-items: center; | ||
`; | ||
|
||
const LogoImg = styled(Image)` | ||
width: 21.0583rem; | ||
height: 3.8rem; | ||
`; | ||
|
||
const Text = styled.div` | ||
display: flex; | ||
gap: 0.8rem; | ||
|
||
color: var(--linkbrary-black); | ||
|
||
font-size: 1.6rem; | ||
line-height: 2.4rem; | ||
`; | ||
|
||
const ToSign = styled(Link)` | ||
color: var(--primary); | ||
|
||
font-weight: 600; | ||
`; | ||
|
||
export default SignHeader; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import styled from "styled-components"; | ||
import GoogleImg from "@/src/image/google.svg"; | ||
import KakaoImg from "@/src/image/kakaotalk.svg"; | ||
import { ReactNode } from "react"; | ||
|
||
interface SocialProps { | ||
children: ReactNode; | ||
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. Social 부분도 텍스트형태로만 되어있으니
|
||
} | ||
|
||
const Social = ({ children }: SocialProps) => { | ||
return ( | ||
<Wrapper> | ||
<SocialSign>{children}</SocialSign> | ||
<Links> | ||
<SocialLink href="https://www.google.com/"> | ||
<Image src={GoogleImg} alt="구글 로고" /> | ||
</SocialLink> | ||
|
||
<SocialLink href="https://www.kakaocorp.com/page/"> | ||
<Image src={KakaoImg} alt="카카오 로고" /> | ||
</SocialLink> | ||
</Links> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
const Wrapper = styled.div` | ||
width: 40rem; | ||
|
||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 1.2rem 2.4rem; | ||
|
||
border-radius: 0.8rem; | ||
border: 0.1rem solid var(--gray30); | ||
background: var(--gray40); | ||
`; | ||
|
||
const SocialSign = styled.p` | ||
color: var(--gray10); | ||
|
||
font-size: 1.4rem; | ||
font-weight: 400; | ||
`; | ||
|
||
const Links = styled.div` | ||
display: flex; | ||
align-items: flex-start; | ||
gap: 1.6rem; | ||
`; | ||
|
||
const SocialLink = styled(Link)` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 4.2rem; | ||
height: 4.2rem; | ||
`; | ||
|
||
// const LinkImg = styled(Image)``; | ||
export default Social; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { FormEvent, useState } from "react"; | ||
import styled from "styled-components"; | ||
import SignInput from "./SignInput"; | ||
|
||
interface SignFormProps { | ||
signup?: boolean; | ||
children: string; | ||
} | ||
|
||
const SignForm = ({ signup, children }: SignFormProps) => { | ||
const [email, setEmail] = useState(""); | ||
const [password, setPassword] = useState(""); | ||
const [confirmPassword, setConfirmPassword] = useState(""); | ||
|
||
const handleSubmit = async (e: FormEvent) => { | ||
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. 각 로그인, 회원가입 post api 추가하려면 추가로 SignInput 컴포넌트 처럼 Button도 공통화해서 common에 관리를 한다면 다음주 멘토링때 관련해서 설명 드릴게요
|
||
e.preventDefault(); | ||
}; | ||
|
||
return ( | ||
<Form onSubmit={handleSubmit}> | ||
<InputWrapper> | ||
<SignInput label="이메일" type="email" placeholder="이메일을 입력해 주세요." inputValue={email} setValue={setEmail} /> | ||
<SignInput label="비밀번호" type="password" inputValue={password} setValue={setPassword} placeholder={signup ? "영문, 숫자를 조합해 8자 이상 입력해 주세요." : "비밀번호를 입력해 주세요."} /> | ||
{signup && ( | ||
<SignInput | ||
label="비밀번호 확인" | ||
type="confirmPassword" | ||
inputValue={confirmPassword} | ||
setValue={setConfirmPassword} | ||
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. 이렇게 setter를 바로 Props로 넘겨주면 Input을 focus out할때 비밀번호 유효성검사를 하지못하는데요
|
||
password={password} | ||
placeholder="비밀번호와 일치하는 값을 입력해 주세요." | ||
/> | ||
)} | ||
</InputWrapper> | ||
<SubmitButton type="submit">{children}</SubmitButton> | ||
</Form> | ||
); | ||
}; | ||
|
||
const Form = styled.form` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 3rem; | ||
width: 40rem; | ||
`; | ||
|
||
const InputWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 2.4rem; | ||
`; | ||
|
||
const SubmitButton = styled.button` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100%; | ||
height: 5.4rem; | ||
border-radius: 0.8rem; | ||
background-image: var(--graBlueToSkyBlue); | ||
|
||
color: #f5f5f5; | ||
font-size: 1.8rem; | ||
font-weight: 600; | ||
`; | ||
|
||
export default SignForm; |
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.
string 보단 유니온타입으로 타입을 명확하게 좁히는건 어떨까요?
타입스크립트에서는 되도록이면 타입을 좁히는게 좋습니다