-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#19] 닉네임 설정화면 구현 #20
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
Open
neaimt
wants to merge
37
commits into
main
Choose a base branch
from
feat/#19-create-nickname-view-UI
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 36 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
be99a45
Feat: NicknameView 파일 생성
neaimt f9a8845
Feat: NicknameVIew 프리뷰 생성
neaimt 65642b9
Feat: OnboardingButton 컴포넌트 파일 생성
neaimt 88545e2
Feat: primary200 버튼 컴포넌트 구현
neaimt c2eaa1d
Feat: 버튼 version 추가
neaimt ece776e
Feat: 온보딩캐릭터-217 에셋 추가
neaimt 5e0b69c
Feat: 문구 및 임시 아이콘 추가
neaimt 536acf5
Merge branch 'feat/#19-create-nickname-view-UI' of https://github.com…
neaimt 7d1aebc
Feat: struct, init, body를 public으로 변경
neaimt 0164b03
Feat: 완료 버튼 추가
neaimt 9d8c405
Feat: 닉네임작성칸 추가 및 패딩 조절
neaimt b453085
Feat: 디자인 시스템에 nutralBlack 추가
neaimt 4cff651
Feat: 텍스트 필드 추가
neaimt ae0760a
Feat: 키보드 위치에 따른 패딩 값 자동 변경
neaimt 5fa6b05
Feat: 완료 버튼 패딩값 추가
neaimt b7b2a63
Feat: 닉네임 6글자 초과시 문구 추가
neaimt ea7dc24
Feat: 온보딩캐릭터 svg 추가 및 이미지 삽입
neaimt 0e069cd
Feat: 닉네임 특수문자 포함 확인 함수
neaimt 18f16f6
fix: 닉네임 검사 로직 수정 (contains → 정규식 적용)
neaimt 7fa5b96
refactor: 경고 메시지를 상수로 분리하여 코드 정리
neaimt f4424e4
refactor: 닉네임 검증 로직을 함수로 분리하여 코드 개선
neaimt 0fcd77e
refactor: 닉네임 검증 로직 및 패딩 상태 관리를 private extension으로 분리
neaimt 39c22c8
fix: 예상치 않은 컴포넌트 위치 변경 문제 해결
neaimt 304de8d
Feat: 완료 버튼에 버튼 기능 추가
neaimt af5e2d1
fix: 경고메세지에 따른 텍스트 필드창 상태 변경
neaimt 3bd3ffa
Chore: 닉네임과 관련된 파일 Nickname 폴더로 이동
neaimt 519e3f9
Refactor: 닉네임 입력 상태 관리를 클래스로 분리 및 로직 개선
neaimt b36e861
Refactor: 키보드 상태에 따른 패딩 값을 struct로 리팩토링
neaimt 196e9c6
Refactor: activate 파라미터를 Bool 타입으로 변경
neaimt f1ebba9
Refactor: 완료 버튼 상태 관리를 struct로 분리
neaimt 6837fca
Feat: 닉네임 검증을 위한 NicknameValidator 추가
neaimt 2a81f25
Refactor: NicknameValidator reset상태 추가
neaimt 6b5e4ac
Refactor: 닉네임 검증과 UI 업데이트 분리
neaimt fab3d79
Refactor: 객체별 역할 정리
neaimt 28d1544
Refactor: 객체 메소드 더 간결하게 수정
neaimt 98422d0
Fix: NicknameValidator 파일명 오타 수정
neaimt 8940415
Fix: containsSpecialCharacter 함수의 예외 처리 개선
neaimt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...ts/Presentation/DesignSystem/Resources/Colors.xcassets/nutralBlack.colorset/Contents.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "colors" : [ | ||
| { | ||
| "color" : { | ||
| "color-space" : "srgb", | ||
| "components" : { | ||
| "alpha" : "1.000", | ||
| "blue" : "0x00", | ||
| "green" : "0x00", | ||
| "red" : "0x00" | ||
| } | ||
| }, | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
...tion/DesignSystem/Resources/Icons.xcassets/onboardingCharacter-217.imageset/Contents.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "온보딩캐릭터-217.svg", | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| }, | ||
| "properties" : { | ||
| "preserves-vector-representation" : true, | ||
| "template-rendering-intent" : "original" | ||
| } | ||
| } |
59 changes: 59 additions & 0 deletions
59
...System/Resources/Icons.xcassets/onboardingCharacter-217.imageset/온보딩캐릭터-217.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
Projects/Presentation/DesignSystem/Sources/Components/OnboardingButton.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // | ||
| // OnboardingButton.swift | ||
| // DesignSystem | ||
| // | ||
| // Created by 박근경 on 2/14/25. | ||
| // | ||
|
|
||
| import SwiftUI | ||
|
|
||
| // MARK: 완료, 네 버튼 | ||
| public struct OnboardingButton: View { | ||
|
|
||
| public init(label: String, activate: Bool) { | ||
| self.label = label | ||
| self.activate = activate | ||
| if activate == true { | ||
| self.fontColor = .nutralWhite | ||
| self.backColor = .primary200 | ||
| } else { | ||
| self.fontColor = .nutral400 | ||
| self.backColor = .nutral200 | ||
| } | ||
| } | ||
|
|
||
| public var body: some View { | ||
| ZStack { | ||
| RoundedRectangle(cornerRadius: 50) | ||
| .fill(backColor) | ||
| .frame(width: .infinity, height: 48) | ||
| .padding(.horizontal, 32) | ||
|
|
||
| Text(label) | ||
| .jalnan(.regular, size: 18) | ||
| .foregroundStyle(fontColor) | ||
| } | ||
| } | ||
|
|
||
| private let label: String | ||
| private let activate: Bool | ||
| private var fontColor: Color | ||
| private var backColor: Color | ||
| } | ||
|
|
||
| #Preview { | ||
| OnboardingButton(label: "완료", activate: true) | ||
| OnboardingButton(label: "완료", activate: false) | ||
| OnboardingButton(label: "네", activate: true) | ||
| } |
54 changes: 54 additions & 0 deletions
54
Projects/Presentation/Login/Sources/Nickname/NicknameValidator.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| // | ||
| // NicknameValidator.swift | ||
| // Login | ||
| // | ||
| // Created by 박근경 on 2/27/25. | ||
| // | ||
| import SwiftUI | ||
|
|
||
| struct NicknameValidator { | ||
| func validate(nickname: String)-> NicknameValidationResult { | ||
| guard !nickname.isEmpty else { | ||
| return .reset | ||
| } | ||
|
|
||
| if nickname.count > 6 { | ||
| return .invalid(reason: .tooLong) | ||
| } else if containsSpecialCharacter(nickname) { | ||
| return .invalid(reason: .invalidFormat) | ||
| } | ||
|
|
||
| return .valid | ||
| } | ||
|
|
||
| private func containsSpecialCharacter(_ nickname: String) -> Bool { | ||
| let pattern = "^[a-zA-Z0-9가-힣]+$" | ||
| let regex = try! NSRegularExpression(pattern: pattern) | ||
| return regex.firstMatch(in: nickname, range: NSRange(location: 0, length: nickname.utf16.count)) == nil | ||
| } | ||
| } | ||
|
|
||
| enum NicknameError: String { | ||
| case tooLong = "6자 이하로 입력해주세요." | ||
| case invalidFormat = "영문, 숫자, 완성된 한글 조합만 가능해요." | ||
| case duplicate = "중복되는 닉네임입니다." | ||
|
|
||
| var message: String { | ||
| return self.rawValue | ||
| } | ||
| } | ||
|
|
||
| enum NicknameValidationResult: Equatable { | ||
| case valid | ||
| case invalid(reason: NicknameError?) | ||
| case reset | ||
|
|
||
| var errorMessage: String? { | ||
| switch self { | ||
| case .valid, .reset: | ||
| return nil | ||
| case .invalid(let reason): | ||
| return reason?.message | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.