Skip to content

Commit 4abb2b4

Browse files
authored
Merge pull request #205 from YAPP-Github/fix/#203
fix: 기능결함 QA 우선 반영
2 parents 16ee241 + 375e3ef commit 4abb2b4

File tree

24 files changed

+262
-87
lines changed

24 files changed

+262
-87
lines changed

Projects/Domain/Goal/Interface/Sources/DTO/GoalUpdateRequestDTO.swift

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,23 @@ import Foundation
99

1010
/// 목표 수정 요청 DTO입니다.
1111
public struct GoalUpdateRequestDTO: Encodable {
12-
public let name: String
12+
public let goalName: String
1313
public let icon: String
1414
public let repeatCycle: String
1515
public let repeatCount: Int
1616
public let endDate: String?
1717

1818
public init(
19-
name: String,
19+
goalName: String,
2020
icon: String,
2121
repeatCycle: String,
2222
repeatCount: Int,
2323
endDate: String?
2424
) {
25-
self.name = name
25+
self.goalName = goalName
2626
self.icon = icon
2727
self.repeatCycle = repeatCycle
2828
self.repeatCount = repeatCount
2929
self.endDate = endDate
3030
}
31-
32-
enum CodingKeys: String, CodingKey {
33-
case name, icon, repeatCycle, repeatCount, endDate
34-
}
35-
36-
public func encode(to encoder: Encoder) throws {
37-
var container = encoder.container(keyedBy: CodingKeys.self)
38-
try container.encode(name, forKey: .name)
39-
try container.encode(icon, forKey: .icon)
40-
try container.encode(repeatCycle, forKey: .repeatCycle)
41-
try container.encode(repeatCount, forKey: .repeatCount)
42-
try container.encodeIfPresent(endDate, forKey: .endDate)
43-
}
4431
}

Projects/Feature/Home/Interface/Sources/Home/HomeReducer.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ public struct HomeReducer {
6262
let now = CalendarNow()
6363
let today = TXCalendarDate(year: now.year, month: now.month, day: now.day)
6464
if calendarDate < today {
65-
return "지난 우리의 목표"
65+
return "지난 우리 목표"
6666
}
6767
if today < calendarDate {
68-
return "다음 우리의 목표"
68+
return "다음 우리 목표"
6969
}
70-
return "오늘 우리의 목표"
70+
return "오늘 우리 목표"
7171
}
7272

7373
public var proofPhoto: ProofPhotoReducer.State?
@@ -106,6 +106,7 @@ public struct HomeReducer {
106106
case modalConfirmTapped
107107
case yourCardTapped(GoalCardItem)
108108
case myCardTapped(GoalCardItem)
109+
case headerTapped(GoalCardItem)
109110
case floatingButtonTapped
110111
case editButtonTapped
111112

@@ -130,6 +131,7 @@ public struct HomeReducer {
130131
/// 홈 화면에서 외부로 전달하는 이벤트입니다.
131132
public enum Delegate {
132133
case goToGoalDetail(id: Int64, owner: GoalDetail.Owner, verificationDate: String)
134+
case goToStatsDetail(id: Int64)
133135
case goToMakeGoal(GoalCategory)
134136
case goToEditGoalList(date: TXCalendarDate)
135137
case goToSettings

Projects/Feature/Home/Interface/Sources/Root/HomeCoordinator.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import FeatureNotificationInterface
1212
import FeatureMakeGoalInterface
1313
import FeatureProofPhotoInterface
1414
import FeatureSettingsInterface
15+
import FeatureStatsInterface
1516

1617
/// Home Feature의 NavigationStack을 관리하는 Root Reducer입니다.
1718
///
@@ -28,6 +29,7 @@ public struct HomeCoordinator {
2829
private let reducer: Reduce<State, Action>
2930
private let homeReducer: HomeReducer
3031
private let goalDetailReducer: GoalDetailReducer
32+
private let statsDetailReducer: StatsDetailReducer
3133
private let makeGoalReducer: MakeGoalReducer
3234
private let editGoalListReducer: EditGoalListReducer
3335
private let settingsReducer: SettingsReducer
@@ -45,6 +47,7 @@ public struct HomeCoordinator {
4547

4648
public var home = HomeReducer.State()
4749
public var goalDetail: GoalDetailReducer.State?
50+
public var statsDetail: StatsDetailReducer.State?
4851
public var makeGoal: MakeGoalReducer.State?
4952
public var editGoalList: EditGoalListReducer.State?
5053
public var settings: SettingsReducer.State?
@@ -71,6 +74,7 @@ public struct HomeCoordinator {
7174
// MARK: - Child Action
7275
case home(HomeReducer.Action)
7376
case goalDetail(GoalDetailReducer.Action)
77+
case statsDetail(StatsDetailReducer.Action)
7478
case makeGoal(MakeGoalReducer.Action)
7579
case editGoalList(EditGoalListReducer.Action)
7680
case settings(SettingsReducer.Action)
@@ -104,6 +108,7 @@ public struct HomeCoordinator {
104108
reducer: Reduce<State, Action>,
105109
homeReducer: HomeReducer,
106110
goalDetailReducer: GoalDetailReducer,
111+
statsDetailReducer: StatsDetailReducer,
107112
makeGoalReducer: MakeGoalReducer,
108113
editGoalListReducer: EditGoalListReducer,
109114
settingsReducer: SettingsReducer,
@@ -112,6 +117,7 @@ public struct HomeCoordinator {
112117
self.reducer = reducer
113118
self.homeReducer = homeReducer
114119
self.goalDetailReducer = goalDetailReducer
120+
self.statsDetailReducer = statsDetailReducer
115121
self.makeGoalReducer = makeGoalReducer
116122
self.editGoalListReducer = editGoalListReducer
117123
self.settingsReducer = settingsReducer
@@ -129,6 +135,9 @@ public struct HomeCoordinator {
129135
.ifLet(\.goalDetail, action: \.goalDetail) {
130136
goalDetailReducer
131137
}
138+
.ifLet(\.statsDetail, action: \.statsDetail) {
139+
statsDetailReducer
140+
}
132141
.ifLet(\.makeGoal, action: \.makeGoal) {
133142
makeGoalReducer
134143
}

Projects/Feature/Home/Interface/Sources/Route/HomeRoute.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Foundation
1111
public enum HomeRoute: Equatable, Hashable {
1212
case editGoalList
1313
case detail
14+
case statsDetail
1415
case makeGoal
1516
case settings
1617
case settingsAccount

Projects/Feature/Home/Project.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ let project = Project.makeModule(
1515
.feature(interface: .notification),
1616
.feature(interface: .makeGoal),
1717
.feature(interface: .settings),
18+
.feature(interface: .stats),
1819
.shared(implements: .designSystem),
1920
.external(dependency: .ComposableArchitecture)
2021
]
@@ -33,6 +34,7 @@ let project = Project.makeModule(
3334
.feature(interface: .notification),
3435
.feature(interface: .makeGoal),
3536
.feature(interface: .settings),
37+
.feature(interface: .stats),
3638
.feature(interface: .home),
3739
.shared(implements: .designSystem),
3840
.shared(implements: .util),

Projects/Feature/Home/Sources/Goal/AddGoalListView.swift

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,15 @@ struct AddGoalListView: View {
2222
}
2323

2424
var body: some View {
25-
ScrollView {
26-
VStack(alignment: .leading, spacing: 0) {
27-
headerView
28-
.padding(.horizontal, 20)
29-
.padding(.top, 28)
30-
categoryListView
31-
.padding(.top, 33.5)
32-
.padding(.horizontal, 20)
33-
}
25+
VStack(alignment: .leading, spacing: 0) {
26+
headerView
27+
.padding(.horizontal, 20)
28+
categoryListView
29+
.padding(.top, 20)
30+
.padding(.horizontal, 20)
31+
.padding(.bottom, 80)
3432
}
33+
.padding(.top, 28)
3534
}
3635
}
3736

@@ -46,12 +45,12 @@ private extension AddGoalListView {
4645
Text("새로운 목표 추가")
4746
.typography(.h4_20b)
4847
.foregroundStyle(Color.Gray.gray500)
49-
.padding(.top, 13.5)
50-
48+
5149
Text("함께하는 목표를 추가해 보세요!")
5250
.typography(.b2_14r)
5351
.foregroundStyle(Color.Gray.gray400)
5452
}
53+
.frame(height: 80, alignment: .center)
5554
}
5655

5756
var categoryListView: some View {

Projects/Feature/Home/Sources/Home/HomeReducer+Impl.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,10 @@ extension HomeReducer {
218218
case let .myCardTapped(card):
219219
let verificationDate = TXCalendarUtil.apiDateString(for: state.calendarDate)
220220
return .send(.delegate(.goToGoalDetail(id: card.id, owner: .mySelf, verificationDate: verificationDate)))
221-
221+
222+
case let .headerTapped(card):
223+
return .send(.delegate(.goToStatsDetail(id: card.id)))
224+
222225
case .floatingButtonTapped:
223226
state.isAddGoalPresented = true
224227
return .none

Projects/Feature/Home/Sources/Home/HomeView.swift

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public struct HomeView: View {
4646
if store.hasCards {
4747
content
4848
} else {
49+
headerRow
50+
.padding(.horizontal, 20)
51+
.padding(.top, 16)
4952
goalEmptyView
5053
}
5154
Spacer()
@@ -66,7 +69,6 @@ public struct HomeView: View {
6669
AddGoalListView { category in
6770
store.send(.addGoalButtonTapped(category))
6871
}
69-
.frame(height: UIScreen.main.bounds.height - 92)
7072
}
7173
)
7274
.txBottomSheet(
@@ -165,11 +167,12 @@ private extension HomeView {
165167
Button {
166168
store.send(.editButtonTapped)
167169
} label: {
168-
Image.Icon.Symbol.edit
170+
Text("편집")
171+
.typography(.b1_14b)
172+
.foregroundStyle(Color.Gray.gray500)
169173
}
170174
}
171175
.frame(height: 24)
172-
.padding(.top, 12)
173176
}
174177

175178
var cardList: some View {
@@ -195,41 +198,38 @@ private extension HomeView {
195198
isCoupleChecked: card.yourCard.isSelected,
196199
action: {
197200
store.send(.goalCheckButtonTapped(id: card.id, isChecked: card.myCard.isSelected))
201+
},
202+
onHeaderTapped: {
203+
store.send(.headerTapped(card))
198204
}
199205
),
200206
actionLeft: {
201207
store.send(.myCardTapped(card))
202208
}, actionRight: {
203-
204209
store.send(.yourCardTapped(card))
205210
}
206211
)
207212
}
208213

209214
var goalEmptyView: some View {
210215
GeometryReader { geometry in
211-
ScrollView {
212-
VStack(alignment: .center, spacing: 0) {
213-
Image.Illustration.emptyPoke
214-
215-
Text("첫 목표를 세워볼까요?")
216-
.typography(.t2_16b)
217-
.foregroundStyle(Color.Gray.gray400)
218-
219-
Text("+ 버튼을 눌러 목표를 추가해보세요")
220-
.typography(.c1_12r)
221-
.foregroundStyle(Color.Gray.gray300)
222-
.padding(.top, 5)
223-
}
224-
.frame(width: geometry.size.width, height: geometry.size.height)
225-
.overlay(alignment: .bottomTrailing) {
226-
Image.Illustration.arrow
227-
.padding(.bottom, 63)
228-
.padding(.trailing, 86)
229-
}
216+
VStack(alignment: .center, spacing: 0) {
217+
Image.Illustration.emptyPoke
218+
219+
Text("첫 목표를 세워볼까요?")
220+
.typography(.t2_16b)
221+
.foregroundStyle(Color.Gray.gray400)
222+
223+
Text("+ 버튼을 눌러 목표를 추가해보세요")
224+
.typography(.c1_12r)
225+
.foregroundStyle(Color.Gray.gray300)
226+
.padding(.top, 5)
230227
}
231-
.refreshable {
232-
store.send(.fetchGoals)
228+
.frame(width: geometry.size.width, height: geometry.size.height)
229+
.overlay(alignment: .bottomTrailing) {
230+
Image.Illustration.arrow
231+
.padding(.bottom, 63)
232+
.padding(.trailing, 86)
233233
}
234234
}
235235
}

Projects/Feature/Home/Sources/Root/HomeCoordinator+Impl.swift

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ import FeatureNotificationInterface
1212
import FeatureMakeGoalInterface
1313
import FeatureProofPhotoInterface
1414
import FeatureSettingsInterface
15+
import FeatureStatsInterface
1516

1617
extension HomeCoordinator {
1718
// 기본 구성의 HomeCoordinator를 생성합니다.
1819
// swiftlint:disable:next function_body_length
1920
public init(
2021
goalDetailReducer: GoalDetailReducer,
22+
statsDetailReducer: StatsDetailReducer,
2123
proofPhotoReducer: ProofPhotoReducer,
2224
makeGoalReducer: MakeGoalReducer,
2325
editGoalListReducer: EditGoalListReducer,
@@ -56,7 +58,23 @@ extension HomeCoordinator {
5658
state.routes.append(.notification)
5759
state.notification = .init()
5860
return .none
59-
61+
62+
case let .home(.delegate(.goToStatsDetail(id))):
63+
state.routes.append(.statsDetail)
64+
state.statsDetail = .init(goalId: id)
65+
return .none
66+
67+
case .statsDetail(.delegate(.navigateBack)):
68+
popLastRoute(&state.routes)
69+
return .none
70+
71+
case .statsDetail(.onDisappear):
72+
state.statsDetail = nil
73+
return .none
74+
75+
case .statsDetail:
76+
return .none
77+
6078
case .goalDetail(.delegate(.navigateBack)):
6179
popLastRoute(&state.routes)
6280
return .none
@@ -173,6 +191,7 @@ extension HomeCoordinator {
173191
reducer: reducer,
174192
homeReducer: HomeReducer(proofPhotoReducer: proofPhotoReducer),
175193
goalDetailReducer: goalDetailReducer,
194+
statsDetailReducer: statsDetailReducer,
176195
makeGoalReducer: makeGoalReducer,
177196
editGoalListReducer: editGoalListReducer,
178197
settingsReducer: settingsReducer,

Projects/Feature/Home/Sources/Root/HomeCoordinatorView.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import FeatureHomeInterface
1313
import FeatureNotificationInterface
1414
import FeatureMakeGoalInterface
1515
import FeatureSettingsInterface
16+
import FeatureStatsInterface
1617

1718
/// Home Feature의 NavigationStack을 제공하는 Root View입니다.
1819
///
@@ -28,6 +29,7 @@ import FeatureSettingsInterface
2829
/// ```
2930
public struct HomeCoordinatorView: View {
3031
@Dependency(\.goalDetailFactory) var goalDetailFactory
32+
@Dependency(\.statsDetailFactory) var statsDetailFactory
3133
@Dependency(\.notificationFactory) var notificationFactory
3234
@Dependency(\.makeGoalFactory) var makeGoalFactory
3335
@Dependency(\.settingsFactory) var settingsFactory
@@ -54,6 +56,12 @@ public struct HomeCoordinatorView: View {
5456
.toolbar(.hidden, for: .tabBar)
5557
}
5658

59+
case .statsDetail:
60+
IfLetStore(store.scope(state: \.statsDetail, action: \.statsDetail)) { store in
61+
statsDetailFactory.makeView(store)
62+
.toolbar(.hidden, for: .tabBar)
63+
}
64+
5765
case .editGoalList:
5866
IfLetStore(store.scope(state: \.editGoalList, action: \.editGoalList)) { store in
5967
EditGoalListView(store: store)

0 commit comments

Comments
 (0)