Add iOS/iPad target with platform-adaptive UI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import SwiftUI
|
||||
struct MLBNetworkSheet: View {
|
||||
var onWatchFullScreen: () -> Void
|
||||
@Environment(GamesViewModel.self) private var viewModel
|
||||
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
private var added: Bool {
|
||||
@@ -13,17 +14,41 @@ struct MLBNetworkSheet: View {
|
||||
added || viewModel.activeStreams.count < 4
|
||||
}
|
||||
|
||||
private var usesStackedLayout: Bool {
|
||||
#if os(iOS)
|
||||
horizontalSizeClass == .compact
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
}
|
||||
|
||||
private var outerHorizontalPadding: CGFloat {
|
||||
usesStackedLayout ? 20 : 94
|
||||
}
|
||||
|
||||
private var outerVerticalPadding: CGFloat {
|
||||
usesStackedLayout ? 24 : 70
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
sheetBackground
|
||||
.ignoresSafeArea()
|
||||
|
||||
HStack(alignment: .top, spacing: 32) {
|
||||
networkOverview
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
ViewThatFits {
|
||||
HStack(alignment: .top, spacing: 32) {
|
||||
networkOverview
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
actionColumn
|
||||
.frame(width: 360, alignment: .leading)
|
||||
actionColumn
|
||||
.frame(width: 360, alignment: .leading)
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 24) {
|
||||
networkOverview
|
||||
actionColumn
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
}
|
||||
.padding(38)
|
||||
.background(
|
||||
@@ -34,8 +59,8 @@ struct MLBNetworkSheet: View {
|
||||
.strokeBorder(.white.opacity(0.08), lineWidth: 1)
|
||||
}
|
||||
)
|
||||
.padding(.horizontal, 94)
|
||||
.padding(.vertical, 70)
|
||||
.padding(.horizontal, outerHorizontalPadding)
|
||||
.padding(.vertical, outerVerticalPadding)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +234,7 @@ struct MLBNetworkSheet: View {
|
||||
.fill(fill)
|
||||
)
|
||||
}
|
||||
.buttonStyle(.card)
|
||||
.platformCardStyle()
|
||||
.disabled(disabled)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user