Skip to content

Commit

Permalink
fix(app): detail navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
krystxf committed May 17, 2024
1 parent 1702c06 commit 728962e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/app-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: false
matrix:
device: [14, 15]
iOS: [17.5]
iOS: [17.4, 17.5]
name: App CI 🚀 (iPhone ${{ matrix.device }}, iOS ${{ matrix.iOS }} )

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
- name: Lint
continue-on-error: true
run: |
cd ./frontend
cd ./docs
pnpm install
pnpm run lint
- name: Build
run: |
cd ./frontend
cd ./docs
pnpm install
pnpm run build
6 changes: 3 additions & 3 deletions app/metro-now/metro-now-types/metroStationsTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct MetroStationsGeoJSONFeatureGeometryProperties: Codable {
}

struct MetroStationsGeoJSONFeatureGeometryPropertiesPlatform: Codable, Hashable {
let gtfsID: String?
let name: String?
let direction: String?
let gtfsId: String
let name: String
let direction: String
}
4 changes: 4 additions & 0 deletions app/metro-now/metro-now.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -527,6 +528,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -548,6 +550,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = R6WU5ABNG2;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.krystof.metro-now-tests";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -566,6 +569,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = R6WU5ABNG2;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.krystof.metro-now-tests";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
15 changes: 6 additions & 9 deletions app/metro-now/metro-now/Core/Map/MapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct MapView: View {
var body: some View {
Map {
ForEach(metroStationsGeoJSON!.features, id: \.properties.name) { feature in
let metroLines: [String] = Array(Set(feature.properties.platforms.map { $0.name! }))
let metroLines: [String] = Array(Set(feature.properties.platforms.map { $0.name }))

Annotation(
feature.properties.name,
Expand All @@ -25,13 +25,11 @@ struct MapView: View {
ForEach(Array(metroLines.enumerated()), id: \.0) {
index, metroLine in


Rectangle()
.foregroundStyle(.white)

.clipShape(.rect(cornerRadius: .infinity))
.offset(x: index == 0 ? 0 : -10, y: index == 0 ? 0 : -10)

Rectangle()
.foregroundStyle(.white)
.clipShape(.rect(cornerRadius: .infinity))
.offset(x: index == 0 ? 0 : -10, y: index == 0 ? 0 : -10)

Image(
systemName:
getMetroLineIcon(metroLine)
Expand All @@ -44,7 +42,6 @@ struct MapView: View {
}
}
.mapStyle(.standard(elevation: .realistic))

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ struct PlatformDetailView: View {
.fontWeight(.bold)
.foregroundStyle(.white)
Text(formatTime(seconds: 20))
.font(.title)
.font(.largeTitle)
.foregroundStyle(.white)
Text("Also in \(formatTime(seconds: 200))")
.font(.title2)
.foregroundStyle(.white)

Spacer()
}
.padding(.top, 50)
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions app/metro-now/metro-now/Core/PlatformList/PlatformListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@ struct PlatformsListView: View {
LazyVStack(spacing: 10) {
if let station {
ForEach(station.properties.platforms, id: \.self) { platform in
NavigationLink(value: platform) {
NavigationLink {
PlatformDetailView(
direction: platform.direction
)
}
label: {
PlatformListItemView(
direction: platform.direction!,
direction: platform.direction,
departure: formatTime(seconds: 20),
metroLine: MetroLine(rawValue: platform.name!)!,
metroLine: MetroLine(rawValue: platform.name)!,
nextDeparture: formatTime(seconds: 200)
)
}
Expand All @@ -28,12 +33,7 @@ struct PlatformsListView: View {
}
.padding(10)
}
.navigationDestination(for: Int.self) {
_ in
PlatformDetailView(
direction: "Háje"
)
}

.navigationTitle(station?.properties.name ?? "")
}
}
Expand Down

0 comments on commit 728962e

Please sign in to comment.