Skip to content

[Feat/#19] 닉네임 설정화면 구현#20

Open
neaimt wants to merge 37 commits intomainfrom
feat/#19-create-nickname-view-UI
Open

[Feat/#19] 닉네임 설정화면 구현#20
neaimt wants to merge 37 commits intomainfrom
feat/#19-create-nickname-view-UI

Conversation

@neaimt
Copy link
Copy Markdown
Contributor

@neaimt neaimt commented Feb 22, 2025

🛠 변경 사항 Changes

  • 닉네임 설정 화면 UI 구현
  • 닉네임 설정 요구사항에 맞는 로직 구현

💬 기타 참고 사항

  • 이미지 렌더링이 제대로 안되는거 같습니다. ( 온보딩캐릭터 테두리 그림자 ) 어떤 부분이 문제인지 찾지 못했습니다!! (도와주세요..🥹)
  • 닉네임 중복 확인은 백 연결 필요한 부분 같습니다.

🔗 관련 이슈 Related issues

closes #19

📸 스크린샷 (선택 사항)

닉네임 입력 상태별 UI

닉네임 입력 필드에서 발생할 수 있는 다양한 상태를 아래에서 확인할 수 있습니다!!

닉네임 입력 전 / 삭제 후 닉네임 정상 입력
닉네임 입력 전 닉네임 정상 입력
닉네임이 입력되지 않은 상태입니다. 정상적인 닉네임이 입력된 상태입니다.

유효하지 않은 문자 입력 6글자 초과 입력
유효하지 않은 문자 입력 6글자 초과 입력
닉네임에 허용되지 않은 문자가 포함되었습니다. 닉네임은 최대 6글자까지 입력할 수 있습니다.

- 파일 생성 및 프리뷰 추가
- version 1인 경우 보라색
- 그 외 회색
- 온보딩캐릭터 SVG, PNG 업로드 시도 했으나 실패함 ( 인식을 못함 )
- 텍스트 필드 추가
- 포커스시 글씨체, 색상 변경
- 렌더링 문제인지 원본 파일에는 캐릭터 테두리가 있는데, 화면에 삽입하면 사라지는 문제가 있음
- 한글, 숫자, 영어만 가능하도록 설정함
 - 기존엔 contain을 썼는데, 한글 인식 + 공백 인식을 못하여서 정규식으로 구현함
- 닉네임 글자 수 제한
- 닉네임 유효문자 확인
- 닉네임 중복여부 확인
- 경고메세지와 완료버튼 활성화 및 텍스트 필드 상태를 변경
- 경고 메세지의 유무에 따른 컴포넌트 위치가 조금씩 바뀌는 문제가 있음
- 경고 메세지 크기 지정해주어 해결함
@neaimt neaimt added the Feat 새로운 기능 또는 요청 label Feb 22, 2025
@neaimt neaimt self-assigned this Feb 22, 2025
@neaimt neaimt linked an issue Feb 22, 2025 that may be closed by this pull request
10 tasks
- NicknameTextField, NicknameTextFieldStyle, NicknameWarningMessage 클래스로 분리
- validateNickname() 내 resetValidation(), updateValidation(error:) 함수 분리
- 코드 가독성을 높이고 중복된 UI 업데이트 로직 제거
- PaddingState를 struct로 변경하여 유지보수성을 향상
- switch 문을 제거하고 static let 방식을 사용하여 코드 단순화
- 마이페이지에서 닉네임 변경하는 경우, 해당 로직 재사용성 가능성이 있어 따로 NicknameValidator 생성하였음
- Domain 폴더 생성시 옮기는 것이 좋아보임 !
- 닉네임이 비었을 때의 경우를 reset으로 설정함
@neaimt neaimt removed a link to an issue Mar 3, 2025
10 tasks
@neaimt neaimt linked an issue Mar 3, 2025 that may be closed by this pull request
10 tasks
Copy link
Copy Markdown
Contributor

@cinnamonfor6214 cinnamonfor6214 left a comment

Choose a reason for hiding this comment

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

코드 리뷰 늦게 드려서 죄송합니다... 🙇‍♀️🙇‍♀️ 우선 보면서 궁금했던 것들에 대한 코멘트 남겨봅니당...!

Comment thread Projects/Presentation/Login/Sources/Nickname/NicknameView.swift
Comment thread Projects/Presentation/Login/Sources/Nickname/NicknameView.swift
Comment thread Projects/Presentation/Login/Sources/Nickname/NicknameValidator.swift Outdated
Copy link
Copy Markdown
Contributor

@agseou agseou left a comment

Choose a reason for hiding this comment

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

구조적으로 넘 깔끔한거 같아요 👍👍
이미지 문제는 추후 디자이너님이랑 싱크 맞추고
뷰모델은 회의에서 정해보아요!
수고하셨어요 !! 짱짱!

.padding(.bottom, PaddingState.defaultState.firstTextPadding)

// 이미지 파일이 원본과 다르게 나옴 - 테두리가 사라지는 문제
Image(asset: DesignSystemAsset.Icons.onboardingCharacter217)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이 부분 직접 DesignSystemAsset.Icons.onboardingCharacter217.SwiftUIImage로 가져와서 할지 의논이 필요하겠군요!


// 닉네임 입력 필드 UI 관리
private struct NicknameTextFieldStyle {
private static let errorColor = Color(red: 1.0, green: 0.376, blue: 0.376, opacity: 1.0)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

공용으로 사용할 수 있는 extension을 추가해서 색상 hexcode만 입력받아 색을 입력할 수 있도록 하는 건 어떨까요?

Button {
// store로 action 전달 필요
} label: {
OnboardingButton(label: "완료", activate: nicknameField.submitButtonState.isEnabled).padding(.bottom, 37)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OnboardingButton(label: "완료", activate: nicknameField.submitButtonState.isEnabled)
  .padding(.bottom, 37)

여기 들여쓰기 깜박!

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.

[FEAT] 닉네임 설정뷰 UI 구현

3 participants