feat: show station info on long press
This commit is contained in:
+17
-10
@@ -981,6 +981,21 @@ struct StationRow: View {
|
||||
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 {
|
||||
HStack(spacing: 12) {
|
||||
// LEFT — round brand logo (or generic fuel pump fallback)
|
||||
@@ -1059,16 +1074,8 @@ struct StationRow: View {
|
||||
.buttonStyle(.borderless)
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
switch tapAction {
|
||||
case .openMap:
|
||||
if let url = station.mapsDirectionsURL {
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
case .showDetails:
|
||||
onShowDetails(station)
|
||||
}
|
||||
}
|
||||
.onTapGesture(perform: handleTap)
|
||||
.onLongPressGesture(perform: showDetails)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user