Skip to content

Commit 58f5d94

Browse files
committed
[BOOK-365] feat: add Notification Settings entry
1 parent b2c27f2 commit 58f5d94

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/Projects/BKPresentation/Sources/MainFlow/Setting/Coordinator/SettingCoordinator.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ final class SettingCoordinator: Coordinator {
2323
}
2424
}
2525

26+
extension SettingCoordinator {
27+
func didTapNotificationSetting() {
28+
let notificationCoordinator = NotificationSettingsCoordinator(
29+
parentCoordinator: self,
30+
navigationController: navigationController
31+
)
32+
addChildCoordinator(notificationCoordinator)
33+
notificationCoordinator.start()
34+
}
35+
}
36+
2637
extension SettingCoordinator: ErrorHandleable, URLPresenting, AuthenticationRequiredNotifying {
2738
func notifyAuthenticationRequired(onFinish: (() -> Void)?) {
2839
(parentCoordinator as? AuthenticationRequiredNotifying)?.notifyAuthenticationRequired(onFinish: onFinish)

src/Projects/BKPresentation/Sources/MainFlow/Setting/View/SettingViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ final class SettingViewController: BaseViewController<SettingView>, ScreenLoggab
6969
self?.coordinator?.presentWeb(url: DocsType.terms.url)
7070
case .license:
7171
self?.coordinator?.presentWeb(url: DocsType.licenses.url)
72+
case .notification:
73+
self?.coordinator?.didTapNotificationSetting()
7274
case .version:
7375
AppStoreLinker.openAppStore()
7476
}

src/Projects/BKPresentation/Sources/MainFlow/Setting/ViewModel/SettingViewModel.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Foundation
77

88
enum FirstMenuItem: String, CaseIterable {
99
case privacy = "개인정보 처리방침"
10+
case notification = "알림"
1011
case term = "이용약관"
1112
case license = "오픈소스 라이선스"
1213
case version = "앱 버전"
@@ -100,8 +101,10 @@ final class SettingViewModel: BaseViewModel {
100101

101102
case .accessModeChanged(let mode):
102103
if mode == .member {
104+
newState.firstMenuItems = FirstMenuItem.allCases
103105
newState.secondMenuItems = [.logout, .withdraw]
104106
} else {
107+
newState.firstMenuItems = FirstMenuItem.allCases.filter { $0 != .notification }
105108
newState.secondMenuItems = [.login]
106109
}
107110

0 commit comments

Comments
 (0)