Skip to content

Commit 7679fd1

Browse files
committed
update selected color in dark mode
1 parent 3a41e00 commit 7679fd1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

WooCommerce/Classes/POS/Presentation/Settings/PointOfSaleSettingsView.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,17 @@ extension PointOfSaleSettingsView {
9292

9393
struct PointOfSaleSettingsCard: View {
9494
@Environment(\.dynamicTypeSize) private var dynamicTypeSize
95+
@Environment(\.colorScheme) private var colorScheme
9596

9697
let item: PointOfSaleSettingsView.SidebarNavigation
9798
let isSelected: Bool
9899
let onTap: () -> Void
99100

101+
private var selectionBackgroundColor: Color {
102+
guard isSelected else { return Color.clear }
103+
return colorScheme == .dark ? Color.posPrimary : Color.posSecondary
104+
}
105+
100106
var body: some View {
101107
Button(action: onTap) {
102108
HStack(spacing: POSSpacing.medium) {
@@ -126,7 +132,7 @@ struct PointOfSaleSettingsCard: View {
126132
.accessibilityAddTraits(.isButton)
127133
.background(
128134
RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value, style: .continuous)
129-
.fill(isSelected ? Color.posSecondary : Color.clear)
135+
.fill(selectionBackgroundColor)
130136
)
131137
}
132138
}

0 commit comments

Comments
 (0)