@@ -10,7 +10,8 @@ import SwiftUI
1010struct MoreScreen : View {
1111 @Environment ( \. locale) private var locale
1212 @Environment ( AppSettings . self) private var appSettings
13-
13+ private let appId = " id6744068216 "
14+
1415 var body : some View {
1516 NavigationStack {
1617 ScrollView {
@@ -21,6 +22,7 @@ struct MoreScreen: View {
2122 appThemePicker
2223 appDataButton
2324 feedbackButton
25+ rateAppButton
2426 shareAppButton
2527 githubButton
2628 }
@@ -55,20 +57,27 @@ struct MoreScreen: View {
5557 }
5658
5759 private var appDataButton : some View {
58- NavigationLink ( destination: AppDataScreen ( ) ) {
59- Text ( " App data " )
60- }
60+ NavigationLink ( " App data " , destination: AppDataScreen ( ) )
61+ . accessibilityIdentifier ( " appDataButton " )
6162 }
6263
6364 private var feedbackButton : some View {
6465 Button ( " Send feedback " , action: FeedbackSender . sendFeedback)
6566 . accessibilityIdentifier ( " sendFeedbackButton " )
6667 }
67-
68+
69+ @ViewBuilder
70+ private var rateAppButton : some View {
71+ if let appReviewLink = URL ( string: " https://apps.apple.com/app/ \( appId) ?action=write-review " ) {
72+ Link ( " Rate the app " , destination: appReviewLink)
73+ . accessibilityIdentifier ( " rateAppButton " )
74+ }
75+ }
76+
6877 @ViewBuilder
6978 private var shareAppButton : some View {
7079 let languageCode = locale. identifier. split ( separator: " _ " ) . first == " ru " ? " ru " : " us "
71- if let appStoreLink = URL ( string: " https://apps.apple.com/ \( languageCode) /app/id6744068216 " ) {
80+ if let appStoreLink = URL ( string: " https://apps.apple.com/ \( languageCode) /app/ \( appId ) " ) {
7281 ShareLink ( item: appStoreLink) {
7382 Text ( " Share the app " )
7483 }
@@ -79,10 +88,8 @@ struct MoreScreen: View {
7988 @ViewBuilder
8089 private var githubButton : some View {
8190 if let githubLink = URL ( string: " https://github.com/easydev991/SwiftUI-Days " ) {
82- Link ( destination: githubLink) {
83- Text ( " GitHub page " )
84- }
85- . accessibilityIdentifier ( " linkToGitHubPage " )
91+ Link ( " GitHub page " , destination: githubLink)
92+ . accessibilityIdentifier ( " linkToGitHubPage " )
8693 }
8794 }
8895
0 commit comments