Skip to content

Commit 4e85c36

Browse files
committed
Fix Pin verification view colors
This allows light and dark mode to look better with this view.
1 parent 6f85074 commit 4e85c36

2 files changed

Lines changed: 20 additions & 6 deletions

File tree

SnapSafe/Screens/PinVerification/PINVerificationView.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ struct PINVerificationView: View {
2121
.padding(.top, 50)
2222

2323
Text("SnapSafe")
24+
.foregroundColor(.primary)
2425
.font(.largeTitle)
2526
.bold()
26-
27+
2728
Text("Enter your PIN to continue")
28-
.foregroundColor(Color(UIColor.lightText))
29+
.foregroundColor(.secondary)
2930

3031
if viewModel.shouldShowAttemptsWarning {
3132
Text(viewModel.attemptsWarningMessage)
@@ -34,12 +35,12 @@ struct PINVerificationView: View {
3435
.padding(.top, 5)
3536
}
3637

37-
SecureField("PIN", text: $viewModel.pin, prompt: Text("PIN").foregroundColor(Color(UIColor.lightText)))
38+
SecureField("PIN", text: $viewModel.pin, prompt: Text("PIN").foregroundColor(.secondary))
3839
.keyboardType(.numberPad)
3940
.textContentType(.oneTimeCode)
4041
.multilineTextAlignment(.center)
4142
.padding()
42-
.foregroundColor(Color(UIColor.lightText))
43+
.foregroundColor(.primary)
4344
.overlay(
4445
RoundedRectangle(cornerRadius: 8)
4546
.stroke(Color(UIColor.systemGray3), lineWidth: 1)

SnapSafe/Screens/SecurityOverlayView.swift

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,28 @@ struct SecurityOverlayView: View {
1717
var body: some View {
1818
ZStack {
1919
// Background for all overlay states
20-
Color.black
20+
backgroundColor
2121
.opacity(backgroundOpacity)
2222
.edgesIgnoringSafeArea(.all)
23-
23+
2424
// Content based on state
2525
overlayContent
2626
}
2727
.transition(.opacity.animation(.easeInOut(duration: 0.2)))
2828
}
29+
30+
private var backgroundColor: Color {
31+
switch state {
32+
case .normal:
33+
return Color.clear
34+
case .screenRecording, .privacyShield:
35+
// Use black for screen recording and privacy shield
36+
return Color.black
37+
case .requiresAuthentication:
38+
// Use system background for authentication (adapts to light/dark mode)
39+
return Color(UIColor.systemBackground)
40+
}
41+
}
2942

3043
@ViewBuilder
3144
private var overlayContent: some View {

0 commit comments

Comments
 (0)