Skip to content
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/NST-10] #38 회원가입 화면 작성 #39

Merged
merged 6 commits into from
Feb 26, 2025
Merged

Conversation

FpRaArNkK
Copy link
Collaborator

@FpRaArNkK FpRaArNkK commented Feb 25, 2025

🔥 Issue

#38


🔥 변경된 내용

  • 온보딩 화면 중 회원 가입 화면을 작성했습니다
  • 기존 컴포넌트 파일 중 텍스트 필드 관련 컴포넌트를 별도로 분리 이동했습니다
  • UserUseCase를 작성했습니다

🔥 PR Point

  1. 디자인 시스템 변경에 맞춰 AppColorTextField가 수정되었습니다.
    기존 텍스트 사용 방법은 변함 없으나, Rx를 통한 state와 deleteButtonTap 사용에서 일부 변화가 있습니다
    사용법은 아래와 같습니다.
// 사용자의 텍스트필트 X 버튼 탭
        rootView.nameTextField.rx.deleteButtonTapped
            .debounce(.milliseconds(100), scheduler: MainScheduler.instance)
            .map { SignUpReactor.Action.tapNameDeleteButton }
            .bind(to: reactor.action)
            .disposed(by: disposeBag)
            
// State의 이름 텍스트필드 상태 UI 반영
        reactor.state.map { $0.nameTextFieldState }
            .distinctUntilChanged()
            .bind(to: rootView.nameTextField.rx.state)
            .disposed(by: disposeBag)

🔥 ScreenShot


🔥 Reference


@FpRaArNkK FpRaArNkK added the Feat 새로운 기능 구현 label Feb 25, 2025
@FpRaArNkK FpRaArNkK self-assigned this Feb 25, 2025
Copy link
Collaborator

@oyslucy oyslucy left a comment

Choose a reason for hiding this comment

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

👍🏻👍🏻👍🏻👍🏻👍🏻

Comment on lines +10 to +18
protocol UserUseCaseProtocol {
func validate(name: String) -> Observable<ValidationResult>
}

final class UserUseCase: UserUseCaseProtocol {
func validate(name: String) -> Observable<ValidationResult> {
return Observable.just(SignUpValidator.validate(name: name))
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

이게 뭔가요?

struct SignUpValidator {
static func validate(name: String) -> ValidationResult {
// 1. 글자 수 제한 (1~10자)
guard (1...10).contains(name.count) else {
Copy link
Contributor

Choose a reason for hiding this comment

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

저는 범위연산자 사용하는데 이렇게도 할 수 있군요?

1...10 ~= name.count

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

오호 이렇게 해도 좋겠네요! 👍👍👍

Comment on lines +47 to +55
if let placeholder {
textField.setPlaceholder(
text: placeholder,
color: .appGray600,
font: .PretendardStyle.b5_r.font
)
}
if let countLimit { setCountLabelBinding(limit: countLimit) }
if activateDeleteButton { setDeleteButton() }
Copy link
Contributor

Choose a reason for hiding this comment

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

이 부분을 함수로 나누지 않은 이유를 들어보고 싶습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

init 부분에서 각 입력값에 따라 UI 세팅이 될 수 있도록 작성했습니다!
각 세팅 내용을 함수로 나누고, init에서 하나씩 작성하여 init 때 해당 내용이 해당 조건에 실행됨을 명확히 하기위해 작성했습니다

@FpRaArNkK FpRaArNkK merged commit fc85203 into main Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feat 새로운 기능 구현
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants