Skip to content

Commit 74eec0b

Browse files
committed
Add basic success view
1 parent 6f9cd77 commit 74eec0b

File tree

3 files changed

+52
-4
lines changed

3 files changed

+52
-4
lines changed

WooCommerce/Classes/POS/Presentation/Barcode Scanner Setup/PointOfSaleBarcodeScannerSetupFlow.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,12 @@ class PointOfSaleBarcodeScannerSetupFlow {
106106
)
107107
},
108108
buttonCustomization: PointOfSaleBarcodeScannerBackOnlyButtonCustomization()
109-
)
110-
// TODO: Add more steps for Star BSH-20B WOOMOB-696
109+
),
110+
PointOfSaleBarcodeScannerSetupStep(
111+
content: {
112+
PointOfSaleBarcodeScannerSetupCompleteView()
113+
})
114+
// TODO: Add optional error step and documentation step for Star BSH-20B WOOMOB-696
111115
]
112116
case .tbcScanner:
113117
return [

WooCommerce/Classes/POS/Presentation/Barcode Scanner Setup/PointOfSaleBarcodeScannerSetupStepViews.swift

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,50 @@ private extension PointOfSaleBarcodeScannerTestBarcodeView {
112112
}
113113
}
114114

115+
struct PointOfSaleBarcodeScannerSetupCompleteView: View {
116+
var body: some View {
117+
VStack(spacing: POSSpacing.xLarge) {
118+
// Temporary image until finalised assets are available
119+
successIcon
120+
.accessibilityHidden(true)
121+
122+
VStack(alignment: .center, spacing: POSSpacing.small) {
123+
Text(Localization.title)
124+
.font(.posHeadingBold)
125+
.foregroundColor(.posOnSurface)
126+
.accessibilityAddTraits(.isHeader)
127+
128+
Text(Localization.instruction)
129+
.font(.posBodyMediumRegular())
130+
.foregroundColor(.posOnSurfaceVariantHighest)
131+
.multilineTextAlignment(.center)
132+
}
133+
}
134+
}
135+
136+
@ViewBuilder private var successIcon: some View {
137+
ZStack {
138+
Circle()
139+
.frame(width: 104, height: 104)
140+
.foregroundColor(.posSuccess)
141+
Image(PointOfSaleAssets.successCheck.imageName)
142+
.renderingMode(.template)
143+
.resizable()
144+
.frame(width: 48, height: 48)
145+
.foregroundColor(.posOnSuccess)
146+
}
147+
}
148+
}
149+
150+
private extension PointOfSaleBarcodeScannerSetupCompleteView {
151+
enum Localization {
152+
//TODO: WOOMOB-792
153+
static let title = "Scanner set up!"
154+
static let instruction = "You are ready to start scanning products. \n" +
155+
"Read more about barcode and QR code scanner support."
156+
}
157+
}
158+
115159
// MARK: - Button Customizations
116160
@available(iOS 17.0, *)
117161
struct PointOfSaleBarcodeScannerWelcomeButtonCustomization: PointOfSaleBarcodeScannerButtonCustomization {

WooCommerce/Classes/POS/Presentation/CardReaderConnection/UI States/Reader Messages/PointOfSalePaymentSuccessView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ struct PointOfSalePaymentSuccessView: View {
101101
Image(PointOfSaleAssets.successCheck.imageName)
102102
.renderingMode(.template)
103103
.foregroundColor(checkmarkColor)
104-
.frame(width: 52)
104+
.frame(width: Constants.checkmarkSize)
105105
.accessibilityHidden(true)
106106
}
107107
}
@@ -116,7 +116,7 @@ private extension PointOfSalePaymentSuccessView {
116116
enum Constants {
117117
static let imageName: String = "checkmark"
118118
static let imageSize: CGSize = .init(width: 165, height: 165)
119-
static let checkmarkSize: CGFloat = 56
119+
static let checkmarkSize: CGFloat = 52
120120
static let shadowOpacity: CGFloat = 0.16
121121
static let shadowRadius: CGFloat = 16
122122
static let shadowSize: CGSize = .init(width: 0, height: 8)

0 commit comments

Comments
 (0)