Skip to content

Commit

Permalink
style: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
El-Fitz committed Jan 22, 2025
1 parent 813b138 commit bd41302
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import SwiftUI
import WireDesign

public final class PasswordFieldViewModel: ObservableObject {

@Published public private(set) var arePasswordRulesVisible: Bool
@Published public fileprivate(set) var isPasswordValid: Bool
@Published public fileprivate(set) var isPasswordVisible: Bool
Expand All @@ -46,6 +45,7 @@ public final class PasswordFieldViewModel: ObservableObject {

// [WPB-15571] Add accessibility strings to the mask / unmask buttons
public struct PasswordField: View {
@FocusState private var isFocused: Bool
@ObservedObject private var viewModel: PasswordFieldViewModel

private let placeholder: String
Expand All @@ -72,9 +72,11 @@ public struct PasswordField: View {
TextField(placeholder, text: $viewModel.password)
.wireTextStyle(.body1)
.textFieldStyle(RoundedBorderTextFieldStyle())
.focused($isFocused)
} else {
SecureField(placeholder, text: $viewModel.password)
.textFieldStyle(RoundedBorderTextFieldStyle())
.focused($isFocused)
}
HStack {
Spacer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import XCTest
final class PasswordFieldSnapshotTests: XCTestCase {

// MARK: - Properties

private var snapshotHelper: SnapshotHelper!

// MARK: - setUp
Expand Down Expand Up @@ -124,12 +125,12 @@ final class PasswordFieldSnapshotTests: XCTestCase {
}

@MainActor @ViewBuilder
fileprivate func view(for viewModel: PasswordFieldViewModel) -> some View {
private func view(for viewModel: PasswordFieldViewModel) -> some View {
let screenBounds = UIScreen.main.bounds
PasswordField(
viewModel: viewModel,
placeholder: L10n.Passwordtextfield.Preview.placeholder,
title: L10n.Passwordtextfield.Preview.title
)
.frame(width: screenBounds.width, height: screenBounds.height)
viewModel: viewModel,
placeholder: L10n.Passwordtextfield.Preview.placeholder,
title: L10n.Passwordtextfield.Preview.title
)
.frame(width: screenBounds.width, height: screenBounds.height)
}

0 comments on commit bd41302

Please sign in to comment.