-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Update tab bar icons and more label * feat: Implement More page UI * test: Get existing tests passing * fix: Add string localization comments * test: Add test to ensure links exist
- Loading branch information
Showing
24 changed files
with
646 additions
and
201 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// TabLabel.swift | ||
// iosApp | ||
// | ||
// Created by esimon on 10/24/24. | ||
// Copyright © 2024 MBTA. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct TabLabel: View { | ||
var title: String | ||
var image: ImageResource | ||
|
||
init(_ title: String, image: ImageResource) { | ||
self.title = title | ||
self.image = image | ||
} | ||
|
||
var body: some View { | ||
Label(title: { Text(title) }, icon: { Image(image) }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
iosApp/iosApp/Icons.xcassets/fa-phone.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images": [ | ||
{ | ||
"filename": "fa-phone.svg", | ||
"idiom": "universal" | ||
} | ||
], | ||
"info": { | ||
"author": "xcode", | ||
"version": 1 | ||
}, | ||
"properties": { | ||
"template-rendering-intent": "template" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions
12
iosApp/iosApp/Icons.xcassets/mbta-logo.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images": [ | ||
{ | ||
"filename": "mbta-logo.svg", | ||
"idiom": "universal" | ||
} | ||
], | ||
"info": { | ||
"author": "xcode", | ||
"version": 1 | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
iosApp/iosApp/Icons.xcassets/mbta-logo.imageset/mbta-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
iosApp/iosApp/Icons.xcassets/tab-icon-more.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images": [ | ||
{ | ||
"filename": "tab-icon-more.svg", | ||
"idiom": "universal" | ||
} | ||
], | ||
"info": { | ||
"author": "xcode", | ||
"version": 1 | ||
}, | ||
"properties": { | ||
"template-rendering-intent": "template" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
iosApp/iosApp/Icons.xcassets/tab-icon-more.imageset/tab-icon-more.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
iosApp/iosApp/Icons.xcassets/tab-icon-nearby.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images": [ | ||
{ | ||
"filename": "tab-icon-nearby.svg", | ||
"idiom": "universal" | ||
} | ||
], | ||
"info": { | ||
"author": "xcode", | ||
"version": 1 | ||
}, | ||
"properties": { | ||
"template-rendering-intent": "template" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
iosApp/iosApp/Icons.xcassets/tab-icon-nearby.imageset/tab-icon-nearby.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// | ||
// MoreItem.swift | ||
// iosApp | ||
// | ||
// Created by esimon on 10/28/24. | ||
// Copyright © 2024 MBTA. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import shared | ||
|
||
enum MoreItem: Identifiable, Equatable { | ||
case toggle(setting: Setting) | ||
case link(label: String, url: String, note: String? = nil) | ||
case phone(label: String, phoneNumber: String) | ||
|
||
var id: String { | ||
switch self { | ||
case let .toggle(setting: setting): setting.key.name | ||
case let .link(label: _, url: url, note: _): url | ||
case let .phone(label: _, phoneNumber: number): number | ||
} | ||
} | ||
|
||
var label: String { | ||
switch self { | ||
case let .toggle(setting: setting): | ||
switch setting.key { | ||
case .hideMaps: NSLocalizedString( | ||
"Hide Maps", | ||
comment: "A setting on the More page to remove the app component from the app" | ||
) | ||
case .searchRouteResults: NSLocalizedString( | ||
"Route Search", | ||
comment: "A setting on the More page to display routes in search (only visible for developers)" | ||
) | ||
case .map: NSLocalizedString( | ||
"Map Debug", | ||
comment: "A setting on the More page to display map debug information (only visible for developers)" | ||
) | ||
} | ||
|
||
case let .link(label: label, url: _, note: _): label | ||
|
||
case let .phone(label: label, phoneNumber: _): label | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// MoreLink.swift | ||
// iosApp | ||
// | ||
// Created by esimon on 10/28/24. | ||
// Copyright © 2024 MBTA. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct MoreLink: View { | ||
var label: String | ||
var url: String | ||
var note: String? = nil | ||
|
||
@ScaledMetric | ||
private var iconSize: CGFloat = 10.5 | ||
|
||
var body: some View { | ||
Link(destination: URL(string: url)!) { | ||
HStack(alignment: .center, spacing: 0) { | ||
VStack(alignment: .leading, spacing: 0) { | ||
Text(label) | ||
.foregroundStyle(Color.text) | ||
.font(Typography.body) | ||
if let note { | ||
Text(note) | ||
.foregroundStyle(Color.text) | ||
.font(Typography.footnote) | ||
.opacity(0.6) | ||
.padding(.top, 2) | ||
} | ||
} | ||
Spacer() | ||
Image(systemName: "arrow.up.right") | ||
.resizable() | ||
.frame(width: iconSize, height: iconSize, alignment: .center) | ||
.foregroundStyle(Color.deemphasized) | ||
.fontWeight(.bold) | ||
} | ||
} | ||
.padding(.vertical, 10) | ||
.padding(.horizontal, 16) | ||
.frame(minHeight: 44) | ||
} | ||
} |
Oops, something went wrong.