Skip to content

fix: build error on macOS #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions FollowUI/Sources/FollowUI/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ struct swift_followApp: App {
WindowGroup {
LandingView()
}
.windowStyle(.hiddenTitleBar)
}
}
2 changes: 2 additions & 0 deletions FollowUI/Sources/FollowUI/EntryDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions FollowUI/Sources/FollowUI/EntryListItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 2 additions & 0 deletions FollowUI/Sources/FollowUI/EntryListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
25 changes: 25 additions & 0 deletions FollowUI/Sources/FollowUI/Extensions/ColorExtensions.swift
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions FollowUI/Sources/FollowUI/LandingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ struct LandingView: View {
} label: {
Text("No account? Demo mode >")
}
.buttonStyle(.plain)
.sheet(isPresented: $showDemoModeLoginView) {
DemoModeLoginView()
.environmentObject(authHandler)
Expand All @@ -255,6 +256,7 @@ struct LandingView: View {
.foregroundColor(.white)
.cornerRadius(8)
}
.buttonStyle(.plain)
Button(action: {
authHandler.startAuthentication("google")
}) {
Expand All @@ -271,6 +273,7 @@ struct LandingView: View {
.foregroundColor(.white)
.cornerRadius(8)
}
.buttonStyle(.plain)
}
.offset(y: buttonsOffset)
.opacity(buttonsOpacity)
Expand Down
7 changes: 4 additions & 3 deletions FollowUI/Sources/FollowUI/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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()
Expand All @@ -156,6 +156,7 @@ struct ProfileView: View {
.background(Color(red: 59 / 255, green: 130 / 255, blue: 246 / 255))
.cornerRadius(8)
}
.buttonStyle(.plain)
}
.padding()
}
Expand Down