Skip to content

Commit

Permalink
KYNearbyConnectionPeerCell.swift: Make .verticalSizeClass available f…
Browse files Browse the repository at this point in the history
…or iOS only
  • Loading branch information
Kjuly committed Dec 29, 2023
1 parent 7e5da43 commit 7c3aa8b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ struct KYNearbyConnectionPeerCell: View {
@ObservedObject var item: KYNearbyPeerModel

@EnvironmentObject var viewModel: KYNearbyConnectionViewModel
#if os(iOS)
@Environment(\.verticalSizeClass) var verticalSizeClass: UserInterfaceSizeClass?
#endif

@State var isPresentingActions: Bool = false

Expand Down Expand Up @@ -50,11 +52,15 @@ struct KYNearbyConnectionPeerCell: View {
// MARK: - Private

private func _isCompactWidth() -> Bool {
#if os(macOS)
return false
#else
if KYNearbyConnectionView.isCompactDevice {
return self.verticalSizeClass != .compact
} else {
return false
}
#endif
}

private func _statusColor() -> Color {
Expand Down

0 comments on commit 7c3aa8b

Please sign in to comment.