mirror of
https://github.com/tonytins/amtkstat.git
synced 2026-10-24 05:32:54 -04:00
Reverted back to old design
Forgot I was working on that
This commit is contained in:
parent
c699007cbf
commit
ca60e36ea2
1 changed files with 14 additions and 18 deletions
|
|
@ -17,6 +17,18 @@ struct ContentView: View {
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
|
HStack {
|
||||||
|
Text("Station Code:")
|
||||||
|
TextField("e.g. ASD", text: $stationCode)
|
||||||
|
.frame(width: 100)
|
||||||
|
|
||||||
|
Button("Submit") {
|
||||||
|
Task {
|
||||||
|
await loadTrainStatus(forStationCode: normalizedStationCode)
|
||||||
|
}
|
||||||
|
}.disabled(normalizedStationCode.isEmpty)
|
||||||
|
}.padding(10)
|
||||||
|
|
||||||
// Most popular Virtual Railfan stations
|
// Most popular Virtual Railfan stations
|
||||||
HStack {
|
HStack {
|
||||||
Button("Ashland, VA") {
|
Button("Ashland, VA") {
|
||||||
|
|
@ -36,7 +48,7 @@ struct ContentView: View {
|
||||||
await loadTrainStatus(forStationCode: "LAP")
|
await loadTrainStatus(forStationCode: "LAP")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.padding(10)
|
}
|
||||||
|
|
||||||
Table(rows) {
|
Table(rows) {
|
||||||
TableColumn("Time", value: \TrainStatusRow.time)
|
TableColumn("Time", value: \TrainStatusRow.time)
|
||||||
|
|
@ -69,7 +81,7 @@ struct ContentView: View {
|
||||||
HStack {
|
HStack {
|
||||||
if let errorMessage {
|
if let errorMessage {
|
||||||
Text(errorMessage)
|
Text(errorMessage)
|
||||||
} else if !currentStation.isEmpty && !isLoading {
|
} else if !currentStation.isEmpty {
|
||||||
Text(
|
Text(
|
||||||
"It is \(amtrakDate.localTime(timeZone: localTimeZone)) at \(currentStation) station"
|
"It is \(amtrakDate.localTime(timeZone: localTimeZone)) at \(currentStation) station"
|
||||||
)
|
)
|
||||||
|
|
@ -82,23 +94,7 @@ struct ContentView: View {
|
||||||
await loadTrainStatus(forStationCode: normalizedStationCode)
|
await loadTrainStatus(forStationCode: normalizedStationCode)
|
||||||
}
|
}
|
||||||
}.overlay(alignment: .topTrailing) {
|
}.overlay(alignment: .topTrailing) {
|
||||||
HStack {
|
|
||||||
Text("Station Code:")
|
|
||||||
TextField("e.g. ASD", text: $stationCode)
|
|
||||||
.frame(width: 100)
|
|
||||||
|
|
||||||
Button("Submit") {
|
|
||||||
Task {
|
|
||||||
await loadTrainStatus(forStationCode: normalizedStationCode)
|
|
||||||
}
|
|
||||||
}.disabled(normalizedStationCode.isEmpty)
|
|
||||||
}.frame(alignment: .topTrailing)
|
|
||||||
.padding(10)
|
|
||||||
|
|
||||||
}
|
|
||||||
.overlay(alignment: .topLeading) {
|
|
||||||
Text("Information by Amtraker")
|
Text("Information by Amtraker")
|
||||||
.frame(alignment: .topLeading)
|
|
||||||
.padding(10)
|
.padding(10)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue