Skip to content

Commit

Permalink
Add external links
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentTreguier committed Oct 7, 2024
1 parent c10c7cb commit 7e0673e
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 20 deletions.
14 changes: 8 additions & 6 deletions Fyreplace.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -780,9 +780,10 @@
FYREPLACE_API_URL_DEV = "https://dev.rest.api.fyreplace.app";
FYREPLACE_API_URL_LOCAL = "http://localhost:8080";
FYREPLACE_API_URL_MAIN = "https://rest.api.fyreplace.app";
FYREPLACE_PRIVACY_POLICY = "https://fyreplace.net/privacy-policy";
FYREPLACE_TERMS_OF_SERVICE = "https://fyreplace.net/terms-of-service";
FYREPLACE_WEBSITE = "https://fyreplace.net";
FYREPLACE_INFO_URL_PRIVACY_POLICY = "https://fyreplace.net/privacy-policy";
FYREPLACE_INFO_URL_SOURCE_CODE = "https://github.com/fyreplace";
FYREPLACE_INFO_URL_TERMS_OF_SERVICE = "https://fyreplace.net/terms-of-service";
FYREPLACE_INFO_URL_WEBSITE = "https://fyreplace.net";
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -852,9 +853,10 @@
FYREPLACE_API_URL_DEV = "https://dev.rest.api.fyreplace.app";
FYREPLACE_API_URL_LOCAL = "";
FYREPLACE_API_URL_MAIN = "https://rest.api.fyreplace.app";
FYREPLACE_PRIVACY_POLICY = "https://fyreplace.net/privacy-policy";
FYREPLACE_TERMS_OF_SERVICE = "https://fyreplace.net/terms-of-service";
FYREPLACE_WEBSITE = "https://fyreplace.net";
FYREPLACE_INFO_URL_PRIVACY_POLICY = "https://fyreplace.net/privacy-policy";
FYREPLACE_INFO_URL_SOURCE_CODE = "https://github.com/fyreplace";
FYREPLACE_INFO_URL_TERMS_OF_SERVICE = "https://fyreplace.net/terms-of-service";
FYREPLACE_INFO_URL_WEBSITE = "https://fyreplace.net";
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
13 changes: 4 additions & 9 deletions Fyreplace/Commands/HelpCommands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@ private struct HelpCommandsLinks: View {
private var config

var body: some View {
Link(destination: config.app.info.website) {
Text("App.Help.Website")
}
Link(destination: config.app.info.termsOfService) {
Text("App.Help.TermsOfService")
}
Link(destination: config.app.info.privacyPolicy) {
Text("App.Help.PrivacyPolicy")
}
Link("App.Help.Website", destination: config.app.info.website)
Link("App.Help.TermsOfService", destination: config.app.info.termsOfService)
Link("App.Help.PrivacyPolicy", destination: config.app.info.privacyPolicy)
Link("App.Help.SourceCode", destination: config.app.info.sourceCode)
}
}
2 changes: 2 additions & 0 deletions Fyreplace/Config/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ struct Config {
let website: URL
let termsOfService: URL
let privacyPolicy: URL
let sourceCode: URL

init(_ data: [String: Any]) {
website = data.url("Website")!
termsOfService = data.url("TermsOfService")!
privacyPolicy = data.url("PrivacyPolicy")!
sourceCode = data.url("SourceCode")!
}
}

Expand Down
8 changes: 5 additions & 3 deletions Fyreplace/Config/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
<key>Info</key>
<dict>
<key>PrivacyPolicy</key>
<string>$(FYREPLACE_PRIVACY_POLICY)</string>
<string>$(FYREPLACE_INFO_URL_PRIVACY_POLICY)</string>
<key>SourceCode</key>
<string>$(FYREPLACE_INFO_URL_SOURCE_CODE)</string>
<key>TermsOfService</key>
<string>$(FYREPLACE_TERMS_OF_SERVICE)</string>
<string>$(FYREPLACE_INFO_URL_TERMS_OF_SERVICE)</string>
<key>Website</key>
<string>$(FYREPLACE_WEBSITE)</string>
<string>$(FYREPLACE_INFO_URL_WEBSITE)</string>
</dict>
<key>Name</key>
<string>$(PRODUCT_NAME)</string>
Expand Down
24 changes: 22 additions & 2 deletions Fyreplace/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,17 @@
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Privacy Policy"
"value" : "Privacy policy"
}
}
}
},
"App.Help.SourceCode" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Source code"
}
}
}
Expand All @@ -69,7 +79,7 @@
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Terms Of Service"
"value" : "Terms of service"
}
}
}
Expand Down Expand Up @@ -634,6 +644,16 @@
}
}
},
"Settings.About.Header" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "About"
}
}
}
},
"Settings.DateJoined:%@" : {
"localizations" : {
"en" : {
Expand Down
24 changes: 24 additions & 0 deletions Fyreplace/Views/Screens/SettingsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,30 @@ struct SettingsScreen: View, SettingsScreenProtocol {
} header: {
Text("Settings.Profile.Header")
}

Section {
Link(destination: config.app.info.website) {
Label("App.Help.Website", systemImage: "safari")
}
.foregroundStyle(.tint)

Link(destination: config.app.info.termsOfService) {
Label("App.Help.TermsOfService", systemImage: "shield")
}
.foregroundStyle(.tint)

Link(destination: config.app.info.privacyPolicy) {
Label("App.Help.PrivacyPolicy", systemImage: "lock")
}
.foregroundStyle(.tint)

Link(destination: config.app.info.sourceCode) {
Label("App.Help.SourceCode", systemImage: "curlybraces")
}
.foregroundStyle(.tint)
} header: {
Text("Settings.About.Header")
}
}
.navigationTitle(Destination.settings.titleKey)
.onAppear {
Expand Down

0 comments on commit 7e0673e

Please sign in to comment.