-
Notifications
You must be signed in to change notification settings - Fork 4
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
[온보딩페이지] STEP01 이름 입력 컴포넌트 뷰 구현 & 나머지 단계 타이틀만 구현 #50
Changes from all commits
e3381f5
29227fb
109cede
92e98e6
670c2b1
acb81c5
d840aa3
965af37
278d49b
d6484e2
f1d89a0
10e46c6
8da78da
c1ed849
1d0745a
febe7ce
b5427c8
4facf9b
8acb700
57057c7
dfa7d86
058bb01
318c7ed
f5cd04c
26c2340
62cfb7c
da75f0a
ee3fffa
affc9aa
33ce82b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as S from './Title.style'; | ||
|
||
interface SubTitleProps { | ||
subTitle: string; | ||
} | ||
|
||
const SubTitle = ({ subTitle }: SubTitleProps) => { | ||
return <S.SubTitle>{subTitle}</S.SubTitle>; | ||
}; | ||
|
||
export default SubTitle; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import styled from 'styled-components'; | ||
import theme from '../../../style/theme'; | ||
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. 이거 스니펫 익스텐션 써서 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. 현재 계속 자동완성이 안되는 이슈로... 나중에 바꾸겠슴다 ㅎㅎ |
||
|
||
export const Title = styled.p` | ||
color: ${theme.colors.B_01}; | ||
${theme.fonts.heading_01}; | ||
Comment on lines
+5
to
+6
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. theme import 말고 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. 지금 자동완성이 안되는 이슈로... ㅎㅎ 추후 고치겠슴다!! |
||
`; | ||
export const SubTitle = styled.p` | ||
color: ${theme.colors.G_10}; | ||
${theme.fonts.caption_02}; | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as S from './Title.style'; | ||
|
||
interface TitleProps { | ||
title: string; | ||
} | ||
|
||
const Title = ({ title }: TitleProps) => { | ||
return <S.Title>{title}</S.Title>; | ||
}; | ||
|
||
export default Title; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import styled, { css } from 'styled-components'; | ||
import theme from '../../../style/theme'; | ||
|
||
export const Input = styled.input<{ hasContent: boolean; maxLengthReached: boolean }>` | ||
display: flex; | ||
justify-content: center; | ||
align-items: flex-start; | ||
Comment on lines
+5
to
+7
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. mixin flexbox! 요기 활용할 수 있을 것 같아요! |
||
width: 100%; | ||
margin-top: 7.2rem; | ||
border: none; | ||
border-bottom: 0.1rem solid ${theme.colors.G_02}; | ||
outline: none; | ||
gap: 0.8rem; | ||
|
||
${(props) => | ||
props.hasContent && | ||
css` | ||
border-bottom: 0.1rem solid ${theme.colors.P_06}; | ||
`} | ||
|
||
${(props) => | ||
props.maxLengthReached && | ||
css` | ||
border-bottom: 0.1rem solid ${theme.colors.G_02}; | ||
`} | ||
|
||
input::placeholder { | ||
color: ${theme.colors.G_07}; | ||
${theme.fonts.body_06} | ||
} | ||
|
||
&::-webkit-input-placeholder { | ||
color: ${theme.colors.G_07}; | ||
${theme.fonts.body_06} | ||
} | ||
|
||
&:-ms-input-placeholder { | ||
color: ${theme.colors.G_07}; | ||
${theme.fonts.body_06} | ||
} | ||
`; | ||
|
||
export const LetterLength = styled.p` | ||
color: ${theme.colors.G_07}; | ||
${theme.fonts.body_10} | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { useState } from 'react'; | ||
import Title from '../../common/title/Title'; | ||
import * as S from './Step01.style'; | ||
|
||
const NameInput = () => { | ||
const [text, setText] = useState<string>(''); | ||
|
||
const onChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
const inputValue = e.target.value; | ||
const unicodeChars = [...inputValue].filter((char) => /[\ud800-\udfff]/.test(char)).length; | ||
|
||
inputValue.length + unicodeChars <= 10 ? setText(inputValue) : e.preventDefault(); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Title title='선물 받을 분의' /> | ||
<Title title='이름, 혹은 닉네임을 알려주세요' /> | ||
Comment on lines
+17
to
+18
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. 오옹! 중복되는 부분으로 공통 스타일을 뺀거군요! 너무 좋아요! 다만 걱정되는 부분은 title이 그저 span의 역할인거같은데 title이 적용돼서 가독성과 일관성이 떨어져 보이지 않을까? 하는 고민이 있습니다! 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. 엇 무엇을 이용하면 된다는 말씀이실까용?? 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. 음 이 부분이 고민이 많이 되네요. 이걸 공통으로 뺐을때 과연 이게 최선일지는 ㅠㅠ 하지만 기능 구현에 우선순위를 두고 추후 리펙토리이 하는 방법도 있을 거 같아요 |
||
<S.Input | ||
type='text' | ||
onChange={onChange} | ||
maxLength={10} | ||
placeholder='이름을 입력해주세요' | ||
hasContent={text.length > 0} | ||
maxLengthReached={text.length === 10} | ||
/> | ||
<S.LetterLength>({text.length}/10)</S.LetterLength> | ||
</> | ||
); | ||
}; | ||
|
||
export default NameInput; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Title from '../../common/title/Title'; | ||
|
||
const ThumbnailInput = () => { | ||
return <Title title='썸네일을 등록해주세요' />; | ||
}; | ||
|
||
export default ThumbnailInput; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Title from '../../common/title/Title'; | ||
|
||
const GiftDelivery = () => { | ||
return ( | ||
<> | ||
<Title title='님께' /> | ||
<Title title='언제 선물을' /> | ||
<Title title='전달하실 예정인가요?' /> | ||
</> | ||
); | ||
}; | ||
|
||
export default GiftDelivery; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import SubTitle from '../../common/title/SubTitle'; | ||
import Title from '../../common/title/Title'; | ||
|
||
const SetTournamentSchedule = () => { | ||
return ( | ||
<> | ||
<Title title='선물 토너먼트' /> | ||
<Title title='시작 일정을 설정해주세요' /> | ||
<SubTitle subTitle='토너먼트 시작 전까지 선물을 등록할 수 있어요.' /> | ||
</> | ||
); | ||
}; | ||
|
||
export default SetTournamentSchedule; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import SubTitle from '../../common/title/SubTitle'; | ||
import Title from '../../common/title/Title'; | ||
|
||
const SetTournamentDuration = () => { | ||
return ( | ||
<> | ||
<Title title='선물 토너먼트' /> | ||
<Title title='진행 시간을 설정해주세요' /> | ||
<SubTitle subTitle='토너먼트가 아래 시간 동안 진행돼요.' /> | ||
</> | ||
); | ||
}; | ||
|
||
export default SetTournamentDuration; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const ONBOARDING_FORM_STEP = [ | ||
'NAME', | ||
'THUMBNAIL', | ||
'PRESENT', | ||
'TOURNAMENT_SCHEDULE_REGISTRATION', | ||
'TOURNAMENT_PROCEEDING', | ||
] as const; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//온보딩 모든 컴포넌트를 funnel로 관리하는 최상위 페이지 | ||
|
||
import styled from 'styled-components'; | ||
import NameInput from '../components/onboarding/step01/Step01'; | ||
|
||
const OnBoardingPage = () => { | ||
return ( | ||
<OnBoardingPageWrapper> | ||
<NameInput /> | ||
</OnBoardingPageWrapper> | ||
); | ||
}; | ||
|
||
export default OnBoardingPage; | ||
|
||
const OnBoardingPageWrapper = styled.div` | ||
margin: 2rem; | ||
`; |
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.
공통 컴포넌트 너무 좋아요! 고마워요!૮⑅ᐡ•ﻌ•ᐡა