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() .appGroupedListRowBackground()
Section { Section {
Link("Website", destination: URL(string: "https://vaccor.space/tusker")!) Link(destination: URL(string: "https://vaccor.space/tusker")!) {
Label("Website", systemImage: "safari")
}
Button { Button {
if MFMailComposeViewController.canSendMail() { if MFMailComposeViewController.canSendMail() {
Task { Task {
@ -56,7 +58,7 @@ struct AboutView: View {
} }
} label: { } label: {
HStack { HStack {
Text("Get Support") Label("Get Support", systemImage: "envelope")
Spacer() Spacer()
if isGettingLogData { if isGettingLogData {
ProgressView() ProgressView()
@ -65,9 +67,14 @@ struct AboutView: View {
} }
} }
.disabled(isGettingLogData) .disabled(isGettingLogData)
Link("Source Code", destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker")!) Link(destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker")!) {
Link("Issue Tracker", destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker/issues")!) Label("Source Code", systemImage: "curlybraces")
} }
Link(destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker/issues")!) {
Label("Issue Tracker", systemImage: "checklist")
}
}
.labelStyle(AboutLinksLabelStyle())
.appGroupedListRowBackground() .appGroupedListRowBackground()
} }
.listStyle(.insetGrouped) .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 { struct AboutView_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
AboutView() AboutView()