Add link to source code / issue tracker

This commit is contained in:
Justin Mazzocchi 2021-03-14 12:09:23 -07:00
parent 3e976be263
commit 3d9ad3a5f5
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C
3 changed files with 14 additions and 7 deletions

View file

@ -4,6 +4,7 @@
"about.acknowledgments" = "Acknowledgments"; "about.acknowledgments" = "Acknowledgments";
"about.made-by-metabolist" = "Made by Metabolist"; "about.made-by-metabolist" = "Made by Metabolist";
"about.official-account" = "Official Account"; "about.official-account" = "Official Account";
"about.source-code-and-issue-tracker" = "Source Code & Issue Tracker";
"about.website" = "Website"; "about.website" = "Website";
"accessibility.activate-link-%@" = "Activate link: %@"; "accessibility.activate-link-%@" = "Activate link: %@";
"accessibility.copy-text" = "Copy text"; "accessibility.copy-text" = "Copy text";

View file

@ -130,10 +130,10 @@ public extension NavigationViewModel {
titleComponents: ["preferences.blocked-users"]))) titleComponents: ["preferences.blocked-users"])))
} }
func navigateToOfficialAccount() { func navigateToURL(_ url: URL) {
presentingSecondaryNavigation = false presentingSecondaryNavigation = false
presentedNewStatusViewModel = nil presentedNewStatusViewModel = nil
identityContext.service.navigationService.item(url: Self.officialAccountURL) identityContext.service.navigationService.item(url: url)
.sink { [weak self] in self?.navigationsSubject.send($0) } .sink { [weak self] in self?.navigationsSubject.send($0) }
.store(in: &cancellables) .store(in: &cancellables)
} }
@ -192,7 +192,3 @@ public extension NavigationViewModel {
return conversationsViewModel return conversationsViewModel
} }
} }
private extension NavigationViewModel {
static let officialAccountURL = URL(string: "https://mastodon.social/@metabolist")!
}

View file

@ -19,7 +19,7 @@ struct AboutView: View {
.frame(maxWidth: .infinity, alignment: .center) .frame(maxWidth: .infinity, alignment: .center)
Section(header: Text("about.made-by-metabolist")) { Section(header: Text("about.made-by-metabolist")) {
Button { Button {
viewModel.navigateToOfficialAccount() viewModel.navigateToURL(Self.officialAccountURL)
} label: { } label: {
Label { Label {
Text("about.official-account").foregroundColor(.primary) Text("about.official-account").foregroundColor(.primary)
@ -34,6 +34,13 @@ struct AboutView: View {
Image(systemName: "link") Image(systemName: "link")
} }
} }
Link(destination: Self.sourceCodeAndIssueTrackerURL) {
Label {
Text("about.source-code-and-issue-tracker").foregroundColor(.primary)
} icon: {
Image(systemName: "wrench.and.screwdriver")
}
}
} }
Section { Section {
NavigationLink( NavigationLink(
@ -48,6 +55,9 @@ struct AboutView: View {
private extension AboutView { private extension AboutView {
static let websiteURL = URL(string: "https://metabolist.org")! static let websiteURL = URL(string: "https://metabolist.org")!
static let officialAccountURL = URL(string: "https://mastodon.social/@metabolist")!
static let sourceCodeAndIssueTrackerURL = URL(string: "https://github.com/metabolist/metatext")!
static var version: String { static var version: String {
Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "" Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? ""
} }