From 415b0ff109bd5f59bda733fe3ba9bedc3518acb6 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 4 Jul 2022 00:13:06 +0200 Subject: [PATCH] Add chat links in settings --- .../Discord.imageset/Contents.json | 21 ++++++++++++ .../Discord-595b40b85ba036ed117dcf61 1.svg | 4 +++ .../Matrix.imageset/Contents.json | 21 ++++++++++++ .../Matrix (protocol) logo.svg | 9 ++++++ Shared/Settings/Help.swift | 7 ++-- Shared/Settings/SettingsView.swift | 32 +++++++++++++++++-- 6 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 Shared/Assets.xcassets/Discord.imageset/Contents.json create mode 100644 Shared/Assets.xcassets/Discord.imageset/Discord-595b40b85ba036ed117dcf61 1.svg create mode 100644 Shared/Assets.xcassets/Matrix.imageset/Contents.json create mode 100644 Shared/Assets.xcassets/Matrix.imageset/Matrix (protocol) logo.svg diff --git a/Shared/Assets.xcassets/Discord.imageset/Contents.json b/Shared/Assets.xcassets/Discord.imageset/Contents.json new file mode 100644 index 00000000..b60726aa --- /dev/null +++ b/Shared/Assets.xcassets/Discord.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Discord-595b40b85ba036ed117dcf61 1.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/Assets.xcassets/Discord.imageset/Discord-595b40b85ba036ed117dcf61 1.svg b/Shared/Assets.xcassets/Discord.imageset/Discord-595b40b85ba036ed117dcf61 1.svg new file mode 100644 index 00000000..f311ee99 --- /dev/null +++ b/Shared/Assets.xcassets/Discord.imageset/Discord-595b40b85ba036ed117dcf61 1.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Shared/Assets.xcassets/Matrix.imageset/Contents.json b/Shared/Assets.xcassets/Matrix.imageset/Contents.json new file mode 100644 index 00000000..3d5e93b8 --- /dev/null +++ b/Shared/Assets.xcassets/Matrix.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Matrix (protocol) logo.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/Assets.xcassets/Matrix.imageset/Matrix (protocol) logo.svg b/Shared/Assets.xcassets/Matrix.imageset/Matrix (protocol) logo.svg new file mode 100644 index 00000000..907f5f2d --- /dev/null +++ b/Shared/Assets.xcassets/Matrix.imageset/Matrix (protocol) logo.svg @@ -0,0 +1,9 @@ + + + Matrix (protocol) logo + + + + + + \ No newline at end of file diff --git a/Shared/Settings/Help.swift b/Shared/Settings/Help.swift index aef68950..20699e58 100644 --- a/Shared/Settings/Help.swift +++ b/Shared/Settings/Help.swift @@ -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) } diff --git a/Shared/Settings/SettingsView.swift b/Shared/Settings/SettingsView.swift index 57252d00..ef9d66ef 100644 --- a/Shared/Settings/SettingsView.swift +++ b/Shared/Settings/SettingsView.swift @@ -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