From 51546bcd685fe79da98ae3bb81e7ccc50d9187f6 Mon Sep 17 00:00:00 2001 From: kugel3 Date: Sun, 7 May 2023 23:26:15 +0200 Subject: [PATCH 1/2] Make field name red when there is an error --- Sources/Core/DesignSystem/Components/AppTextField.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Core/DesignSystem/Components/AppTextField.swift b/Sources/Core/DesignSystem/Components/AppTextField.swift index 506a40edcc..90a5a86af7 100644 --- a/Sources/Core/DesignSystem/Components/AppTextField.swift +++ b/Sources/Core/DesignSystem/Components/AppTextField.swift @@ -68,7 +68,7 @@ public struct AppTextField: View { if let primaryHeading { Text(primaryHeading) .textStyle(.body1HighImportance) - .foregroundColor(.app.gray1) + .foregroundColor(accentColor) .multilineTextAlignment(.leading) } @@ -104,7 +104,7 @@ public struct AppTextField: View { .cornerRadius(.small2) .overlay( RoundedRectangle(cornerRadius: .small2) - .stroke(borderColor, lineWidth: 1) + .stroke(accentColor, lineWidth: 1) ) .alignmentGuide(.textFieldAlignment, computeValue: { $0[VerticalAlignment.center] }) @@ -116,7 +116,7 @@ public struct AppTextField: View { } } - private var borderColor: Color { + private var accentColor: Color { switch hint?.kind { case .none: return .app.gray1 From 9d7c63ab0c10da5ee7d32b1b7235413ba0a4e892 Mon Sep 17 00:00:00 2001 From: kugel3 Date: Sun, 7 May 2023 23:26:22 +0200 Subject: [PATCH 2/2] Small simplification --- Sources/Core/DesignSystem/Components/AppTextField.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Sources/Core/DesignSystem/Components/AppTextField.swift b/Sources/Core/DesignSystem/Components/AppTextField.swift index 90a5a86af7..e9726b5f5b 100644 --- a/Sources/Core/DesignSystem/Components/AppTextField.swift +++ b/Sources/Core/DesignSystem/Components/AppTextField.swift @@ -64,7 +64,7 @@ public struct AppTextField: View { public var body: some View { HStack(alignment: .textFieldAlignment, spacing: 0) { VStack(alignment: .leading, spacing: .small2) { - HStack { + HStack(spacing: 0) { if let primaryHeading { Text(primaryHeading) .textStyle(.body1HighImportance) @@ -72,9 +72,7 @@ public struct AppTextField: View { .multilineTextAlignment(.leading) } - if primaryHeading != nil || secondaryHeading != nil { - Spacer(minLength: 0) - } + Spacer(minLength: 0) if let secondaryHeading { Text(secondaryHeading)