3
3
4
4
import SwiftUI
5
5
6
- private let reportBugUrl = URL (
7
- string: " https://github.com/krystxf/metro-now/issues/new?assignees=&labels=&projects=&template=bug_report.md&title= "
8
- )
9
-
10
- private let requestFeatureUrl = URL (
11
- string: " https://github.com/krystxf/metro-now/issues/new?assignees=&labels=&projects=&template=feature_request.md&title= "
12
- )
13
-
14
6
private let appStoreUrl = URL (
15
7
string: " https://apps.apple.com/cz/app/metro-now/id6504659402?platform=iphone "
16
8
)
17
9
18
- private let appStoreReviewUrl = URL (
19
- string: " https://itunes.apple.com/us/app/metro-now/id6504659402?mt=8&action=write-review "
20
- )
21
-
22
10
struct SettingsPageAboutSectionView : View {
11
+ let version = getFormattedVersionNumber ( )
12
+
23
13
var body : some View {
24
14
Section (
25
15
header: Label ( " About " , systemImage: " info.circle " )
@@ -33,10 +23,8 @@ struct SettingsPageAboutSectionView: View {
33
23
}
34
24
}
35
25
36
- if let appStoreReviewUrl {
37
- Link (
38
- destination: appStoreReviewUrl
39
- ) {
26
+ if let REVIEW_URL {
27
+ Link ( destination: REVIEW_URL) {
40
28
Label (
41
29
" Give us a rating " ,
42
30
systemImage: " star "
@@ -45,7 +33,10 @@ struct SettingsPageAboutSectionView: View {
45
33
. accessibilityHint ( " Opens app rating in app store " )
46
34
}
47
35
48
- if let reportBugUrl {
36
+ if let reportBugUrl = getGithubIssueUrl (
37
+ template: . bug_report,
38
+ title: " Bug in version \( version) "
39
+ ) {
49
40
Link ( destination: reportBugUrl) {
50
41
Label (
51
42
" Report bug " ,
@@ -55,8 +46,10 @@ struct SettingsPageAboutSectionView: View {
55
46
. accessibilityHint ( " Opens Github issue form " )
56
47
}
57
48
58
- if let requestFeatureUrl {
59
- Link ( destination: requestFeatureUrl) {
49
+ if let featureRequestUrl = getGithubIssueUrl (
50
+ template: . feature_request
51
+ ) {
52
+ Link ( destination: featureRequestUrl) {
60
53
Label (
61
54
" Feature request " ,
62
55
systemImage: " star.bubble "
0 commit comments