Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
be99a45
Feat: NicknameView 파일 생성
neaimt Feb 13, 2025
f9a8845
Feat: NicknameVIew 프리뷰 생성
neaimt Feb 13, 2025
65642b9
Feat: OnboardingButton 컴포넌트 파일 생성
neaimt Feb 13, 2025
88545e2
Feat: primary200 버튼 컴포넌트 구현
neaimt Feb 13, 2025
c2eaa1d
Feat: 버튼 version 추가
neaimt Feb 13, 2025
ece776e
Feat: 온보딩캐릭터-217 에셋 추가
neaimt Feb 13, 2025
5e0b69c
Feat: 문구 및 임시 아이콘 추가
neaimt Feb 13, 2025
536acf5
Merge branch 'feat/#19-create-nickname-view-UI' of https://github.com…
neaimt Feb 13, 2025
7d1aebc
Feat: struct, init, body를 public으로 변경
neaimt Feb 14, 2025
0164b03
Feat: 완료 버튼 추가
neaimt Feb 14, 2025
9d8c405
Feat: 닉네임작성칸 추가 및 패딩 조절
neaimt Feb 14, 2025
b453085
Feat: 디자인 시스템에 nutralBlack 추가
neaimt Feb 17, 2025
4cff651
Feat: 텍스트 필드 추가
neaimt Feb 17, 2025
ae0760a
Feat: 키보드 위치에 따른 패딩 값 자동 변경
neaimt Feb 17, 2025
5fa6b05
Feat: 완료 버튼 패딩값 추가
neaimt Feb 17, 2025
b7b2a63
Feat: 닉네임 6글자 초과시 문구 추가
neaimt Feb 17, 2025
ea7dc24
Feat: 온보딩캐릭터 svg 추가 및 이미지 삽입
neaimt Feb 22, 2025
0e069cd
Feat: 닉네임 특수문자 포함 확인 함수
neaimt Feb 22, 2025
18f16f6
fix: 닉네임 검사 로직 수정 (contains → 정규식 적용)
neaimt Feb 22, 2025
7fa5b96
refactor: 경고 메시지를 상수로 분리하여 코드 정리
neaimt Feb 22, 2025
f4424e4
refactor: 닉네임 검증 로직을 함수로 분리하여 코드 개선
neaimt Feb 22, 2025
0fcd77e
refactor: 닉네임 검증 로직 및 패딩 상태 관리를 private extension으로 분리
neaimt Feb 22, 2025
39c22c8
fix: 예상치 않은 컴포넌트 위치 변경 문제 해결
neaimt Feb 22, 2025
304de8d
Feat: 완료 버튼에 버튼 기능 추가
neaimt Feb 22, 2025
af5e2d1
fix: 경고메세지에 따른 텍스트 필드창 상태 변경
neaimt Feb 22, 2025
3bd3ffa
Chore: 닉네임과 관련된 파일 Nickname 폴더로 이동
neaimt Feb 24, 2025
519e3f9
Refactor: 닉네임 입력 상태 관리를 클래스로 분리 및 로직 개선
neaimt Feb 25, 2025
b36e861
Refactor: 키보드 상태에 따른 패딩 값을 struct로 리팩토링
neaimt Feb 25, 2025
196e9c6
Refactor: activate 파라미터를 Bool 타입으로 변경
neaimt Feb 26, 2025
f1ebba9
Refactor: 완료 버튼 상태 관리를 struct로 분리
neaimt Feb 26, 2025
6837fca
Feat: 닉네임 검증을 위한 NicknameValidator 추가
neaimt Feb 27, 2025
2a81f25
Refactor: NicknameValidator reset상태 추가
neaimt Mar 2, 2025
6b5e4ac
Refactor: 닉네임 검증과 UI 업데이트 분리
neaimt Mar 2, 2025
fab3d79
Refactor: 객체별 역할 정리
neaimt Mar 2, 2025
28d1544
Refactor: 객체 메소드 더 간결하게 수정
neaimt Mar 2, 2025
98422d0
Fix: NicknameValidator 파일명 오타 수정
neaimt Mar 2, 2025
8940415
Fix: containsSpecialCharacter 함수의 예외 처리 개선
neaimt Mar 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
}
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"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Projects/Presentation/DesignSystem/Sources/Colors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ public extension Color {
static let nutral500 = DesignSystemAsset.Colors.nutral500.swiftUIColor
static let nutral600 = DesignSystemAsset.Colors.nutral600.swiftUIColor
static let nutralWhite = DesignSystemAsset.Colors.nutralWhite.swiftUIColor
static let nutralBlack = DesignSystemAsset.Colors.nutralBlack.swiftUIColor
}
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)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//
// 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가-힣]+$"
do {
let regex = try NSRegularExpression(pattern: pattern)
return regex.firstMatch(in: nickname, range: NSRange(location: 0, length: nickname.utf16.count)) == nil
} catch {
print("정규식 생성 중 오류 발생: \(error)")
return true
}
}
}

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
}
}
}
Loading