Add chat links in settings

This commit is contained in:
Arkadiusz Fal
2022-07-04 00:13:06 +02:00
parent 11ef8c4dfc
commit 795b19e07b
6 changed files with 90 additions and 4 deletions

View File

@@ -3,7 +3,8 @@ import SwiftUI
struct Help: View {
static let wikiURL = URL(string: "https://github.com/yattee/yattee/wiki")!
static let matrixURL = URL(string: "https://tinyurl.com/yattee-matrix")!
static let matrixURL = URL(string: "https://tinyurl.com/matrix-yattee")!
static let discordURL = URL(string: "https://yattee.stream/discord")!
static let issuesURL = URL(string: "https://github.com/yattee/yattee/issues")!
static let milestonesURL = URL(string: "https://github.com/yattee/yattee/milestones")!
static let donationsURL = URL(string: "https://github.com/yattee/yattee/wiki/Donations")!
@@ -30,9 +31,11 @@ struct Help: View {
Section {
header("I want to ask a question")
Text("Discussions take place in Matrix chat channel. It's a good spot for general questions.")
Text("Discussions take place in Discord and Matrix. It's a good spot for general questions.")
.padding(.bottom, 8)
helpItemLink("Discord Server", url: Self.discordURL, systemImage: "message")
.padding(.bottom, 8)
helpItemLink("Matrix Channel", url: Self.matrixURL, systemImage: "message")
.padding(.bottom, 8)
}

View File

@@ -3,6 +3,9 @@ import Foundation
import SwiftUI
struct SettingsView: View {
static let matrixURL = URL(string: "https://tinyurl.com/matrix-yattee")!
static let discordURL = URL(string: "https://yattee.stream/discord")!
#if os(macOS)
private enum Tabs: Hashable {
case locations, browsing, player, history, sponsorBlock, advanced, help
@@ -158,13 +161,38 @@ struct SettingsView: View {
}
}
Section(footer: versionString) {
Section {
NavigationLink {
Help()
} label: {
Label("Help", systemImage: "questionmark.circle")
}
}
#if !os(tvOS)
Section(header: Text("Contact"), footer: versionString) {
Link(destination: Self.discordURL) {
HStack {
Image("Discord")
.resizable()
.renderingMode(.template)
.frame(maxWidth: 30, maxHeight: 30)
Text("Discord Server")
}
}
Link(destination: Self.matrixURL) {
HStack {
Image("Matrix")
.resizable()
.renderingMode(.template)
.frame(maxWidth: 30, maxHeight: 30)
Text("Matrix Chat")
}
}
}
#endif
}
.navigationTitle("Settings")
.toolbar {
@@ -200,7 +228,7 @@ struct SettingsView: View {
case .advanced:
return 300
case .help:
return 570
return 600
}
}
#endif