mirror of
https://github.com/tonytins/amtkstat.git
synced 2026-10-24 05:32:54 -04:00
Ideal width
This commit is contained in:
parent
789e697828
commit
0475e39760
1 changed files with 10 additions and 13 deletions
|
|
@ -21,32 +21,28 @@ struct ContentView: View {
|
||||||
}
|
}
|
||||||
}.disabled(normalizedStationCode.isEmpty || isLoading)
|
}.disabled(normalizedStationCode.isEmpty || isLoading)
|
||||||
}.padding(10)
|
}.padding(10)
|
||||||
|
|
||||||
// Most popular Virtual Railfan stations
|
// Most popular Virtual Railfan stations
|
||||||
HStack {
|
HStack {
|
||||||
Button("Ashland, VA")
|
Button("Ashland, VA") {
|
||||||
{
|
|
||||||
Task {
|
Task {
|
||||||
await loadTrainStatus(forStationCode: "ASD")
|
await loadTrainStatus(forStationCode: "ASD")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button("San Juan Capistrano, CA")
|
Button("San Juan Capistrano, CA") {
|
||||||
{
|
|
||||||
Task {
|
Task {
|
||||||
await loadTrainStatus(forStationCode: "SNC")
|
await loadTrainStatus(forStationCode: "SNC")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button("La Plata, MO")
|
Button("La Plata, MO") {
|
||||||
{
|
|
||||||
Task {
|
Task {
|
||||||
await loadTrainStatus(forStationCode: "LAP")
|
await loadTrainStatus(forStationCode: "LAP")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Table(rows) {
|
Table(rows) {
|
||||||
TableColumn("Number", value: \TrainStatusRow.trainNum)
|
TableColumn("Number", value: \TrainStatusRow.trainNum)
|
||||||
TableColumn("Route", value: \TrainStatusRow.routeName)
|
TableColumn("Route", value: \TrainStatusRow.routeName)
|
||||||
|
|
@ -56,17 +52,18 @@ struct ContentView: View {
|
||||||
}.overlay(alignment: .bottomTrailing) {
|
}.overlay(alignment: .bottomTrailing) {
|
||||||
if isLoading {
|
if isLoading {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
|
.frame(alignment: .topTrailing)
|
||||||
.padding(10)
|
.padding(10)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
if let errorMessage {
|
if let errorMessage {
|
||||||
Text(errorMessage)
|
Text(errorMessage)
|
||||||
}
|
}
|
||||||
}.padding(10)
|
}.padding(10)
|
||||||
|
|
||||||
}.padding()
|
}.frame(idealWidth: 500)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
Task {
|
Task {
|
||||||
await loadTrainStatus(forStationCode: normalizedStationCode)
|
await loadTrainStatus(forStationCode: normalizedStationCode)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue