Skip to content

Commit b610727

Browse files
authored
[Woo POS] Update child item list empty view to account for larger a11y (#15165)
2 parents 6e32098 + c71b538 commit b610727

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

WooCommerce/Classes/POS/Presentation/CardReaderConnection/UI States/PointOfSaleItemListEmptyView.swift

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,39 @@
11
import SwiftUI
22

33
struct PointOfSaleItemListEmptyView: View {
4+
@Environment(\.dynamicTypeSize) private var dynamicTypeSize
5+
@Environment(\.floatingControlAreaSize) private var floatingControlAreaSize: CGSize
46
private let baseItem: ItemListBaseItem
57

68
init(base: ItemListBaseItem) {
79
self.baseItem = base
810
}
911

1012
var body: some View {
11-
VStack(alignment: .center, spacing: PointOfSaleItemListErrorLayout.headerSpacing) {
12-
Spacer()
13-
Image(decorative: PointOfSaleAssets.magnifierNotFound.imageName)
14-
.resizable()
15-
.aspectRatio(contentMode: .fit)
16-
.frame(width: Constants.iconSize, height: Constants.iconSize)
17-
.foregroundColor(.posOnSurfaceVariantHighest)
18-
Text(title)
19-
.foregroundStyle(Color.posOnSurfaceVariantHighest)
20-
.font(.posHeadingBold)
21-
Text(subtitle)
22-
.foregroundStyle(Color.posOnSurfaceVariantHighest)
23-
.font(.posBodyLargeRegular())
24-
.padding([.leading, .trailing])
25-
Text(hint)
26-
.foregroundStyle(Color.posOnSurfaceVariantHighest)
27-
.font(.posBodyLargeRegular())
28-
.padding([.leading, .trailing])
29-
Spacer()
13+
ScrollView {
14+
VStack(alignment: .center, spacing: PointOfSaleItemListErrorLayout.headerSpacing) {
15+
Spacer()
16+
Image(decorative: PointOfSaleAssets.magnifierNotFound.imageName)
17+
.resizable()
18+
.aspectRatio(contentMode: .fit)
19+
.frame(width: Constants.iconSize, height: Constants.iconSize)
20+
.foregroundColor(.posOnSurfaceVariantHighest)
21+
.renderedIf(!dynamicTypeSize.isAccessibilitySize)
22+
Text(title)
23+
.foregroundStyle(Color.posOnSurfaceVariantHighest)
24+
.font(. posHeadingBold)
25+
Text(subtitle)
26+
.foregroundStyle(Color.posOnSurfaceVariantHighest)
27+
.font(.posBodyLargeRegular())
28+
.padding([.leading, .trailing])
29+
Text(hint)
30+
.foregroundStyle(Color.posOnSurfaceVariantHighest)
31+
.font(.posBodyLargeRegular())
32+
.padding([.leading, .trailing])
33+
Spacer()
34+
.renderedIf(!dynamicTypeSize.isAccessibilitySize)
35+
}
36+
.padding(.bottom, floatingControlAreaSize.height)
3037
}
3138
}
3239
}

WooCommerce/Classes/POS/Presentation/Item Selector/ChildItemList.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,9 @@ private extension ChildItemList {
6969

7070
@ViewBuilder
7171
var emptyView: some View {
72-
ZStack {
73-
VStack {
74-
headerView
75-
Spacer()
76-
}
77-
72+
VStack {
73+
headerView
7874
PointOfSaleItemListEmptyView(base: .parent(parentItem))
79-
.zIndex(1)
8075
}
8176
}
8277

0 commit comments

Comments
 (0)