Skip to content

Commit 9d9c950

Browse files
committed
Add back button action for disconnected state.
1 parent e8e0f55 commit 9d9c950

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

WooCommerce/Classes/POS/Presentation/CardReaderConnection/CardReaderConnectionStatusView.swift

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,24 @@ struct CardReaderConnectionStatusView: View {
4040
case .cancellingConnection:
4141
progressIndicatingCardReaderStatus(title: Localization.pleaseWait)
4242
case .disconnected:
43-
HStack(spacing: Constants.horizontalPadding) {
44-
HStack(spacing: Constants.buttonImageAndTextSpacing) {
45-
circleIcon(with: Color.posAlert)
46-
Text(Localization.readerDisconnected)
47-
.foregroundColor(disconnectedFontColor)
43+
Button {
44+
posModel.connectCardReader()
45+
} label: {
46+
HStack(spacing: Constants.horizontalPadding) {
47+
HStack(spacing: Constants.buttonImageAndTextSpacing) {
48+
circleIcon(with: Color.posAlert)
49+
Text(Localization.readerDisconnected)
50+
.foregroundColor(disconnectedFontColor)
51+
}
4852
}
53+
.padding(.horizontal, Constants.horizontalPadding)
54+
.frame(maxHeight: .infinity)
55+
.overlay(
56+
RoundedRectangle(cornerRadius: Constants.disconnectedBorderCornerRadius)
57+
.stroke(disconnectedBorderColor, lineWidth: Constants.disconnectedBorderWidth)
58+
)
59+
.padding(Constants.disconnectedBorderInset)
4960
}
50-
.padding(.horizontal, Constants.horizontalPadding)
51-
.frame(maxHeight: .infinity)
52-
.overlay(
53-
RoundedRectangle(cornerRadius: Constants.disconnectedBorderCornerRadius)
54-
.stroke(disconnectedBorderColor, lineWidth: Constants.disconnectedBorderWidth)
55-
)
56-
.padding(Constants.disconnectedBorderInset)
5761
}
5862
}
5963
.font(Constants.font, maximumContentSizeCategory: .accessibilityLarge)

0 commit comments

Comments
 (0)