From 0c14956218a32a1063c95213a2b55016bc9a7797 Mon Sep 17 00:00:00 2001 From: Cay Zhang <13341339+Cay-Zhang@users.noreply.github.com> Date: Tue, 11 Jul 2023 01:18:16 -0500 Subject: [PATCH] Add shortcut workshop link in StartView --- .../GitHub.symbolset/Contents.json | 12 ++ .../GitHub.symbolset/github.fill.svg | 167 ++++++++++++++++++ Shared/SettingsView.swift | 11 +- Shared/StartView.swift | 37 +++- Shared/en.lproj/Localizable.strings | 2 +- 5 files changed, 220 insertions(+), 9 deletions(-) create mode 100644 Shared/Assets.xcassets/GitHub.symbolset/Contents.json create mode 100644 Shared/Assets.xcassets/GitHub.symbolset/github.fill.svg diff --git a/Shared/Assets.xcassets/GitHub.symbolset/Contents.json b/Shared/Assets.xcassets/GitHub.symbolset/Contents.json new file mode 100644 index 00000000..092d1f2a --- /dev/null +++ b/Shared/Assets.xcassets/GitHub.symbolset/Contents.json @@ -0,0 +1,12 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "symbols" : [ + { + "filename" : "github.fill.svg", + "idiom" : "universal" + } + ] +} diff --git a/Shared/Assets.xcassets/GitHub.symbolset/github.fill.svg b/Shared/Assets.xcassets/GitHub.symbolset/github.fill.svg new file mode 100644 index 00000000..9964bc12 --- /dev/null +++ b/Shared/Assets.xcassets/GitHub.symbolset/github.fill.svg @@ -0,0 +1,167 @@ + + + + + + + + + + Weight/Scale Variations + Ultralight + Thin + Light + Regular + Medium + Semibold + Bold + Heavy + Black + + + + + + + + + + + Design Variations + Symbols are supported in up to nine weights and three scales. + For optimal layout with text and other symbols, vertically align + symbols with the adjacent text. + + + + + + Margins + Leading and trailing margins on the left and right side of each symbol + can be adjusted by modifying the x-location of the margin guidelines. + Modifications are automatically applied proportionally to all + scales and weights. + + + + Exporting + Symbols should be outlined when exporting to ensure the + design is preserved when submitting to Xcode. + Template v.4.0 + Requires Xcode 14 or greater + Generated from github.fill + Typeset at 100 points + Small + Medium + Large + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Shared/SettingsView.swift b/Shared/SettingsView.swift index 3aa48d0e..2a2f94b2 100644 --- a/Shared/SettingsView.swift +++ b/Shared/SettingsView.swift @@ -84,8 +84,15 @@ struct SettingsView: View { } Section(header: Text("Settings Section About")) { - Button("GitHub Repo Homepage", systemImage: "star.fill") { - openURL(URLComponents(string: "https://github.com/Cay-Zhang/RSSBud")!) + Button { + openURL("https://github.com/Cay-Zhang/RSSBud") + } label: { + Label { + Text("GitHub Repo Homepage") + } icon: { + Image("GitHub") + .font(.system(size: 19)) + } } Button("Telegram Channel", systemImage: "paperplane.fill") { diff --git a/Shared/StartView.swift b/Shared/StartView.swift index 0005fd83..8859a3a4 100644 --- a/Shared/StartView.swift +++ b/Shared/StartView.swift @@ -8,6 +8,7 @@ import SwiftUI struct StartView: View { + @State var isShortcutWorkshopPresented: Bool = false @Binding var isRuleManagerPresented: Bool @Environment(\.customOpenURLAction) var openURL @@ -24,19 +25,43 @@ struct StartView: View { ExpandableSection(viewModel: viewModel.startViewResourceSection) { LazyVGrid(columns: [GridItem(.adaptive(minimum: 150, maximum: .infinity), spacing: 10)], spacing: 10) { - Button("GitHub Repo Homepage", systemImage: "star.fill") { + Button("Rules", systemImage: "terminal.fill") { + isRuleManagerPresented = true + } + + Button("Shortcut Workshop", systemImage: "square.stack.3d.up.fill") { + isShortcutWorkshopPresented = true + }.sheet(isPresented: $isShortcutWorkshopPresented) { + NavigationView { + ShortcutWorkshopView() + .toolbar { + ToolbarItem(placement: .navigationBarTrailing) { + Button { + isShortcutWorkshopPresented = false + } label: { + Image(systemName: "checkmark") + } + } + } + }.modifier(CustomOpenURLModifier(openInSystem: openURL.openInSystem)) + } + + Button { openURL("https://github.com/Cay-Zhang/RSSBud") + } label: { + Label { + Text("GitHub Repo Homepage") + } icon: { + Image("GitHub") + .font(.system(size: 28)) + .offset(y: -1) + } } Button("Telegram Group", systemImage: "paperplane.fill") { openURL("https://t.me/RSSBud_Discussion") } - Button("Rules", systemImage: "checklist") { - isRuleManagerPresented = true - } - - Button("All About RSS", systemImage: "list.star") { openURL("https://github.com/AboutRSS/ALL-about-RSS") } diff --git a/Shared/en.lproj/Localizable.strings b/Shared/en.lproj/Localizable.strings index 4259299f..6818aa2b 100644 --- a/Shared/en.lproj/Localizable.strings +++ b/Shared/en.lproj/Localizable.strings @@ -42,7 +42,7 @@ "Access Control" = "Access Control"; "Prefer Opening URL In App" = "Prefer Opening Links in App"; "Access Key" = "Access Key"; -"GitHub Repo Homepage" = "GitHub Repo Homepage"; +"GitHub Repo Homepage" = "GitHub Repo"; "Telegram Channel" = "Telegram Channel"; "Telegram Group" = "Telegram Group";