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 @@ -14,6 +14,5 @@ struct CalendarView: View {
Color.red700
Text("CalendarView")
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,25 @@ struct SelectTreatmentView: View {
calendarCoordinator.popToRoot()
}
)
VStack {

VStack(spacing: 0) {
Spacer()
.frame(height: 94.adjustedH)

TitleView()

Spacer()
.frame(height: 40.adjustedH)

SelectChipsView(viewModel: viewModel)

Spacer()

CherrishButton(title: "다음", type: .next, state: $viewModel.buttonState, action: { })

Spacer()
.frame(height: 72.adjustedH)

}
.ignoresSafeArea()
.padding(.leading, 34.adjustedW)
Expand All @@ -44,12 +52,16 @@ struct SelectTreatmentView: View {
}

private struct TitleView: View {

var body: some View {
HStack {
VStack(alignment: .leading){
TypographyText("시술 일정을 추가해볼게요.", style: .title1_sb_18, color: .gray1000)

TypographyText("이미 생각해둔 시술이 있나요?", style: .title1_sb_18, color: .gray1000)

TypographyText("시술을 선택하셨는지 확인할게요.", style: .body1_r_14, color: .gray700)

}
Spacer()
}
Expand All @@ -60,9 +72,7 @@ private struct SelectChipsView: View {
@ObservedObject var viewModel: SelectTreatmentViewModel

var body: some View {
HStack(
spacing: 12
) {
HStack(spacing: 12) {
ForEach(TreatmentSelectionState.allCases, id: \.self) { state in
SelectionChip(
title: state.title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ struct SelectedTreatmentView: View {
VStack(spacing: 0) {
HStack(spacing: 0) {
TypographyText("선택한 시술", style: .body1_sb_14, color: .gray600)

Spacer()

}
.padding(.horizontal, 26.adjustedW)
.padding(.vertical, 9.adjustedH)

Rectangle()
.frame(height: 1)
.foregroundStyle(.gray400)

}
.background(.gray0)
.cornerRadius(10, corners: [.topLeft, .topRight])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,22 @@ struct TargetDdaySettingView: View {
VStack {
Spacer()
.frame(height: 50.adjustedH)

HStack(spacing:0){
VStack(alignment: .leading, spacing: 0) {
TypographyText("회복을 계획할 때 고려해야 할", style: .title1_sb_18, color: .gray1000)

TypographyText("중요한 일정이 있나요?", style: .title1_sb_18, color: .gray1000)

}

Spacer()
}
.frame(height: 54.adjustedH)

Spacer()
.frame(height: 40)

HStack(spacing: 12.adjustedW) {
ForEach(DdayState.allCases, id: \.self) { state in
SelectionChip(
Expand All @@ -61,8 +67,10 @@ struct TargetDdaySettingView: View {
)
}
}

Spacer()
.frame(height: 56.adjustedH)

if let state = dDayState {
HStack(spacing: 0) {
switch state {
Expand All @@ -71,13 +79,17 @@ struct TargetDdaySettingView: View {
case .no:
TypographyText("대략적인 회복 목표일을 정해볼까요?", style: .title1_sb_18, color: .gray1000)
}

Spacer()

}

Spacer()
.frame(height: 24.adjustedH)

DateTextBox(year: $year, month: $month, day: $day)
}

}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
//
// DownTimeSettingView.swift
// Cherrish-iOS
//
// Created by 어재선 on 1/16/26.
//

import SwiftUI

struct DownTimeSettingView: View {
var treatments: [TreatmentEntity]
Comment on lines +1 to +11
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

파일 위치가 적절하지 않습니다.

DownTimeSettingView.swift 파일이 Model 폴더에 위치해 있지만, 이 파일은 SwiftUI View입니다. 프로젝트 구조의 일관성을 위해 View 폴더로 이동하는 것이 좋습니다.

🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/DownTimeSettingView.swift`
around lines 1 - 11, DownTimeSettingView is a SwiftUI view declared as struct
DownTimeSettingView and currently lives in the Model folder; move the
DownTimeSettingView.swift file into the project's View (or
Presentation/Feature/Calendar/Treatment/View) folder to match project
conventions, update any module or target membership if needed, and verify
imports/usage of TreatmentEntity remain valid (adjust import statements or
access levels if the move causes visibility issues) and update any file
references in project settings so builds and references to DownTimeSettingView
compile correctly.


var body: some View {
VStack {
Spacer()
.frame(height: 30)

HStack {
TypographyText(
"필요에 맞게 다운타임을 조정할 수 있어요.",
style: .title1_sb_18,
color: .gray1000
)

Spacer()

}
ScrollView(.vertical, showsIndicators: false) {
ForEach(treatments, id: \.self) { treatment in
TreatmentRowView(displayMode: .completeBoxView, treatmentEntity: treatment, isSelected: .constant(false), isCompleted: .constant(false), action: {})
Comment on lines +29 to +30
Copy link
Contributor

Choose a reason for hiding this comment

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

개행좀 해주세요

Comment on lines +29 to +30
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

ForEach에서 id: \.id 사용을 권장합니다.

id: \.self는 전체 객체를 해시하므로, TreatmentEntityid 속성을 가지고 있다면 id: \.id를 사용하는 것이 더 명확하고 성능상 유리합니다.

♻️ 제안하는 수정
-                ForEach(treatments, id: \.self) { treatment in
+                ForEach(treatments, id: \.id) { treatment in
                     TreatmentRowView(displayMode: .completeBoxView, treatmentEntity: treatment, isSelected: .constant(false), isCompleted: .constant(false), action: {})
                 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ForEach(treatments, id: \.self) { treatment in
TreatmentRowView(displayMode: .completeBoxView, treatmentEntity: treatment, isSelected: .constant(false), isCompleted: .constant(false), action: {})
ForEach(treatments, id: \.id) { treatment in
TreatmentRowView(displayMode: .completeBoxView, treatmentEntity: treatment, isSelected: .constant(false), isCompleted: .constant(false), action: {})
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/DownTimeSettingView.swift`
around lines 25 - 26, The ForEach is using id: \.self which hashes entire
TreatmentEntity objects; change it to use the entity's unique identifier by
switching to id: \.id so SwiftUI can diff efficiently. Locate the ForEach over
treatments (the call rendering TreatmentRowView with displayMode:
.completeBoxView and treatmentEntity: treatment) and update its id parameter to
.id (ensure TreatmentEntity exposes an id property or provide the correct
identifier property) so identity is stable and performance improves.

}

Spacer()
.frame(height: 14.adjustedH)

HStack(alignment: .top, spacing: 0) {
TypographyText(
"◎",
style: .body3_r_12,
color: .gray600
)

VStack(alignment: .leading, spacing: 0) {
TypographyText(
"본 정보는 의료 상담이나 진단을 대체하지 않으며,",
style: .body3_r_12,
color: .gray600
)

TypographyText(
"실제 다운타임 및 회복 과정은 개인에 따라 다를 수 있습니다.",
style: .body3_r_12,
color: .gray600
)

TypographyText(
"정확한 내용은 의료진 상담을 통해 확인하세요.",
style: .body3_r_12,
color: .gray600
)

}
Comment on lines 43 to 62
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

면책 조항 텍스트를 하나의 문자열로 통합하는 것을 고려해보세요.

세 개의 TypographyText를 사용하는 대신 하나의 멀티라인 문자열로 통합하면 코드가 더 간결해질 수 있습니다. 단, 현재 방식이 특정 줄바꿈 위치를 보장해야 하는 디자인 요구사항이라면 현재 구현도 괜찮습니다.

🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/DownTimeSettingView.swift`
around lines 36 - 52, Replace the three separate TypographyText views inside the
VStack with a single TypographyText that uses a multiline string (with explicit
\n line breaks) so the same text, style (.body3_r_12) and color (.gray600) are
preserved; ensure the \n placements match the current visual line breaks/design
and keep the VStack alignment/spacing unchanged (refer to the VStack and
TypographyText usages in DownTimeSettingView.swift to locate the code to
update).


Spacer()
}
}

}
.padding(.horizontal, 25.adjustedW)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,21 @@ enum NoTreatment: Int, CaseIterable, Identifiable {
extension NoTreatment {
mutating func next() {
let allCases = Self.allCases

guard let currentIndex = allCases.firstIndex(of: self),
currentIndex + 1 < allCases.count else { return }

self = allCases[allCases.index(after: currentIndex)]

}

mutating func previous() {
let allCases = Self.allCases

guard let currentIndex = allCases.firstIndex(of: self),
currentIndex > 0 else { return }

self = allCases[allCases.index(before: currentIndex)]

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ enum TreatmentCategory: CaseIterable, Identifiable {
return "모공"
case .trouble:
return "트러블"

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@
import SwiftUI

struct NoTreatmentFilterView: View {

@ObservedObject var viewModel: NoTreatmentViewModel

var body: some View {
VStack(spacing: 0) {
TitleHeaderView(title: viewModel.treatmentCatagory?.title ?? "")

Spacer()
.frame(height: 10.adjustedH)

ScrollView(.vertical, showsIndicators: false){
Spacer()
.frame(height: 10.adjustedH)

ForEach(viewModel.treatments, id: \.id) { treatment in
TreatmentRowView(
displayMode: .checkBoxView,
Expand All @@ -27,6 +30,7 @@ struct NoTreatmentFilterView: View {
)
.padding(.leading, 34.adjustedW)
.padding(.trailing, 33.adjustedW)

}
}
}
Expand All @@ -35,29 +39,40 @@ struct NoTreatmentFilterView: View {

private struct TitleHeaderView: View {
let title: String

var body: some View {
VStack {
VStack(alignment: .leading) {
HStack(spacing: 6) {
TypographyText(title, style: .title1_sb_18, color: .gray1000)

TypographyText("관련 시술 리스트", style: .title1_sb_18, color: .gray1000)

Spacer()

}
HStack(spacing: 4) {
VStack {
TypographyText("◎", style: .body3_r_12, color: .gray600)

Spacer()

}
VStack(alignment: .leading) {
TypographyText("본 정보는 인터넷 빅테이터 검색 및 분석을 통해 수집된 정보이며, ", style: .body3_r_12, color: .gray600)

TypographyText("관련 시술 리스트", style: .body3_r_12, color: .gray600)

Spacer()

}
}
}
.padding(.leading, 25.adjustedW)
.padding(.vertical, 20.adjustedH)

Spacer()

}
.background(Color.gray100)
.overlay(alignment: .top) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ struct NoTreatmentView: View {

}
)

Spacer()
.frame(height: 20.adjustedH)

ProgressBar(
totalSteps: NoTreatment.allCases.count,
currentStep: .constant(viewModel.step)
Expand All @@ -43,30 +45,33 @@ struct NoTreatmentView: View {
.padding( .leading, 34.adjustedW)
.padding( .trailing, 33.adjustedW)
.id(viewModel.state)

case .targetDdaySetting:
TargetDdaySettingView(dDayState: $viewModel.dDay, year: $viewModel.year, month: $viewModel.month, day: $viewModel.day)
.padding( .leading, 34.adjustedW)
.padding( .trailing, 33.adjustedW)
.id(viewModel.state)

case .treatmentFilter:
NoTreatmentFilterView(viewModel: viewModel)

case .downTimeSetting:
//TODO: 다운타임 설정
EmptyView()
DownTimeSettingView(treatments: viewModel.selectedTreatments)

}
}
Spacer()

CherrishButton(title: "다음", type: .next, state: .constant(viewModel.canProceed ? .active : .normal)) {
viewModel.next()

}
.padding(.leading, 25.adjustedW)
.padding(.trailing, 24.adjustedW)

Spacer()
.frame(height: 38.adjustedH)

}
.id(viewModel.step)
}
Expand All @@ -87,27 +92,33 @@ private struct TreatmentSelectedCategory: View {
VStack(spacing: 0) {
Spacer()
.frame(height: 50.adjustedH)

HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 0) {
TypographyText(
"요즘 가장 신경 쓰이는 ",
style: .title1_sb_18,
color: .gray1000
)

TypographyText(
"피부 고민은 무엇인가요?",
style: .title1_sb_18,
color: .gray1000
)

TypographyText(
"선택한 고민을 기준으로 시술 정보를 정리해줘요.",
style: .body1_m_14,
color: .gray700
)

}
.frame(height: 78.adjustedH)

Spacer()
}

Spacer()
.frame(height: 40.adjustedH)
LazyVGrid(columns: columns, spacing: 12) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import Foundation

final class NoTreatmentViewModel: ObservableObject{

@Published var state: NoTreatment = .treatmentSelectedCategory
@Published var treatmentCatagory: TreatmentCategory?
@Published var dDay: DdayState?
Expand Down