[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:
Daniel Arantes Loverde
2026-08-24 14:35:48 -03:00
parent 59ec6ffd6f
commit 345618426f
17 changed files with 284 additions and 486 deletions

View File

@@ -31,9 +31,21 @@ struct MyReviewsView: View {
}
var body: some View {
LCENavigationView {
content
}
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
.setTitle(text: Text("Minhas Avaliações").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
.navigationDestination(item: $selectedDraft) { draft in
OrderReviewView(draft: draft) {
Task { await loadReviewsFromBackend(forceRefresh: true) }
}
}
}
private var content: some View {
ScrollView(showsIndicators: false) {
VStack(spacing: 12) {
screenHeader
if isLoading && reviews.isEmpty && pendingReviews.isEmpty {
ProgressView()
.frame(maxWidth: .infinity)
@@ -69,13 +81,6 @@ struct MyReviewsView: View {
.padding(.bottom, UIDevice.bottomNotch + 30)
}
.background(AppColors.backgroundLight)
.appHiddenNavigationBar()
.navigationBarBackButtonHidden(true)
.navigationDestination(item: $selectedDraft) { draft in
OrderReviewView(draft: draft) {
Task { await loadReviewsFromBackend(forceRefresh: true) }
}
}
.onAppear {
Task { await loadReviewsFromBackend(forceRefresh: true) }
}
@@ -91,27 +96,6 @@ struct MyReviewsView: View {
}
}
private var screenHeader: some View {
ZStack {
Text("Minhas Avaliações")
.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 var emptyState: some View {
VStack(spacing: 8) {
Text("Você não tem avaliações nem pendências no momento.")
@@ -458,9 +442,16 @@ struct OrderReviewView: View {
@State var orderItems: [PublicOrderItem] = []
var body: some View {
LCENavigationView {
content
}
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
.setTitle(text: Text("Avaliar Pedido").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary))
}
private var content: some View {
ScrollView(showsIndicators: false) {
VStack(alignment: .leading, spacing: 24) {
screenHeader
topSection
orderItemsSection
if existingReview != nil {
@@ -515,27 +506,6 @@ struct OrderReviewView: View {
}
}
private var screenHeader: some View {
ZStack {
Text("Avaliar Pedido")
.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 var newReviewContent: some View {
VStack(alignment: .leading, spacing: 24) {
starsSection