-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Feat/#32] Input 공통 컴포넌트 제작 #47
Conversation
maxLength 초과 입력 불가
PR 작성하느라 고생 많았어요!! 라벨 잘 지정되었는지 확인 한 번 해 주기 🫶 |
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.
채현이 고생해써 ~~ !!!
스토리북도 했네 ㅎㅎㅎ
근데 우리가 컴포넌트를 만드는 거니까 state를 컴포넌트 내부에 선언하는 게 아니라 밖에서 선언하고 값을 가질 수 있게 구조를 바꿔야할 것 같아!
관련해서 작성했으니까 확인하고 수정해봐!
https://jiwoothejay.notion.site/Input-21c0e54982644c3e9286178eee1f2527?pvs=25
export const TextFieldInput = styled.input` | ||
box-sizing: border-box; | ||
width: 100%; | ||
height: 4.8rem; | ||
padding: 0 1.6rem; | ||
|
||
color: ${({ theme }) => theme.colors.gray_0}; | ||
|
||
background: ${({ theme }) => theme.colors.gray_800}; | ||
border: none; | ||
border-radius: 0.6rem; | ||
|
||
${({ theme }) => theme.fonts["body2-normal-medi"]}; | ||
|
||
&::placeholder { | ||
color: ${({ theme }) => theme.colors.gray_600}; | ||
} | ||
|
||
&:focus { | ||
border: 1px solid ${({ theme }) => theme.colors.gray_0}; | ||
} | ||
`; |
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.
https://github.com/TEAM-BEAT/BEAT-Client/assets/58854041/b781699d-4782-4ea7-9eb5-fee13d3e303c
p2) 지금 위 영상처럼 focus 됐을 경우에 border 때문에 input이 조금 밀리고 있어요!
이 부분은 border 색상에 transparent 주면 될 것 같습니다! 그리고 전체 태그들이 이미 border-box라서 이 부분은 필요없어 보여요!
TextArea도 똑같은 문제가 발생해서 따로 리뷰는 안 달게요! 수정 부탁드립니다 ㅎㅎ
export const TextFieldInput = styled.input` | |
box-sizing: border-box; | |
width: 100%; | |
height: 4.8rem; | |
padding: 0 1.6rem; | |
color: ${({ theme }) => theme.colors.gray_0}; | |
background: ${({ theme }) => theme.colors.gray_800}; | |
border: none; | |
border-radius: 0.6rem; | |
${({ theme }) => theme.fonts["body2-normal-medi"]}; | |
&::placeholder { | |
color: ${({ theme }) => theme.colors.gray_600}; | |
} | |
&:focus { | |
border: 1px solid ${({ theme }) => theme.colors.gray_0}; | |
} | |
`; | |
export const TextFieldInput = styled.input` | |
width: 100%; | |
height: 4.8rem; | |
padding: 0 1.6rem; | |
color: ${({ theme }) => theme.colors.gray_0}; | |
background: ${({ theme }) => theme.colors.gray_800}; | |
border: 1px solid transparent; | |
border-radius: 0.6rem; | |
${({ theme }) => theme.fonts["body2-normal-medi"]}; | |
&::placeholder { | |
color: ${({ theme }) => theme.colors.gray_600}; | |
} | |
&:focus { | |
border: 1px solid ${({ theme }) => theme.colors.gray_0}; | |
} | |
`; |
<S.TextAreaWrapper> | ||
<S.TextAreaInput | ||
value={inputValue} | ||
onChange={handleOnInput} | ||
maxLength={maxLength} | ||
placeholder={placeholder} | ||
></S.TextAreaInput> |
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.
p4) 여기 안에 들어가는 content가 없어서 self closing 태그로 바꾸면 좋을 것 같아요! Input도 마찬가지로!
<S.TextAreaWrapper> | |
<S.TextAreaInput | |
value={inputValue} | |
onChange={handleOnInput} | |
maxLength={maxLength} | |
placeholder={placeholder} | |
></S.TextAreaInput> | |
<S.TextAreaWrapper> | |
<S.TextAreaInput | |
value={inputValue} | |
onChange={handleOnInput} | |
maxLength={maxLength} | |
placeholder={placeholder} | |
/> |
maxLength?: number; | ||
placeholder: string; | ||
narrow?: false | true; | ||
unit?: "time" | "ticket" | "amount"; // 단위 : "분", "매", "원" |
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.
p5) 주석 최고 ㅎㅎ
export const TextFieldLayout = styled.section<{ narrow?: false | true }>` | ||
position: relative; | ||
width: ${({ narrow }) => (narrow ? "13.6rem" : "32.7rem")}; | ||
`; | ||
export const TextFieldWrapper = styled.article` | ||
${Generators.flexGenerator("row", "center", "center")} | ||
`; | ||
export const TextFieldInput = styled.input` |
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.
p4) 여기 가독성 좋게 한 칸씩 띄어서 써주면 좋을 것 같아요!
export const TextFieldLayout = styled.section<{ narrow?: false | true }>` | |
position: relative; | |
width: ${({ narrow }) => (narrow ? "13.6rem" : "32.7rem")}; | |
`; | |
export const TextFieldWrapper = styled.article` | |
${Generators.flexGenerator("row", "center", "center")} | |
`; | |
export const TextFieldInput = styled.input` | |
export const TextFieldLayout = styled.section<{ narrow?: false | true }>` | |
position: relative; | |
width: ${({ narrow }) => (narrow ? "13.6rem" : "32.7rem")}; | |
`; | |
export const TextFieldWrapper = styled.article` | |
${Generators.flexGenerator("row", "center", "center")} | |
`; | |
export const TextFieldInput = styled.input` |
src/utils/useInputFiter.ts
Outdated
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.
p4) 유틸함수까지!!! 파일명 useInputFilter로 바꿔줘!
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.
p5) ⭐️⭐️
…to feat/#32/CommonInput ; Conflicts: ; src/pages/test/TestPage.tsx
Quality Gate passedIssues Measures |
📌 관련 이슈번호
🎟️ PR 유형
어떤 변경 사항이 있나요?
✅ Key Changes
📢 To Reviewers
📸 스크린샷
스토리 설명하자면
리뷰에 올라오는 스토리북 사이트 들어가서 테스트하고 이슈 알려주세요!!
이건 테스트 페이지 화면 개발환경입니다.
🔗 참고 자료
✨스토리북 전역 theme 설정 트슈 작성했어요