Use border instead of shadow for validation results (#540)
This commit is contained in:
parent
187bda7ef4
commit
367e759f50
|
@ -168,22 +168,27 @@ struct MastodonRegisterView: View {
|
|||
|
||||
func body(content: Content) -> some View {
|
||||
ZStack {
|
||||
let shadowColor: Color = {
|
||||
let borderColor: Color = {
|
||||
switch validateState {
|
||||
case .empty: return .black.opacity(0.125)
|
||||
case .invalid: return Color(Asset.Colors.TextField.invalid.color)
|
||||
case .valid: return Color(Asset.Colors.TextField.valid.color)
|
||||
case .empty: return Color(Asset.Scene.Onboarding.textFieldBackground.color)
|
||||
case .invalid: return Color(Asset.Colors.TextField.invalid.color)
|
||||
case .valid: return Color(Asset.Scene.Onboarding.textFieldBackground.color)
|
||||
}
|
||||
}()
|
||||
//TODO: @zeitschlag Replace shadow with border
|
||||
|
||||
Color(Asset.Scene.Onboarding.textFieldBackground.color)
|
||||
.cornerRadius(10)
|
||||
.shadow(color: shadowColor, radius: 1, x: 0, y: 2)
|
||||
.animation(.easeInOut, value: validateState)
|
||||
.shadow(color: .black.opacity(0.125), radius: 1, x: 0, y: 2)
|
||||
|
||||
content
|
||||
.padding()
|
||||
.background(Color(Asset.Scene.Onboarding.textFieldBackground.color))
|
||||
.cornerRadius(10)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.stroke(borderColor, lineWidth: 1)
|
||||
.animation(.easeInOut, value: validateState)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue