Skip to content

Commit 017a3c9

Browse files
add previews in Playground Book View
minor changes
1 parent 46d004f commit 017a3c9

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

Diff for: Support Files/en.lproj/Localizable.strings

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"copyright" = "Copyright © 2019 The nef authors";
1212
"github" = "Read more about nef on GitHub";
1313
"install_preferences" = "Open 'System Preferences'";
14-
"install_extensions" = "Select 'Extension'";
14+
"install_extensions" = "Select 'Extensions'";
1515
"nef_extension" = "Xcode Source Editor";
1616

1717
// MARK: - Preferences

Diff for: nef/PlaygroundBook/PlaygroundBookView.swift

+23
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,26 @@ struct PlaygroundBookView: View {
4545
static let nef = Image("nef-favicon")
4646
}
4747
}
48+
49+
50+
// MARK: - previews
51+
#if DEBUG
52+
import nef
53+
import BowEffects
54+
55+
struct PlaygroundBookView_Previews: PreviewProvider {
56+
static let console = PlaygroundBookConsole()
57+
58+
static var previews: some View {
59+
console.historical = "✓ It is a preview 1\n✓ It is a preview 2"
60+
console.task = "Preview"
61+
console.details = "Preview details"
62+
console.totalSteps = 5
63+
console.currentStep = 2
64+
console.duration = .seconds(15)
65+
console.status = .running
66+
67+
return PlaygroundBookView(console: console).frame(width: 800, height: 200, alignment: .center)
68+
}
69+
}
70+
#endif

0 commit comments

Comments
 (0)