Skip to content

Commit 017de5b

Browse files
committed
feat/#175 :: 방 생성을 안하면 시작하지 못하도록 처리
1 parent 12406ec commit 017de5b

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

PhotoGether/PresentationLayer/WaitingRoomFeature/WaitingRoomFeature/Source/View/WaitingRoomView.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ final class WaitingRoomView: UIView {
3030
guard let title = StartButtonTitle(from: count) else { return }
3131
startButton.setTitle(to: title.rawValue)
3232
}
33+
34+
func enableStartButton() {
35+
self.startButton.isEnabled = true
36+
self.startButton.backgroundColor = PTGColor.primaryGreen.color
37+
}
3338
}
3439

3540
private extension WaitingRoomView {
@@ -81,6 +86,8 @@ private extension WaitingRoomView {
8186
func configureUI() {
8287
self.backgroundColor = PTGColor.gray90.color
8388
startButton.setTitle(to: "촬영시작")
89+
startButton.isEnabled = false
90+
startButton.backgroundColor = .gray
8491
}
8592
}
8693

PhotoGether/PresentationLayer/WaitingRoomFeature/WaitingRoomFeature/Source/ViewController/WaitingRoomViewController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ public final class WaitingRoomViewController: BaseViewController {
112112
// MARK: 토스트 메시지 노출
113113
case .shouldShowToast(let message):
114114
self.showToast(message: message, duration: 3.0)
115+
116+
case .readyToStart:
117+
self.waitingRoomView.enableStartButton()
115118
}
116119
}.store(in: &cancellables)
117120
}

PhotoGether/PresentationLayer/WaitingRoomFeature/WaitingRoomFeature/Source/ViewModel/WaitingRoomViewModel.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public final class WaitingRoomViewModel {
1818
case shouldShowShareSheet(String)
1919
case navigateToPhotoRoom
2020
case shouldShowToast(String)
21+
case readyToStart
2122
}
2223

2324
private let sendOfferUseCase: SendOfferUseCase
@@ -139,6 +140,7 @@ public final class WaitingRoomViewModel {
139140
}
140141
}, receiveValue: { [weak self] roomLink in
141142
self?.output.send(.shouldShowShareSheet(roomLink))
143+
self?.output.send(.readyToStart)
142144
})
143145
.store(in: &cancellables)
144146
}

0 commit comments

Comments
 (0)