Skip to content

Commit 5c2daba

Browse files
committed
[#69] 코드 리뷰 반영: 캡슐화 개선 및 디자인 시스템 적용
1 parent 63be47a commit 5c2daba

7 files changed

Lines changed: 19 additions & 18 deletions

File tree

Codive/Application/AppRootView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct AppRootView: View {
4747
.transition(.opacity)
4848
}
4949
}
50+
.animation(.easeInOut(duration: 0.4), value: appRouter.currentAppState)
5051

5152
// 로딩 오버레이
5253
if appRouter.isLoading {

Codive/Router/AppRouter.swift

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,17 @@ final class AppRouter: ObservableObject {
6161
func finishSplash() {
6262
// 스플래시 종료 후 인증 화면으로 이동
6363
// TODO: 로그인 상태 확인 로직 추가 (토큰 있으면 .main)
64-
withAnimation(.easeInOut(duration: 0.4)) {
65-
currentAppState = .auth
66-
}
64+
currentAppState = .auth
6765
}
6866

6967
func navigateToTerms() {
7068
isLoading = false
71-
withAnimation(.easeInOut(duration: 0.4)) {
72-
currentAppState = .termsAgreement
73-
}
69+
currentAppState = .termsAgreement
7470
}
7571

7672
func navigateToMain() {
7773
isLoading = false
78-
withAnimation(.easeInOut(duration: 0.4)) {
79-
currentAppState = .main
80-
}
74+
currentAppState = .main
8175
#if DEBUG
8276
if let token = try? KeychainManager.shared.getAccessToken() {
8377
print("----------------------------------------")
@@ -102,8 +96,6 @@ final class AppRouter: ObservableObject {
10296
navigationRouter?.navigateToRoot()
10397

10498
// 2. 로그인 화면으로 상태 변경
105-
withAnimation(.easeInOut(duration: 0.4)) {
106-
currentAppState = .auth
107-
}
99+
currentAppState = .auth
108100
}
109101
}

Codive/Shared/DesignSystem/ClothSheet/CustomProductCard.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct CustomProductCard: View {
7272
.foregroundColor(.white)
7373
.padding(.horizontal, 6)
7474
.padding(.vertical, 3)
75-
.background(Color.blue)
75+
.background(Color.Codive.point1)
7676
.clipShape(Capsule())
7777
.padding(6)
7878
}

Codive/Shared/Services/Photo/Presentation/PhotoEditView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ struct PhotoEditView: View {
114114
ImageCropView(
115115
image: currentPhoto.originalImage,
116116
aspectRatio: viewModel.aspectRatio,
117-
allowZoomOut: viewModel.flowType == .cloth,
117+
allowZoomOut: viewModel.allowZoomOut,
118118
onComplete: { croppedImage in
119119
viewModel.updateCroppedImage(croppedImage)
120120
viewModel.isEditingMode = false

Codive/Shared/Services/Photo/Presentation/RecordAddView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ struct RecordAddView: View {
9191
}
9292

9393
// AI 추가 토글 (옷 추가 플로우 전용)
94-
if viewModel.flowType == .cloth {
94+
if viewModel.isClothFlow {
9595
aiAddToggleBar
9696
}
9797
}

Codive/Shared/Services/Photo/Presentation/ViewModel/PhotoEditViewModel.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,15 @@ final class PhotoEditViewModel: ObservableObject {
2626
@Published var showExitAlert: Bool = false
2727

2828
private let navigationRouter: NavigationRouter
29-
let flowType: PhotoEditFlowType
29+
private let flowType: PhotoEditFlowType
3030
private let isAIEnabled: Bool
3131
private var cancellables = Set<AnyCancellable>()
3232

3333
// MARK: - Computed Properties
34+
var allowZoomOut: Bool {
35+
flowType == .cloth
36+
}
37+
3438
var currentPhoto: SelectedPhoto? {
3539
guard selectedPhotos.indices.contains(currentIndex) else { return nil }
3640
return selectedPhotos[currentIndex]

Codive/Shared/Services/Photo/Presentation/ViewModel/RecordAddViewModel.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ final class RecordAddViewModel: ObservableObject {
3232
private let navigationRouter: NavigationRouter
3333
private var cancellables = Set<AnyCancellable>()
3434
private var hasShownClothInfoInSession = false
35-
let flowType: PhotoEditFlowType
36-
35+
private let flowType: PhotoEditFlowType
36+
3737
// MARK: - Computed Properties
38+
var isClothFlow: Bool {
39+
flowType == .cloth
40+
}
41+
3842
var isCompleteEnabled: Bool {
3943
!selectedPhotos.isEmpty
4044
}

0 commit comments

Comments
 (0)