[lcenavigationview-adoption] Fix black nav bar background, add Cart title wrap
setNavigationBarBackgroundColor was never called on the 15 screens
adopted in 3456184, so it stayed at the default .clear and the real
window background (black) showed through. Set it to
AppColors.backgroundLight on all of them, matching each screen's own
actual content background. Also wraps CartView's title in
LCENavigationView for consistency with the rest of the app - no
setLeftButton since Cart is a tab root, no back button needed.
The other reported bug (empty right-button slot rendering a visible
glass circle) is fixed in LCEssentials itself (separate repo,
commit 8b0f650 on fix/navigation/liquid-glass-button-chrome) but
won't take visual effect here until that's published and this
repo's Package.resolved is bumped to point at it.
This commit is contained in:
@@ -77,6 +77,7 @@ private struct LegalDocumentScreen: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text(headerTitle).font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text(headerTitle).font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ struct AddAddressFormView: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text(existingAddress == nil ? "Novo endereço" : "Editar endereço").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text(existingAddress == nil ? "Novo endereço" : "Editar endereço").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ struct AddCardFormView: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Novo Cartão").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Novo Cartão").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ struct AddressesView: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Meus Endereços").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Meus Endereços").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
#if canImport(LCEssentials)
|
||||||
|
import LCEssentials
|
||||||
|
#endif
|
||||||
|
|
||||||
struct CartView: View {
|
struct CartView: View {
|
||||||
@Binding var appState: AppState
|
@Binding var appState: AppState
|
||||||
@@ -13,14 +16,16 @@ struct CartView: View {
|
|||||||
@State var isLoadingDeliveryFee = false
|
@State var isLoadingDeliveryFee = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
LCENavigationView {
|
||||||
|
content
|
||||||
|
}
|
||||||
|
.setTitle(text: Text("Meu Carrinho").font(AppTypography.heading1).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
|
}
|
||||||
|
|
||||||
|
private var content: some View {
|
||||||
ScrollView(showsIndicators: false) {
|
ScrollView(showsIndicators: false) {
|
||||||
VStack(spacing: 16) {
|
VStack(spacing: 16) {
|
||||||
Text("Meu Carrinho")
|
|
||||||
.font(AppTypography.heading1)
|
|
||||||
.foregroundStyle(AppColors.textPrimary)
|
|
||||||
.frame(maxWidth: .infinity, alignment: .center)
|
|
||||||
.padding(.top, 20)
|
|
||||||
|
|
||||||
if appState.cart.items.isEmpty {
|
if appState.cart.items.isEmpty {
|
||||||
VStack(spacing: 10) {
|
VStack(spacing: 10) {
|
||||||
Text("Seu carrinho está vazio")
|
Text("Seu carrinho está vazio")
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ struct CheckoutView: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Finalizar Pedido").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Finalizar Pedido").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
.appBottomSafeAreaInset {
|
.appBottomSafeAreaInset {
|
||||||
bottomBar
|
bottomBar
|
||||||
}
|
}
|
||||||
@@ -722,6 +723,7 @@ struct PaymentPixView: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Pagamento via PIX").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Pagamento via PIX").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
.sheet(isPresented: $showChangePaymentSheet) {
|
.sheet(isPresented: $showChangePaymentSheet) {
|
||||||
ChangePaymentSheet(
|
ChangePaymentSheet(
|
||||||
pixContext: currentContext,
|
pixContext: currentContext,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ struct OrderDetailsView: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Detalhes do Pedido").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Detalhes do Pedido").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ struct OrderTrackingView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.setTitle(text: Text("Pedido \(displayOrderTitle)").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Pedido \(displayOrderTitle)").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
.navigationDestination(item: $reviewDraft) { draft in
|
.navigationDestination(item: $reviewDraft) { draft in
|
||||||
MyReviewsView(initialOrder: draft)
|
MyReviewsView(initialOrder: draft)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ struct OrdersView: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Meus Pedidos").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Meus Pedidos").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ struct PizzaFlavorAddonsSheet: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Adicionais").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Adicionais").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
@@ -224,6 +224,7 @@ struct PizzaProductDetailSheet: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Monte sua pizza").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Monte sua pizza").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ struct ProductDetailSheet: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Detalhes").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Detalhes").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ struct PublicLocationPickerView: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { back() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { back() }
|
||||||
.setTitle(text: Text(step == .state ? "Escolha seu estado" : "Escolha sua cidade").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text(step == .state ? "Escolha seu estado" : "Escolha sua cidade").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ struct MyReviewsView: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Minhas Avaliações").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Minhas Avaliações").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
.navigationDestination(item: $selectedDraft) { draft in
|
.navigationDestination(item: $selectedDraft) { draft in
|
||||||
OrderReviewView(draft: draft) {
|
OrderReviewView(draft: draft) {
|
||||||
Task { await loadReviewsFromBackend(forceRefresh: true) }
|
Task { await loadReviewsFromBackend(forceRefresh: true) }
|
||||||
@@ -447,6 +448,7 @@ struct OrderReviewView: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Avaliar Pedido").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Avaliar Pedido").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ struct SavedCardsView: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Meus Cartões").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Meus Cartões").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ struct UserProfileView: View {
|
|||||||
}
|
}
|
||||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||||
.setTitle(text: Text("Meu Perfil").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
.setTitle(text: Text("Meu Perfil").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||||
|
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var content: some View {
|
private var content: some View {
|
||||||
|
|||||||
Reference in New Issue
Block a user