Merge branch 'feature/more-info-map-and-postcode-copy' into integration/more-info-and-best-value
This commit is contained in:
@@ -118,34 +118,11 @@ struct StationDetailView: View {
|
|||||||
.accessibilityHint(String(localized: "Opens Apple Maps with driving directions",
|
.accessibilityHint(String(localized: "Opens Apple Maps with driving directions",
|
||||||
comment: "Accessibility hint for the tappable map preview in the More info sheet"))
|
comment: "Accessibility hint for the tappable map preview in the More info sheet"))
|
||||||
}
|
}
|
||||||
.listRowInsets(EdgeInsets())
|
// The map, the address, the distance, any notices and the two
|
||||||
}
|
// station actions all share ONE card. The list's own row
|
||||||
// The two station actions live in their OWN section, so they
|
// hairlines separate them (inset, the same line that already
|
||||||
// render as a separate card BELOW the map instead of sharing the
|
// separates Address from Distance), so no hand-rolled Divider is
|
||||||
// map's card and looking attached to the map tap target.
|
// needed — adding one would double the line.
|
||||||
Section {
|
|
||||||
HStack(spacing: 12) {
|
|
||||||
Button {
|
|
||||||
openDirections()
|
|
||||||
} label: {
|
|
||||||
Label("Directions", systemImage: "arrow.triangle.turn.up.right.diamond.fill")
|
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
}
|
|
||||||
Button(role: .destructive) {
|
|
||||||
showingReportIssueConfirmation = true
|
|
||||||
} label: {
|
|
||||||
Label("Report issue", systemImage: "exclamationmark.bubble.fill")
|
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// REQUIRED: with the default button style a `List` row has ONE
|
|
||||||
// row-wide tap target, so two buttons in the same row BOTH fire
|
|
||||||
// on any tap inside the row (tapping Directions also showed the
|
|
||||||
// report-issue alert and vice versa). `.borderless` gives each
|
|
||||||
// button its own hit area — the half-row frame above.
|
|
||||||
.buttonStyle(.borderless)
|
|
||||||
}
|
|
||||||
Section {
|
|
||||||
// The station name is NOT repeated here: the sheet header
|
// The station name is NOT repeated here: the sheet header
|
||||||
// (navigationTitle, inline) already shows it, and the address
|
// (navigationTitle, inline) already shows it, and the address
|
||||||
// line below has any leading repeat of the name stripped, so
|
// line below has any leading repeat of the name stripped, so
|
||||||
@@ -203,6 +180,28 @@ struct StationDetailView: View {
|
|||||||
.padding(.vertical, 6)
|
.padding(.vertical, 6)
|
||||||
.background(Capsule().fill(Color.orange.opacity(0.14)))
|
.background(Capsule().fill(Color.orange.opacity(0.14)))
|
||||||
}
|
}
|
||||||
|
// The two station actions are the LAST row of the card: half
|
||||||
|
// the width each, on one line, below Address and Distance.
|
||||||
|
HStack(spacing: 12) {
|
||||||
|
Button {
|
||||||
|
openDirections()
|
||||||
|
} label: {
|
||||||
|
Label("Directions", systemImage: "arrow.triangle.turn.up.right.diamond.fill")
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
}
|
||||||
|
Button(role: .destructive) {
|
||||||
|
showingReportIssueConfirmation = true
|
||||||
|
} label: {
|
||||||
|
Label("Report issue", systemImage: "exclamationmark.bubble.fill")
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// REQUIRED: with the default button style a `List` row has ONE
|
||||||
|
// row-wide tap target, so two buttons in the same row BOTH fire
|
||||||
|
// on any tap inside the row (tapping Directions also showed the
|
||||||
|
// report-issue alert and vice versa). `.borderless` gives each
|
||||||
|
// button its own hit area — the half-row frame above.
|
||||||
|
.buttonStyle(.borderless)
|
||||||
}
|
}
|
||||||
// Only shown while Fuel Savings backs it. `fuelSavings` is nil
|
// Only shown while Fuel Savings backs it. `fuelSavings` is nil
|
||||||
// when the feature is off — `savingsLookup` returns nil when it
|
// when the feature is off — `savingsLookup` returns nil when it
|
||||||
|
|||||||
Reference in New Issue
Block a user