refactor(navigation): 전역 경로 기반 단일 내비게이션 흐름으로 전환한다
This commit is contained in:
@@ -9,10 +9,11 @@ import SwiftUI
|
||||
|
||||
struct OrderListAllInnerView: View {
|
||||
@StateObject var viewModel = OrderListAllViewModel()
|
||||
@State private var isInitialized = false
|
||||
|
||||
var body: some View {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(spacing: 0) {
|
||||
VStack(spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
Text("총")
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
@@ -38,19 +39,16 @@ struct OrderListAllInnerView: View {
|
||||
|
||||
ForEach(0..<viewModel.orderList.count, id: \.self) { index in
|
||||
let item = viewModel.orderList[index]
|
||||
NavigationLink {
|
||||
ContentDetailView(contentId: item.contentId)
|
||||
} label: {
|
||||
OrderListItemView(item: item)
|
||||
.contentShape(Rectangle())
|
||||
.padding(.horizontal, 13.3)
|
||||
.padding(.top, 6.7)
|
||||
.onAppear {
|
||||
if index == viewModel.orderList.count - 1 {
|
||||
viewModel.getOrderList()
|
||||
}
|
||||
OrderListItemView(item: item)
|
||||
.contentShape(Rectangle())
|
||||
.padding(.horizontal, 13.3)
|
||||
.padding(.top, 6.7)
|
||||
.onAppear {
|
||||
if index == viewModel.orderList.count - 1 {
|
||||
viewModel.getOrderList()
|
||||
}
|
||||
}
|
||||
}
|
||||
.onTapGesture { AppState.shared.setAppStep(step: .contentDetail(contentId: item.contentId)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,7 +56,10 @@ struct OrderListAllInnerView: View {
|
||||
.padding(.top, 13.3)
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.getOrderList()
|
||||
if !isInitialized {
|
||||
viewModel.getOrderList()
|
||||
isInitialized = true
|
||||
}
|
||||
}
|
||||
.popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) {
|
||||
HStack {
|
||||
|
||||
@@ -10,7 +10,7 @@ import SwiftUI
|
||||
struct OrderListAllView: View {
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
Group {
|
||||
VStack(spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
Button {
|
||||
|
||||
Reference in New Issue
Block a user