Skip to content

Commit 6ae288c

Browse files
Merge pull request #48 from componentskit/refactor/previews
Previews Refactor
2 parents 0ffc587 + b170c61 commit 6ae288c

File tree

5 files changed

+40
-470
lines changed

5 files changed

+40
-470
lines changed

Examples/DemosApp/DemosApp/ComponentsPreview/PreviewPages/TextInputPreview.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ struct TextInputPreviewPreview: View {
4242
BodyFontPicker(selection: self.$model.font)
4343
KeyboardTypePicker(selection: self.$model.keyboardType)
4444
Picker("Max Rows", selection: self.$model.maxRows) {
45-
Text("2 Rows").tag(2)
4645
Text("3 Rows").tag(3)
46+
Text("4 Rows").tag(4)
4747
Text("No Limit").tag(Optional<Int>.none)
4848
}
4949
Picker("Min Rows", selection: self.$model.minRows) {
5050
Text("1 Row").tag(1)
5151
Text("2 Rows").tag(2)
52+
Text("3 Rows").tag(3)
5253
}
5354
Toggle("Placeholder", isOn: .init(
5455
get: {
@@ -81,7 +82,7 @@ struct TextInputPreviewPreview: View {
8182
private static var initialModel: TextInputVM {
8283
return .init {
8384
$0.placeholder = "Placeholder"
84-
$0.minRows = 1
85+
$0.minRows = 2
8586
$0.maxRows = nil
8687
}
8788
}

Examples/DemosApp/DemosApp/Core/App.swift

Lines changed: 37 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,47 @@ struct App: View {
55
var body: some View {
66
NavigationView {
77
List {
8-
Section("Components") {
9-
NavigationLinkWithTitle("Button") {
10-
ButtonPreview()
11-
}
12-
NavigationLinkWithTitle("Card") {
13-
CardPreview()
14-
}
15-
NavigationLinkWithTitle("Checkbox") {
16-
CheckboxPreview()
17-
}
18-
NavigationLinkWithTitle("Countdown") {
19-
CountdownPreview()
20-
}
21-
NavigationLinkWithTitle("Divider") {
22-
DividerPreview()
23-
}
24-
NavigationLinkWithTitle("Input Field") {
25-
InputFieldPreview()
26-
}
27-
NavigationLinkWithTitle("Loading") {
28-
LoadingPreview()
29-
}
30-
NavigationLinkWithTitle("Radio Group") {
31-
RadioGroupPreview()
32-
}
33-
NavigationLinkWithTitle("Segmented Control") {
34-
SegmentedControlPreview()
35-
}
36-
NavigationLinkWithTitle("Text Field") {
37-
TextInputPreviewPreview()
38-
}
8+
NavigationLinkWithTitle("Alert") {
9+
AlertPreview()
3910
}
40-
41-
Section("Modals") {
42-
NavigationLinkWithTitle("Alert") {
43-
AlertPreview()
44-
}
45-
NavigationLinkWithTitle("Bottom Modal") {
46-
BottomModalPreview()
47-
}
48-
NavigationLinkWithTitle("Center Modal") {
49-
CenterModalPreview()
50-
}
11+
NavigationLinkWithTitle("Button") {
12+
ButtonPreview()
5113
}
52-
53-
Section("Login Demo") {
54-
NavigationLinkWithTitle("SwiftUI") {
55-
SwiftUILogin()
56-
}
57-
NavigationLinkWithTitle("UIKit") {
58-
UIViewControllerRepresenting {
59-
UIKitLogin()
60-
}
61-
}
14+
NavigationLinkWithTitle("Card") {
15+
CardPreview()
16+
}
17+
NavigationLinkWithTitle("Checkbox") {
18+
CheckboxPreview()
19+
}
20+
NavigationLinkWithTitle("Countdown") {
21+
CountdownPreview()
22+
}
23+
NavigationLinkWithTitle("Divider") {
24+
DividerPreview()
25+
}
26+
NavigationLinkWithTitle("Input Field") {
27+
InputFieldPreview()
28+
}
29+
NavigationLinkWithTitle("Loading") {
30+
LoadingPreview()
31+
}
32+
NavigationLinkWithTitle("Modal (Bottom)") {
33+
BottomModalPreview()
34+
}
35+
NavigationLinkWithTitle("Modal (Center)") {
36+
CenterModalPreview()
37+
}
38+
NavigationLinkWithTitle("Radio Group") {
39+
RadioGroupPreview()
40+
}
41+
NavigationLinkWithTitle("Segmented Control") {
42+
SegmentedControlPreview()
43+
}
44+
NavigationLinkWithTitle("Text Input") {
45+
TextInputPreviewPreview()
6246
}
6347
}
64-
.navigationTitle("Examples")
48+
.navigationTitle("Components")
6549
.navigationBarTitleDisplayMode(.inline)
6650
}
6751
}

Examples/DemosApp/DemosApp/Demos/Login/SwiftUILogin.swift

Lines changed: 0 additions & 163 deletions
This file was deleted.

0 commit comments

Comments
 (0)