Add icons to About screen links

This commit is contained in:
Shadowfacts 2023-04-16 14:12:27 -04:00
parent 8b7c78e3b1
commit 6ebcc162e6
1 changed files with 20 additions and 4 deletions

View File

@ -45,7 +45,9 @@ struct AboutView: View {
.appGroupedListRowBackground()
Section {
Link("Website", destination: URL(string: "https://vaccor.space/tusker")!)
Link(destination: URL(string: "https://vaccor.space/tusker")!) {
Label("Website", systemImage: "safari")
}
Button {
if MFMailComposeViewController.canSendMail() {
Task {
@ -56,7 +58,7 @@ struct AboutView: View {
}
} label: {
HStack {
Text("Get Support")
Label("Get Support", systemImage: "envelope")
Spacer()
if isGettingLogData {
ProgressView()
@ -65,9 +67,14 @@ struct AboutView: View {
}
}
.disabled(isGettingLogData)
Link("Source Code", destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker")!)
Link("Issue Tracker", destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker/issues")!)
Link(destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker")!) {
Label("Source Code", systemImage: "curlybraces")
}
Link(destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker/issues")!) {
Label("Issue Tracker", systemImage: "checklist")
}
}
.labelStyle(AboutLinksLabelStyle())
.appGroupedListRowBackground()
}
.listStyle(.insetGrouped)
@ -166,6 +173,15 @@ private struct MailSheet: UIViewControllerRepresentable {
}
}
private struct AboutLinksLabelStyle: LabelStyle {
func makeBody(configuration: Configuration) -> some View {
HStack(alignment: .lastTextBaseline, spacing: 8) {
configuration.icon
configuration.title
}
}
}
struct AboutView_Previews: PreviewProvider {
static var previews: some View {
AboutView()