2020-07-18 11:34:04 +02:00
|
|
|
//
|
|
|
|
// InspectorPlatformModifier.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Stuart Breckenridge on 18/7/20.
|
|
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct InspectorPlatformModifier: ViewModifier {
|
|
|
|
|
|
|
|
@Environment(\.presentationMode) var presentationMode
|
|
|
|
@Binding var shouldUpdate: Bool
|
|
|
|
|
|
|
|
@ViewBuilder func body(content: Content) -> some View {
|
|
|
|
|
|
|
|
#if os(macOS)
|
2020-08-13 16:21:31 +02:00
|
|
|
content
|
2020-07-19 01:57:25 +02:00
|
|
|
.textFieldStyle(RoundedBorderTextFieldStyle())
|
|
|
|
.frame(width: 300)
|
|
|
|
.padding()
|
2020-07-18 11:34:04 +02:00
|
|
|
#else
|
|
|
|
NavigationView {
|
2020-08-13 16:21:31 +02:00
|
|
|
content
|
2020-07-19 01:57:25 +02:00
|
|
|
.listStyle(InsetGroupedListStyle())
|
|
|
|
.navigationBarTitle("Inspector", displayMode: .inline)
|
|
|
|
.navigationBarItems(
|
|
|
|
leading:
|
|
|
|
Button("Cancel", action: {
|
|
|
|
presentationMode.wrappedValue.dismiss()
|
|
|
|
}),
|
|
|
|
trailing:
|
|
|
|
Button("Done", action: {
|
|
|
|
shouldUpdate = true
|
|
|
|
})
|
|
|
|
)
|
2020-07-18 11:34:04 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|