From 903e58b3c510321ee57f473c36a56892ff8b513f Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Wed, 12 Oct 2022 13:16:33 -0700 Subject: [PATCH 1/3] add empty subscriptions list message --- .../Sources/App/Views/Profile/Subscriptions.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/Subscriptions.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/Subscriptions.swift index 39808ce52..69d11b7a8 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/Subscriptions.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/Subscriptions.swift @@ -64,6 +64,12 @@ struct SubscriptionsView: View { ) .buttonStyle(RoundedRectButtonStyle()) } + } else if viewModel.subscriptions.isEmpty { + VStack(alignment: .center) { + Spacer() + Text("You have no current subscriptions.") + Spacer() + } } else { Group { #if os(iOS) From b3310c61c7c6dbe693ef7c5e51ce67bbb2b5236a Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Wed, 12 Oct 2022 13:23:22 -0700 Subject: [PATCH 2/3] update buttons on welcome screen to work for macos --- .../OmnivoreKit/Sources/App/Views/WelcomeView.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift index 6e3baa145..ab9362812 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift @@ -43,7 +43,15 @@ struct WelcomeView: View { headlineText Button( - action: { showAboutPage = true }, + action: { + #if os(iOS) + showAboutPage = true + #else + if let url = URL(string: "https://omnivore.app/about") { + NSWorkspace.shared.open(url) + } + #endif + }, label: { HStack(spacing: 4) { Text("Learn more") @@ -159,6 +167,9 @@ struct WelcomeView: View { } ) .padding(.vertical) + #if os(macOS) + .buttonStyle(PlainButtonStyle()) + #endif return VStack(alignment: .center, spacing: 16) { From cd1b62b85b6e65cf5f61d82599826fd96b2b4512 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Wed, 12 Oct 2022 13:33:59 -0700 Subject: [PATCH 3/3] add min size to macos email login view frame --- .../EmailAuth/EmailAuthView.swift | 42 ++++++++++++------- .../EmailAuth/EmailLoginFormView.swift | 2 +- .../EmailAuth/EmailSignupFormView.swift | 2 +- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailAuthView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailAuthView.swift index c30693016..8ac1a14c1 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailAuthView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailAuthView.swift @@ -42,24 +42,34 @@ struct EmailAuthView: View { } } - var body: some View { - NavigationView { - ZStack { - Color.appBackground.edgesIgnoringSafeArea(.all) - primaryContent - .frame(maxWidth: 300) - #if os(iOS) - .navigationBarTitleDisplayMode(.inline) - #endif - .toolbar { - ToolbarItem(placement: .barTrailing) { - Button( - action: { presentationMode.wrappedValue.dismiss() }, - label: { Image(systemName: "xmark").foregroundColor(.appGrayTextContrast) } - ) - } + var innerBody: some View { + ZStack { + Color.appBackground.edgesIgnoringSafeArea(.all) + primaryContent + .frame(maxWidth: 300) + #if os(iOS) + .navigationBarTitleDisplayMode(.inline) + #endif + .toolbar { + ToolbarItem(placement: .barTrailing) { + Button( + action: { presentationMode.wrappedValue.dismiss() }, + label: { Image(systemName: "xmark").foregroundColor(.appGrayTextContrast) } + ) } } } } + + var body: some View { + #if os(iOS) + NavigationView { + innerBody + } + #else + innerBody + .frame(minWidth: 400, minHeight: 400) + .buttonStyle(PlainButtonStyle()) + #endif + } } diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailLoginFormView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailLoginFormView.swift index b8d20ccd4..d7b78705c 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailLoginFormView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailLoginFormView.swift @@ -44,7 +44,7 @@ struct EmailLoginFormView: View { VStack(spacing: 28) { ScrollView(showsIndicators: false) { if horizontalSizeClass == .regular { - Spacer(minLength: 150) + Spacer(minLength: isMacApp ? 50 : 150) } VStack { VStack(alignment: .leading, spacing: 6) { diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailSignupFormView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailSignupFormView.swift index 12d6ae09a..a5cd9b927 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailSignupFormView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailSignupFormView.swift @@ -86,7 +86,7 @@ struct EmailSignupFormView: View { VStack(spacing: 28) { ScrollView(showsIndicators: false) { if horizontalSizeClass == .regular { - Spacer(minLength: 150) + Spacer(minLength: isMacApp ? 50 : 150) } VStack { // Email