Skip to content

Commit 7353cb4

Browse files
committed
Use EmptyStateView to display 'Application Password Required'
1 parent 2d76a25 commit 7353cb4

File tree

1 file changed

+11
-29
lines changed

1 file changed

+11
-29
lines changed

Modules/Sources/WordPressUI/Components/RestApiUpgradePrompt.swift

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,18 @@ public struct RestApiUpgradePrompt: View {
1111
}
1212

1313
public var body: some View {
14-
VStack {
15-
let scrollView = ScrollView {
16-
VStack(alignment: .leading) {
17-
Text(Strings.title)
18-
.font(.largeTitle)
19-
.fontWeight(.semibold)
20-
.padding(.bottom)
21-
22-
Text(Strings.description(localizedFeatureName: localizedFeatureName))
23-
.font(.body)
24-
}.padding()
25-
}
26-
27-
if #available(iOS 16.4, *) {
28-
scrollView.scrollBounceBehavior(.basedOnSize, axes: [.vertical])
14+
EmptyStateView(
15+
label: {
16+
Text(Strings.title)
17+
},
18+
description: {
19+
Text(Strings.description(localizedFeatureName: localizedFeatureName))
20+
},
21+
actions: {
22+
Button(Strings.getStarted, action: didTapGetStarted)
23+
.buttonStyle(.borderedProminent)
2924
}
30-
31-
Spacer()
32-
VStack {
33-
Button(action: didTapGetStarted, label: {
34-
HStack {
35-
Spacer()
36-
Text(Strings.getStarted)
37-
.font(.headline)
38-
.padding(4)
39-
Spacer()
40-
}
41-
}).buttonStyle(.borderedProminent)
42-
}.padding()
43-
}
25+
)
4426
}
4527

4628
private enum Strings {

0 commit comments

Comments
 (0)