From 728962e1b16a5a52ebfde90d2b09a8adfc243082 Mon Sep 17 00:00:00 2001 From: Krystof Date: Sat, 18 May 2024 00:41:31 +0200 Subject: [PATCH] fix(app): detail navigation --- .github/workflows/app-ci.yaml | 2 +- .github/workflows/docs-ci.yml | 4 ++-- .../metro-now-types/metroStationsTypes.swift | 6 +++--- .../metro-now.xcodeproj/project.pbxproj | 4 ++++ app/metro-now/metro-now/Core/Map/MapView.swift | 15 ++++++--------- .../PlatformDetail/PlatformDetailView.swift | 3 ++- .../Core/PlatformList/PlatformListView.swift | 18 +++++++++--------- 7 files changed, 27 insertions(+), 25 deletions(-) diff --git a/.github/workflows/app-ci.yaml b/.github/workflows/app-ci.yaml index 499d0e39..dab8af61 100644 --- a/.github/workflows/app-ci.yaml +++ b/.github/workflows/app-ci.yaml @@ -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: diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index 6b0a9b57..9766494f 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -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 diff --git a/app/metro-now/metro-now-types/metroStationsTypes.swift b/app/metro-now/metro-now-types/metroStationsTypes.swift index fb6b13cd..0a14f28c 100644 --- a/app/metro-now/metro-now-types/metroStationsTypes.swift +++ b/app/metro-now/metro-now-types/metroStationsTypes.swift @@ -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 } diff --git a/app/metro-now/metro-now.xcodeproj/project.pbxproj b/app/metro-now/metro-now.xcodeproj/project.pbxproj index 79c37028..3e44bb6f 100644 --- a/app/metro-now/metro-now.xcodeproj/project.pbxproj +++ b/app/metro-now/metro-now.xcodeproj/project.pbxproj @@ -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", @@ -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", @@ -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)"; @@ -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)"; diff --git a/app/metro-now/metro-now/Core/Map/MapView.swift b/app/metro-now/metro-now/Core/Map/MapView.swift index 640c3c1a..7f8dd00c 100644 --- a/app/metro-now/metro-now/Core/Map/MapView.swift +++ b/app/metro-now/metro-now/Core/Map/MapView.swift @@ -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, @@ -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) @@ -44,7 +42,6 @@ struct MapView: View { } } .mapStyle(.standard(elevation: .realistic)) - } } diff --git a/app/metro-now/metro-now/Core/PlatformDetail/PlatformDetailView.swift b/app/metro-now/metro-now/Core/PlatformDetail/PlatformDetailView.swift index 6732edf8..f743d475 100644 --- a/app/metro-now/metro-now/Core/PlatformDetail/PlatformDetailView.swift +++ b/app/metro-now/metro-now/Core/PlatformDetail/PlatformDetailView.swift @@ -26,7 +26,7 @@ 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) @@ -34,6 +34,7 @@ struct PlatformDetailView: View { Spacer() } + .padding(.top, 50) } } } diff --git a/app/metro-now/metro-now/Core/PlatformList/PlatformListView.swift b/app/metro-now/metro-now/Core/PlatformList/PlatformListView.swift index 19dcc76c..5f244b00 100644 --- a/app/metro-now/metro-now/Core/PlatformList/PlatformListView.swift +++ b/app/metro-now/metro-now/Core/PlatformList/PlatformListView.swift @@ -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) ) } @@ -28,12 +33,7 @@ struct PlatformsListView: View { } .padding(10) } - .navigationDestination(for: Int.self) { - _ in - PlatformDetailView( - direction: "Háje" - ) - } + .navigationTitle(station?.properties.name ?? "") } }