[lcenavigationview-adoption] Adopt LCENavigationView across 15 screens
Standardizes the back button to a single shared component (AppBackButtonIcon, 32x32/14pt) instead of ~16 hand-duplicated 52x52/24pt copies, and wires each screen through LCENavigationView per this project's mandatory-usage rule. Home and Store Detail intentionally excluded - both have bespoke header designs (collapsing header, hero-image overlay) this change would visually disrupt.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
#if canImport(LCEssentials)
|
||||
import LCEssentials
|
||||
#endif
|
||||
|
||||
struct PizzaFlavorAddonsSheet: View {
|
||||
let flavor: StoreCatalogProduct
|
||||
@@ -8,9 +11,16 @@ struct PizzaFlavorAddonsSheet: View {
|
||||
@Environment(\.dismiss) var dismiss
|
||||
|
||||
var body: some View {
|
||||
LCENavigationView {
|
||||
content
|
||||
}
|
||||
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
|
||||
.setTitle(text: Text("Adicionais").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
|
||||
}
|
||||
|
||||
private var content: some View {
|
||||
ScrollView(showsIndicators: false) {
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
screenHeader
|
||||
Text(flavor.name)
|
||||
.font(AppTypography.heading2)
|
||||
.foregroundStyle(AppColors.textPrimary)
|
||||
@@ -82,26 +92,6 @@ struct PizzaFlavorAddonsSheet: View {
|
||||
.navigationBarBackButtonHidden(true)
|
||||
}
|
||||
|
||||
private var screenHeader: some View {
|
||||
ZStack {
|
||||
Text("Adicionais")
|
||||
.font(AppTypography.heading2)
|
||||
.foregroundStyle(AppColors.textPrimary)
|
||||
HStack {
|
||||
Button(action: { dismiss() }) {
|
||||
Image(systemName: "chevron.left")
|
||||
.font(.system(size: 24, weight: .semibold))
|
||||
.foregroundStyle(AppColors.textPrimary)
|
||||
.frame(width: 52, height: 52)
|
||||
.background(AppColors.surface)
|
||||
.clipShape(Circle())
|
||||
.shadow(color: .black.opacity(0.06), radius: 8, y: 2)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func increment(_ addonId: String) {
|
||||
quantities[addonId, default: 0] += 1
|
||||
|
||||
Reference in New Issue
Block a user