Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -41,7 +41,7 @@ enum OnboardingAPI: EndPoint {
return JSONEncoding.default
}

var queryParameters: [String: String]? {
var queryParameters: [String: Any]? {
return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ struct InformationView: View {
name.count > 7
}

private var ageNumericValue: Int? {
let numericString = age.replacingOccurrences(of: " 세", with: "")
return Int(numericString)
}

private var isAgeOverLimit: Bool {
guard let ageValue = Int(age) else { return false }
guard let ageValue = ageNumericValue else { return false }
return ageValue > 100
}

Expand Down Expand Up @@ -54,10 +59,10 @@ struct InformationView: View {
.offset(y: 24.adjustedH)
}
}
.padding(.top, 70.adjustedH)
.padding(.top, 70.adjustedH)
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

사소한 포맷팅 이슈: 줄 끝에 불필요한 공백이 있습니다.

.padding(.top, 70.adjustedH) 뒤에 trailing whitespace가 있습니다. 코드 스타일 일관성을 위해 제거하는 것이 좋습니다.

🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Onboarding/InformationView.swift`
at line 62, Remove the trailing whitespace at the end of the line containing the
view modifier call `.padding(.top, 70.adjustedH)` in InformationView.swift;
locate the `.padding(.top, 70.adjustedH)` expression and delete the extraneous
spaces after the closing parenthesis so the line ends immediately after
`adjustedH`.

.padding(.horizontal, 34.adjustedW)

CherrishTextBox(title: "나이",text: $age, placeholder: "20", isNumberField: true)
CherrishTextBox(title: "나이",text: $age, placeholder: "20", isNumberField: true)
.focused($isAgeFocused)
.overlay(alignment: .bottomLeading) {
if showAgeError {
Expand All @@ -78,7 +83,7 @@ struct InformationView: View {
trailingIcon: nil
) {
Task {
guard let ageValue = Int(age) else { return }
guard let ageValue = ageNumericValue else { return }
await viewModel.createProfile(name: name, age: ageValue)
}
}
Expand All @@ -95,6 +100,9 @@ struct InformationView: View {
.onChange(of: age) { _ in updateButtonState() }
.onChange(of: isAgeFocused) { focused in
if !focused {
if let numericValue = ageNumericValue, !age.hasSuffix(" 세") {
age = "\(numericValue) 세"
}
showAgeError = isAgeOverLimit
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ enum CherrishTextFieldStyle {
case .plain, .number:
return 16.adjustedW
case .date:
return 18.5.adjustedW
return 0
}
}

Expand Down Expand Up @@ -158,6 +158,7 @@ struct CherrishTextField: View {
.tint(style.textColor)
}
.frame(height: style.fontHeight)
.padding(.horizontal, style.horizontalPadding)
}
.padding(.vertical, style.verticalPadding)
.background {
Expand Down