feat(gift): 선물 화면 경로를 등록한다
This commit is contained in:
@@ -139,8 +139,17 @@ class AppState: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
func replaceCurrentAppStep(step: AppStep) {
|
||||
func replaceCurrentAppStep(
|
||||
step: AppStep,
|
||||
ifCurrentStep matches: ((AppStep) -> Bool)? = nil,
|
||||
completion: @escaping (Bool) -> Void = { _ in }
|
||||
) {
|
||||
DispatchQueue.main.async {
|
||||
guard matches?(self.appStep) ?? true else {
|
||||
completion(false)
|
||||
return
|
||||
}
|
||||
|
||||
if let route = self.navigationPath.popLast() {
|
||||
self.routeStepMap.removeValue(forKey: route)
|
||||
}
|
||||
@@ -149,6 +158,7 @@ class AppState: ObservableObject {
|
||||
self.routeStepMap[route] = step
|
||||
self.navigationPath.append(route)
|
||||
self.appStep = step
|
||||
completion(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -196,4 +196,12 @@ enum AppStep {
|
||||
case contentOverview(type: ContentOverviewType = .newAndHotAudio)
|
||||
|
||||
case seriesMain
|
||||
|
||||
case giftSend(recipientMemberId: Int, recipientCreatorNickname: String)
|
||||
|
||||
case giftBoxList
|
||||
|
||||
case giftDetail(applicationNo: String)
|
||||
|
||||
case giftTrackingRegistration(applicationNo: String)
|
||||
}
|
||||
|
||||
@@ -374,6 +374,18 @@ struct AppStepLayerView: View {
|
||||
case .seriesMain:
|
||||
SeriesMainView()
|
||||
|
||||
case .giftSend(let recipientMemberId, let recipientCreatorNickname):
|
||||
GiftSendView(recipientMemberId: recipientMemberId, recipientCreatorNickname: recipientCreatorNickname)
|
||||
|
||||
case .giftBoxList:
|
||||
GiftBoxListView()
|
||||
|
||||
case .giftDetail(let applicationNo):
|
||||
GiftDetailView(applicationNo: applicationNo)
|
||||
|
||||
case .giftTrackingRegistration(let applicationNo):
|
||||
GiftTrackingRegistrationView(applicationNo: applicationNo)
|
||||
|
||||
case .main:
|
||||
EmptyView()
|
||||
.frame(width: 0, height: 0, alignment: .topLeading)
|
||||
|
||||
Reference in New Issue
Block a user