Skip to content

Commit 6ac33e5

Browse files
committed
Update image placeholder design. Placeholder background color is currently the same as the card and subject to change.
1 parent afb67ef commit 6ac33e5

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

WooCommerce/Classes/POS/Presentation/Reusable Views/POSItemImageView.swift

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,32 @@ struct POSItemImageView: View {
77
let scale: CGFloat
88

99
var body: some View {
10-
if let imageSource = imageSource {
10+
if let imageSource {
1111
ProductImageThumbnail(productImageURL: URL(string: imageSource),
1212
productImageSize: imageSize,
1313
scale: scale,
14-
foregroundColor: .clear,
14+
foregroundColor: Constants.placeholderColor,
1515
cachesOriginalImage: true)
1616
} else {
1717
Rectangle()
18-
.foregroundColor(Color(.secondarySystemFill))
18+
.foregroundColor(.posSurfaceContainerLowest)
19+
.overlay {
20+
Image(systemName: "archivebox")
21+
.resizable()
22+
.frame(width: Constants.placeholderDimension, height: Constants.placeholderDimension)
23+
.foregroundColor(Constants.placeholderColor)
24+
}
1925
}
2026
}
2127
}
2228

29+
private extension POSItemImageView {
30+
enum Constants {
31+
static let placeholderDimension: CGFloat = 48
32+
static let placeholderColor: Color = .posOnDisabledContainer
33+
}
34+
}
35+
2336
#Preview("Placeholder") {
2437
POSItemImageView(imageSource: nil,
2538
imageSize: 112,

0 commit comments

Comments
 (0)