Skip to content

Commit e8e0f55

Browse files
committed
Update design to add a border with 8px inset for disconnected reader state.
1 parent f8ec517 commit e8e0f55

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

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

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,14 @@ struct CardReaderConnectionStatusView: View {
4646
Text(Localization.readerDisconnected)
4747
.foregroundColor(disconnectedFontColor)
4848
}
49-
50-
Button {
51-
posModel.connectCardReader()
52-
} label: {
53-
Text(Localization.connectReader)
54-
}
55-
.buttonStyle(POSFilledButtonStyle(size: .extraSmall))
5649
}
5750
.padding(.horizontal, Constants.horizontalPadding)
5851
.frame(maxHeight: .infinity)
52+
.overlay(
53+
RoundedRectangle(cornerRadius: Constants.disconnectedBorderCornerRadius)
54+
.stroke(disconnectedBorderColor, lineWidth: Constants.disconnectedBorderWidth)
55+
)
56+
.padding(Constants.disconnectedBorderInset)
5957
}
6058
}
6159
.font(Constants.font, maximumContentSizeCategory: .accessibilityLarge)
@@ -100,6 +98,15 @@ private extension CardReaderConnectionStatusView {
10098
POSFloatingControlView.secondaryFontColor
10199
}
102100
}
101+
102+
var disconnectedBorderColor: Color {
103+
switch backgroundAppearance {
104+
case .primary:
105+
.posPrimary
106+
case .secondary:
107+
POSFloatingControlView.secondaryFontColor
108+
}
109+
}
103110
}
104111

105112
@available(iOS 17.0, *)
@@ -111,6 +118,9 @@ private extension CardReaderConnectionStatusView {
111118
static let progressIndicatorLineWidth: CGFloat = 2
112119
static let font = POSFontStyle.posBodyMediumRegular()
113120
static let horizontalPadding: CGFloat = 24
121+
static let disconnectedBorderCornerRadius: CGFloat = 4
122+
static let disconnectedBorderWidth: CGFloat = 2
123+
static let disconnectedBorderInset: CGFloat = 8
114124
}
115125
}
116126

@@ -168,6 +178,8 @@ private extension CardReaderConnectionStatusView {
168178
)
169179
VStack {
170180
CardReaderConnectionStatusView()
181+
.background(Color.posSurfaceContainerLow)
182+
.frame(height: 80)
171183
.environment(posModel)
172184
}
173185
}

0 commit comments

Comments
 (0)