File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
WooCommerce/Classes/POS/Presentation/Reusable Views Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments