Skip to content

Conversation

@yongb2n
Copy link
Contributor

@yongb2n yongb2n commented Nov 18, 2024

📌 PR 템플릿

🏷️ PR 타입 (PR Type)

아래 해당 사항에 체크해 주세요.

  • 🐛 버그 수정 (Bugfix)
  • ✨ 기능 개발 (Feature)
  • 🎨 코드 스타일 변경 (Code style update) - 포매팅, 로컬 변수 등
  • ♻️ 리팩토링 (Refactoring) - 기능 변화 없음, API 변경 없음
  • 🛠️ 빌드 관련 변경 (Build related changes)
  • 📝 문서 내용 변경 (Documentation)
  • 🔄 기타 (Other) - 설명 작성

📝 요약 (Summary)

PR의 목적과 간단한 설명을 적어주세요.

  • 컴포넌트 설계 (TextArea)

🔍 상세 내용 (Describe your changes)

변경 사항을 구체적으로 작성해 주세요.

  • TextArea 컴포넌트 구현
  • 디자인 시안 변경으로 TextAreaAutoResized -> TextArea로 변경
  • 스토리북 코드 작성
  • 빌드, UI 테스트 완료
  • invalid 스타일링 처리
  • TextInput forwardRef로 리팩토링 -> 기존 register prop 제거

🔗 관련 이슈 또는 링크 (Issue Number or Link)

이슈 번호나 관련 링크가 있다면 추가해 주세요.


✅ 체크리스트 (Checklist)

PR 작성 시 아래 사항들을 점검해 주세요.

  • 빌드가 성공적으로 되었나요?
  • 코드에 주석을 추가했나요?
  • 모든 테스트가 통과했나요?
  • 관련 문서가 업데이트되었나요?

📸 스크린샷 (선택 사항)

변경 사항이 UI와 관련이 있다면 스크린샷을 추가해 주세요.

2024-11-19.10.56.52.mov

invalid prop (추가된 prop이라 이미지로 첨부)

스크린샷 2024-11-21 오전 12 31 38

📝 기타 사항

PR과 관련된 기타 사항이 있다면 적어주세요.

  • 현재 PR (textarea 관련)에서 다른 이슈 컴포넌트의 작업도 진행하여, 이슈 번호로 구분지어 커밋했습니다.
  • TextArea의 컴포넌트의 사이즈가 3개로 분리가 되어 sm, md, lg로 진행했는데...! 어떠신지 의견 부탁드려용

@yongb2n yongb2n self-assigned this Nov 18, 2024
@yongb2n yongb2n linked an issue Nov 18, 2024 that may be closed by this pull request
4 tasks
@yongb2n yongb2n marked this pull request as draft November 18, 2024 10:46
@yongb2n yongb2n changed the title [#57] ✨ 공통 컴포넌트 TextAreaAutoResized 구현 [#57] ✨ 공통 컴포넌트 TextArea 구현 Nov 19, 2024
@yongb2n yongb2n marked this pull request as ready for review November 19, 2024 13:28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

가독성이 좋고 재사용성이 뛰어나게 보이네요. 아토믹한 디자인을 잘 이해하고 계신 것 같아요 !
다만 text input 에서 처럼 훅폼과 같이 쓸 수 있게, register props를 내려주는 것이 좋아보입니다 !
유효성 검사 (글자 100자 제한) 등을 어겼을 때, 에러 스타일이 나타날 수 있게 처리 해주는 것도 좋아보이구요

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 방금 찾아봐서 처음 알았는데, 또한 forward ref 등록이 훅 폼의 모든 기능을 활용할 수 있게 한다고 하네요

const MyInput = forwardRef<HTMLInputElement, MyInputProps>(
  ({ label, ...rest }, ref) => {
    return (
      <label className='flex flex-col'>
        <span>{label}</span>
        <input ref={ref} {...rest} />
      </label>
    );
  }
);

https://velog.io/@xowns3213/react-hook-form-with-forwardRef

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋은 리뷰 감사합니다 ㅎㅎㅎ

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

훅 폼 사용을 위한 register prop 좋네요..!!

Copy link
Contributor

@yellowjang yellowjang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제가 공통 컨포넌트를 건들이지 않다보니 css 사용이 낯선데, 코드 보면서 많이 배웠습니다.
고생하셨습니다!

Comment on lines 21 to 31
const textAreaClass = twMerge(
baseStyles,
clsx(
{
'w-full': fullWidth,
'h-104': size === 'md',
'h-140': size === 'lg',
},
className
)
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

css에 관한 것도 이렇게 복잡하군요 .... 대단합니다

@yongb2n yongb2n merged commit 683acb3 into dev Nov 22, 2024
1 check passed
@yongb2n yongb2n deleted the feat/common-component-textarea branch November 22, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] [공통 컴포넌트] textarea

4 participants