feat: show station info on long press

This commit is contained in:
FuelBoard Contributor
2026-09-19 07:41:52 +01:00
parent 3c83c9b518
commit 551a40ddf0
+17 -10
View File
@@ -981,6 +981,21 @@ struct StationRow: View {
return String(format: "%+.1fp", delta) return String(format: "%+.1fp", delta)
} }
private func handleTap() {
switch tapAction {
case .openMap:
if let url = station.mapsDirectionsURL {
UIApplication.shared.open(url)
}
case .showDetails:
showDetails()
}
}
private func showDetails() {
onShowDetails(station)
}
var body: some View { var body: some View {
HStack(spacing: 12) { HStack(spacing: 12) {
// LEFT round brand logo (or generic fuel pump fallback) // LEFT round brand logo (or generic fuel pump fallback)
@@ -1059,16 +1074,8 @@ struct StationRow: View {
.buttonStyle(.borderless) .buttonStyle(.borderless)
} }
.contentShape(Rectangle()) .contentShape(Rectangle())
.onTapGesture { .onTapGesture(perform: handleTap)
switch tapAction { .onLongPressGesture(perform: showDetails)
case .openMap:
if let url = station.mapsDirectionsURL {
UIApplication.shared.open(url)
}
case .showDetails:
onShowDetails(station)
}
}
} }
} }