Skip to content

Commit 8a90444

Browse files
authored
Merge pull request #161 from YAPP-Github/fix/#159
fix: 알려진 UI 이슈 수정
2 parents 95c9448 + 49acf3c commit 8a90444

File tree

7 files changed

+73
-58
lines changed

7 files changed

+73
-58
lines changed

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,13 @@ struct MakeGoalView: View {
4242
.toolbar(.hidden, for: .navigationBar)
4343
.onAppear { store.send(.onAppear) }
4444
.onDisappear { store.send(.onDisappear) }
45-
.txBottomSheet(
46-
isPresented: $store.isCalendarSheetPresented
47-
) {
48-
TXCalendarBottomSheet(
49-
selectedDate: $store.calendarSheetDate,
50-
completeButtonText: "완료",
51-
onComplete: { store.send(.monthCalendarConfirmTapped) },
52-
isDateEnabled: store.isCalendarDateEnabled
53-
)
54-
}
45+
.calendarSheet(
46+
isPresented: $store.isCalendarSheetPresented,
47+
selectedDate: $store.calendarSheetDate,
48+
completeButtonText: "완료",
49+
onComplete: { store.send(.monthCalendarConfirmTapped) },
50+
isDateEnabled: store.isCalendarDateEnabled
51+
)
5552
.txBottomSheet(
5653
isPresented: $store.isPeriodSheetPresented
5754
) {

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,12 @@ public struct HomeView: View {
7070
.transaction { transaction in
7171
transaction.disablesAnimations = false
7272
}
73-
.txBottomSheet(
74-
isPresented: $store.isCalendarSheetPresented
75-
) {
76-
TXCalendarBottomSheet(
77-
selectedDate: $store.calendarSheetDate,
78-
completeButtonText: "완료",
79-
onComplete: { store.send(.monthCalendarConfirmTapped) }
80-
)
81-
}
73+
.calendarSheet(
74+
isPresented: $store.isCalendarSheetPresented,
75+
selectedDate: $store.calendarSheetDate,
76+
completeButtonText: "완료",
77+
onComplete: { store.send(.monthCalendarConfirmTapped) }
78+
)
8279
.txModal(
8380
item: $store.modal,
8481
onAction: { action in

Projects/Feature/MainTab/Sources/Reducer/MainTabReducer.swift

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public struct MainTabReducer {
4444
public var home = HomeCoordinator.State()
4545
public var selectedTab: TXTabItem = .home
4646
public var isTabBarHidden: Bool = false
47-
47+
// FIXME: 삭제 예정 - 설정 화면 진입점 확정 후 제거
48+
public var settings = SettingsReducer.State(showBackButton: false)
49+
4850
/// 기본 상태를 생성합니다.
4951
///
5052
/// ## 사용 예시
@@ -65,14 +67,12 @@ public struct MainTabReducer {
6567

6668
// MARK: - Child Action
6769
case home(HomeCoordinator.Action)
70+
// FIXME: 삭제 예정 - 설정 화면 진입점 확정 후 제거
71+
case settings(SettingsReducer.Action)
6872

6973
// MARK: - User Action
7074
case selectedTabChanged(TXTabItem)
7175

72-
// MARK: - Temporary Settings Access
73-
// FIXME: 삭제 예정 - 설정 화면 진입점 확정 후 제거
74-
case showSettings
75-
7676
// MARK: - Delegate
7777
case delegate(Delegate)
7878

@@ -93,7 +93,7 @@ public struct MainTabReducer {
9393

9494
public var body: some ReducerOf<Self> {
9595
BindingReducer()
96-
96+
9797
Scope(state: \.home, action: \.home) {
9898
let proofPhotoReducer = ProofPhotoReducer()
9999
HomeCoordinator(
@@ -105,26 +105,26 @@ public struct MainTabReducer {
105105
)
106106
}
107107

108+
// FIXME: 삭제 예정 - 설정 화면 진입점 확정 후 제거
109+
Scope(state: \.settings, action: \.settings) {
110+
SettingsReducer()
111+
}
112+
108113
Reduce { state, action in
109114
switch action {
110115
// MARK: - User Action
111116
case .selectedTabChanged:
112117
switch state.selectedTab {
113118
case .home:
114119
state.isTabBarHidden = !state.home.routes.isEmpty
120+
|| state.home.home.isCalendarSheetPresented
115121

116122
case .statistics, .couple, .settings:
117123
state.isTabBarHidden = false
118124
}
119125
return .none
120126

121-
// FIXME: 삭제 예정 - 설정 화면 진입점 확정 후 제거
122-
case .showSettings:
123-
state.home.settings = SettingsReducer.State()
124-
state.home.isSettingsPresented = true
125-
return .none
126-
127-
// MARK: - Child Action
127+
// MARK: - Child Action (Home)
128128
case .home(.delegate(.logoutCompleted)):
129129
return .send(.delegate(.logoutCompleted))
130130

@@ -134,20 +134,31 @@ public struct MainTabReducer {
134134
case .home(.delegate(.sessionExpired)):
135135
return .send(.delegate(.sessionExpired))
136136

137-
// FIXME: 삭제 예정 - 설정 탭 제거 시 함께 제거
138-
case .home(.settingsDismissed):
139-
// 설정 화면이 닫히면 홈 탭으로 복귀
140-
if state.selectedTab == .settings {
141-
state.selectedTab = .home
142-
}
143-
return .none
144-
145137
case .home:
146138
if state.selectedTab == .home {
147139
state.isTabBarHidden = !state.home.routes.isEmpty
140+
|| state.home.home.isCalendarSheetPresented
148141
}
149142
return .none
150143

144+
// MARK: - Child Action (Settings)
145+
// FIXME: 삭제 예정 - 설정 화면 진입점 확정 후 제거
146+
case .settings(.delegate(.logoutCompleted)):
147+
return .send(.delegate(.logoutCompleted))
148+
149+
case .settings(.delegate(.withdrawCompleted)):
150+
return .send(.delegate(.withdrawCompleted))
151+
152+
case .settings(.delegate(.sessionExpired)):
153+
return .send(.delegate(.sessionExpired))
154+
155+
case .settings(.delegate(.navigateBack)):
156+
// 탭에서는 백버튼 동작 무시
157+
return .none
158+
159+
case .settings:
160+
return .none
161+
151162
case .delegate:
152163
return .none
153164

Projects/Feature/MainTab/Sources/View/MainTabView.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import FeatureHome
1212
import FeatureHomeInterface
1313
import FeatureGoalDetail
1414
import FeatureProofPhoto
15+
import FeatureSettings
1516
import SharedDesignSystem
1617

1718
/// 메인 탭 화면을 표시하는 View입니다.
@@ -59,13 +60,7 @@ public struct MainTabView: View {
5960

6061
// FIXME: 삭제 예정 - 설정 화면 진입점 확정 후 제거
6162
case .settings:
62-
HomeCoordinatorView(store: store.scope(state: \.home, action: \.home))
63-
}
64-
}
65-
.onChange(of: store.selectedTab) { _, newValue in
66-
// FIXME: 삭제 예정 - 설정 탭에서 설정 화면 표시
67-
if newValue == .settings {
68-
store.send(.showSettings)
63+
SettingsView(store: store.scope(state: \.settings, action: \.settings))
6964
}
7065
}
7166
}

Projects/Feature/Settings/Interface/Sources/SettingsReducer.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public struct SettingsReducer {
5757
public var isMarketingPushEnabled: Bool
5858
public var isNightMarketingPushEnabled: Bool
5959

60+
// FIXME: 삭제 예정 - 설정 화면 진입점 확정 후 제거
61+
public var showBackButton: Bool
62+
6063
public static let minLength = 2
6164
public static let maxLength = 8
6265
// FIXME: 로컬라이징 지원 이후 해제
@@ -77,7 +80,8 @@ public struct SettingsReducer {
7780
storeVersion: String = "",
7881
isPokePushEnabled: Bool = true,
7982
isMarketingPushEnabled: Bool = false,
80-
isNightMarketingPushEnabled: Bool = false
83+
isNightMarketingPushEnabled: Bool = false,
84+
showBackButton: Bool = true
8185
) {
8286
self.nickname = nickname
8387
self.originalNickname = nickname
@@ -91,6 +95,7 @@ public struct SettingsReducer {
9195
self.isPokePushEnabled = isPokePushEnabled
9296
self.isMarketingPushEnabled = isMarketingPushEnabled
9397
self.isNightMarketingPushEnabled = isNightMarketingPushEnabled
98+
self.showBackButton = showBackButton
9499
}
95100
}
96101

Projects/Feature/Settings/Sources/Settings/SettingsView.swift

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public struct SettingsView: View {
5252
settingsListSection
5353
.padding(.horizontal, Spacing.spacing8)
5454
}
55-
.padding(.top, Spacing.spacing9)
55+
// FIXME: 설정 화면 탭바에서 다시 돌릴 때 아래 주석 제거
56+
// .padding(.top, Spacing.spacing9)
5657
}
5758
}
5859
.frame(maxWidth: .infinity, maxHeight: .infinity)
@@ -81,14 +82,19 @@ public struct SettingsView: View {
8182

8283
private extension SettingsView {
8384
var navigationBar: some View {
84-
TXNavigationBar(style: .subTitle(title: "설정", rightText: "")) { action in
85-
switch action {
86-
case .backTapped:
87-
store.send(.backButtonTapped)
88-
89-
default:
90-
break
85+
// FIXME: 삭제 예정 - 설정 화면 진입점 확정 후 showBackButton 조건 제거
86+
if store.showBackButton {
87+
TXNavigationBar(style: .subTitle(title: "설정", rightText: "")) { action in
88+
switch action {
89+
case .backTapped:
90+
store.send(.backButtonTapped)
91+
92+
default:
93+
break
94+
}
9195
}
96+
} else {
97+
TXNavigationBar(style: .mainTitle(title: "설정"))
9298
}
9399
}
94100
}

Projects/Shared/DesignSystem/Sources/Components/Bar/TabBar/TXTabBar.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,17 @@ struct TXTabBar: View {
3737
// MARK: - SubViews
3838
private extension TXTabBar {
3939
func tabItemView(item: TXTabItem) -> some View {
40-
Button {
40+
let isSelected = selectedItem == item
41+
42+
return Button {
4143
selectedItem = item
4244
} label: {
4345
VStack(spacing: Constants.iconLabelSpacing) {
44-
item.icon(isSelected: selectedItem == item)
46+
item.icon(isSelected: isSelected)
4547
.resizable()
4648
.frame(width: Constants.iconSize, height: Constants.iconSize)
49+
// FIXME: 삭제 예정 - 설정 탭 선택/비선택 아이콘 추가 후 제거
50+
.opacity(item == .settings && !isSelected ? 0.4 : 1.0)
4751

4852
Text(item.title)
4953
.typography(Constants.labelFont)

0 commit comments

Comments
 (0)