From 99c4b49f28ac2d9e430cc857aef578440eb482ce Mon Sep 17 00:00:00 2001 From: Matt Kiazyk Date: Fri, 19 Jan 2024 15:36:18 -0600 Subject: [PATCH] Add Sponsor Button --- Xcodes/Frontend/About/AboutView.swift | 15 ++++++++++++--- Xcodes/Frontend/XcodeList/BottomStatusBar.swift | 9 +++++++++ Xcodes/Resources/Localizable.xcstrings | 3 +++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Xcodes/Frontend/About/AboutView.swift b/Xcodes/Frontend/About/AboutView.swift index 4967e2e..fb048da 100644 --- a/Xcodes/Frontend/About/AboutView.swift +++ b/Xcodes/Frontend/About/AboutView.swift @@ -45,9 +45,18 @@ struct AboutView: View { } .buttonStyle(LinkButtonStyle()) } - - Text(Bundle.main.humanReadableCopyright!) - .font(.footnote) + HStack { + Text(Bundle.main.humanReadableCopyright!) + .font(.footnote) + Button(action: { + openURL(URL(string: "https://opencollective.com/xcodesapp")!) + }) { + HStack { + Image(systemName: "heart.circle") + Text("SponsorXcodes") + } + } + } } } .padding() diff --git a/Xcodes/Frontend/XcodeList/BottomStatusBar.swift b/Xcodes/Frontend/XcodeList/BottomStatusBar.swift index cd38c3b..062b0dc 100644 --- a/Xcodes/Frontend/XcodeList/BottomStatusBar.swift +++ b/Xcodes/Frontend/XcodeList/BottomStatusBar.swift @@ -11,6 +11,7 @@ import SwiftUI struct BottomStatusModifier: ViewModifier { @EnvironmentObject var appState: AppState + @SwiftUI.Environment(\.openURL) var openURL: OpenURLAction func body(content: Content) -> some View { VStack(spacing: 0) { @@ -21,6 +22,14 @@ struct BottomStatusModifier: ViewModifier { Text(appState.bottomStatusBarMessage) .font(.subheadline) Spacer() + Button(action: { + openURL(URL(string: "https://opencollective.com/xcodesapp")!) + }) { + HStack { + Image(systemName: "heart.circle") + Text("SponsorXcodes") + } + } Text(Bundle.main.shortVersion!) .font(.subheadline) } diff --git a/Xcodes/Resources/Localizable.xcstrings b/Xcodes/Resources/Localizable.xcstrings index 1b0fa25..599d694 100644 --- a/Xcodes/Resources/Localizable.xcstrings +++ b/Xcodes/Resources/Localizable.xcstrings @@ -17251,6 +17251,9 @@ } } }, + "SponsorXcodes" : { + "extractionState" : "manual" + }, "StopInstallation" : { "localizations" : { "ca" : {