Skip to content

Commit 0b43489

Browse files
committed
ios: Fix toolbar
1 parent d3abf2a commit 0b43489

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

Fruitties/iosApp/iosApp/ui/CartView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct CartView : View {
4747
CartDetailsView(cartViewModel: cartViewModel)
4848
Spacer()
4949
}
50+
.navigationTitle("Your Cart")
5051
}
5152
}
5253
}

Fruitties/iosApp/iosApp/ui/ContentView.swift

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ struct ContentView: View {
3535
)
3636
NavigationStack {
3737
VStack {
38-
Text("Fruitties").font(.largeTitle).fontWeight(.bold)
39-
NavigationLink {
40-
ViewModelStoreOwnerProvider {
41-
CartView()
42-
}
43-
} label: {
44-
Observing(mainViewModel.homeUiState) { homeUIState in
45-
let total = homeUIState.cartItemCount
46-
Text("View Cart (\(total))")
47-
}
48-
}
4938
Observing(mainViewModel.homeUiState) { homeUIState in
5039
ScrollView {
5140
LazyVStack {
@@ -66,6 +55,21 @@ struct ContentView: View {
6655
}
6756
}
6857
}
58+
.navigationTitle("Fruitties")
59+
.toolbar {
60+
ToolbarItem(placement: .navigationBarTrailing) {
61+
NavigationLink {
62+
ViewModelStoreOwnerProvider {
63+
CartView()
64+
}
65+
} label: {
66+
Observing(mainViewModel.homeUiState) { homeUIState in
67+
let total = homeUIState.cartItemCount
68+
Text("View Cart (\(total))")
69+
}
70+
}
71+
}
72+
}
6973
}
7074
}
7175
}

0 commit comments

Comments
 (0)