diff --git a/FollowUI/Sources/FollowUI/App.swift b/FollowUI/Sources/FollowUI/App.swift index 82a2a5b..4e75625 100644 --- a/FollowUI/Sources/FollowUI/App.swift +++ b/FollowUI/Sources/FollowUI/App.swift @@ -13,5 +13,6 @@ struct swift_followApp: App { WindowGroup { LandingView() } + .windowStyle(.hiddenTitleBar) } } diff --git a/FollowUI/Sources/FollowUI/EntryDetailView.swift b/FollowUI/Sources/FollowUI/EntryDetailView.swift index 08bdc82..ad96e4e 100644 --- a/FollowUI/Sources/FollowUI/EntryDetailView.swift +++ b/FollowUI/Sources/FollowUI/EntryDetailView.swift @@ -27,7 +27,9 @@ struct EntryDetailView: View { var body: some View { if #available(iOS 18.0, macOS 15.0, visionOS 2.0, *) { scrollView +#if os(iOS) .toolbarVisibility(.hidden, for: .tabBar) +#endif } else { scrollView } diff --git a/FollowUI/Sources/FollowUI/EntryListItemView.swift b/FollowUI/Sources/FollowUI/EntryListItemView.swift index 5c04fde..5bf0d8c 100644 --- a/FollowUI/Sources/FollowUI/EntryListItemView.swift +++ b/FollowUI/Sources/FollowUI/EntryListItemView.swift @@ -18,16 +18,16 @@ private struct EntryListItemText: View { VStack(alignment: .leading, spacing: 2) { Text(topSubtitle) .font(.custom("SNProVF-Bold", size: 11)) - .foregroundStyle(Color(uiColor: .secondaryLabel)) + .foregroundStyle(Color.secondaryLabel) .lineSpacing(2) .lineLimit(1) Text(headline) .font(.custom("SNProVF-Medium", size: 16)) - .foregroundStyle(Color(uiColor: read ? .secondaryLabel : .label)) + .foregroundStyle(read ? Color.secondaryLabel : Color.label) .lineLimit(1) Text(content) .font(.custom("SNProVF", size: 15)) - .foregroundStyle(Color(uiColor: .secondaryLabel)) + .foregroundStyle(Color.secondaryLabel) .lineSpacing(2) .lineLimit(3) } diff --git a/FollowUI/Sources/FollowUI/EntryListView.swift b/FollowUI/Sources/FollowUI/EntryListView.swift index 0dfde48..cdbce59 100644 --- a/FollowUI/Sources/FollowUI/EntryListView.swift +++ b/FollowUI/Sources/FollowUI/EntryListView.swift @@ -32,7 +32,9 @@ public struct EntryListView: View { public var body: some View { if #available(iOS 18.0, macOS 15.0, visionOS 2.0, *) { navigationStack +#if os(iOS) .toolbarVisibility(feeds == nil && lists == nil ? .visible : .hidden, for: .tabBar) +#endif } else { navigationStack } diff --git a/FollowUI/Sources/FollowUI/Extensions/ColorExtensions.swift b/FollowUI/Sources/FollowUI/Extensions/ColorExtensions.swift new file mode 100644 index 0000000..02eb74e --- /dev/null +++ b/FollowUI/Sources/FollowUI/Extensions/ColorExtensions.swift @@ -0,0 +1,25 @@ +// +// ColorExtensions.swift +// FollowUI +// +// Created by Ziyuan Zhao on 2024/12/7. +// + +import SwiftUI + +#if canImport(UIKit) +// MARK: Color + UIKit +extension Color { + static let secondaryLabel = Color(uiColor: .secondaryLabel) +} +#elseif canImport(AppKit) +// MARK: Color + AppKit +extension Color { + static let label = Color(nsColor: .labelColor) + + static let secondaryLabel = Color(nsColor: .secondaryLabelColor) + + // TODO: Find a proper color + static let systemGroupedBackground = Color(nsColor: .underPageBackgroundColor) +} +#endif diff --git a/FollowUI/Sources/FollowUI/LandingView.swift b/FollowUI/Sources/FollowUI/LandingView.swift index d7c53e4..d168d45 100644 --- a/FollowUI/Sources/FollowUI/LandingView.swift +++ b/FollowUI/Sources/FollowUI/LandingView.swift @@ -235,6 +235,7 @@ struct LandingView: View { } label: { Text("No account? Demo mode >") } + .buttonStyle(.plain) .sheet(isPresented: $showDemoModeLoginView) { DemoModeLoginView() .environmentObject(authHandler) @@ -255,6 +256,7 @@ struct LandingView: View { .foregroundColor(.white) .cornerRadius(8) } + .buttonStyle(.plain) Button(action: { authHandler.startAuthentication("google") }) { @@ -271,6 +273,7 @@ struct LandingView: View { .foregroundColor(.white) .cornerRadius(8) } + .buttonStyle(.plain) } .offset(y: buttonsOffset) .opacity(buttonsOpacity) diff --git a/FollowUI/Sources/FollowUI/ProfileView.swift b/FollowUI/Sources/FollowUI/ProfileView.swift index 572e156..90ec58d 100644 --- a/FollowUI/Sources/FollowUI/ProfileView.swift +++ b/FollowUI/Sources/FollowUI/ProfileView.swift @@ -102,7 +102,7 @@ struct ProfileView: View { } } .padding() - .background(Color(uiColor: .systemGroupedBackground)) + .background(Color.systemGroupedBackground) .clipShape(RoundedRectangle(cornerRadius: 8)) VStack(alignment: .leading, spacing: 0) { HStack { @@ -135,8 +135,8 @@ struct ProfileView: View { } .padding() } - .foregroundStyle(Color(uiColor: .label)) - .background(Color(uiColor: .systemGroupedBackground)) + .foregroundStyle(Color.label) + .background(Color.systemGroupedBackground) .clipShape(RoundedRectangle(cornerRadius: 8)) Button(action: { authHandler.logout() @@ -156,6 +156,7 @@ struct ProfileView: View { .background(Color(red: 59 / 255, green: 130 / 255, blue: 246 / 255)) .cornerRadius(8) } + .buttonStyle(.plain) } .padding() }