Add preview support

This commit is contained in:
世界
2023-07-20 13:15:13 +08:00
parent fdbf50d875
commit 251f441a25
14 changed files with 135 additions and 59 deletions
@@ -9,7 +9,18 @@ public struct StartStopButton: View {
public var body: some View {
viewBuilder {
if let profile = extensionProfile.wrappedValue {
if ApplicationLibrary.inPreview {
#if os(iOS)
Toggle(isOn: .constant(true)) {
Text("Enabled")
}
#elseif os(macOS)
Button(action: {}, label: {
Label("Stop", systemImage: "stop.fill")
})
#endif
} else if let profile = extensionProfile.wrappedValue {
Button0(profile)
} else {
#if os(iOS)
@@ -17,6 +28,7 @@ public struct StartStopButton: View {
Text("Enabled")
}
#elseif os(macOS)
Button(action: {}, label: {
Label("Start", systemImage: "play.fill")
})