diff --git a/Package.swift b/Package.swift index ad3e7a1..d046711 100644 --- a/Package.swift +++ b/Package.swift @@ -7,7 +7,8 @@ let package = Package( name: "Roadmap", platforms: [ .iOS(.v15), - .macOS(.v12) + .macOS(.v12), + .watchOS(.v9) ], products: [ .library(name: "Roadmap", targets: ["Roadmap"]), diff --git a/Sources/Roadmap/Extensions/ColorExtensions.swift b/Sources/Roadmap/Extensions/ColorExtensions.swift index 646019f..a26769a 100644 --- a/Sources/Roadmap/Extensions/ColorExtensions.swift +++ b/Sources/Roadmap/Extensions/ColorExtensions.swift @@ -10,7 +10,7 @@ import SwiftUI extension Color { static public var defaultCellColor : Color { - #if os(macOS) + #if os(macOS) || os(watchOS) return Color.primary.opacity(0.08) #else return Color(uiColor: .secondarySystemFill) diff --git a/Sources/Roadmap/Extensions/ViewExtensions.swift b/Sources/Roadmap/Extensions/ViewExtensions.swift index bba0737..7057a2a 100644 --- a/Sources/Roadmap/Extensions/ViewExtensions.swift +++ b/Sources/Roadmap/Extensions/ViewExtensions.swift @@ -23,11 +23,15 @@ extension View { @ViewBuilder func macOSListRowSeparatorHidden() -> some View { - if #available(macOS 13.0, *) { - self.listRowSeparator(.hidden) - } else { - self - } + #if os(macOS) + if #available(macOS 13.0, *) { + self.listRowSeparator(.hidden) + } else { + self + } + #else + self + #endif } @ViewBuilder diff --git a/Sources/Roadmap/RoadmapVoteButton.swift b/Sources/Roadmap/RoadmapVoteButton.swift index 07948b2..cfd6c93 100644 --- a/Sources/Roadmap/RoadmapVoteButton.swift +++ b/Sources/Roadmap/RoadmapVoteButton.swift @@ -110,6 +110,7 @@ struct RoadmapVoteButton: View { hasVoted = newVote } } + #if !os(watchOS) .onHover { newHover in if viewModel.canVote && !hasVoted { withAnimation(.spring(response: 0.4, dampingFraction: 0.7, blendDuration: 0)) { @@ -117,6 +118,7 @@ struct RoadmapVoteButton: View { } } } + #endif .onAppear { showNumber = viewModel.voteCount > 0 withAnimation(.spring(response: 0.45, dampingFraction: 0.4, blendDuration: 0)) {