Skip to content

Commit

Permalink
Textfield fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sidorov-panda committed Jul 26, 2023
1 parent b846d12 commit 467bf28
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@
"repositoryURL": "https://github.com/google/promises.git",
"state": {
"branch": null,
"revision": "e70e889c0196c76d22759eb50d6a0270ca9f1d9e",
"version": "2.3.1"
"revision": "c22f76b709dc4bb6d274398259e75c191e50998a",
"version": "2.3.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import KeyAppUI
struct StrigaRegistrationTextField<TextFieldType: Identifiable & Hashable>: View {

let field: TextFieldType
let fontStyle: UIFont.Style
let placeholder: String
let isEnabled: Bool
let onSubmit: () -> Void
Expand All @@ -17,6 +18,7 @@ struct StrigaRegistrationTextField<TextFieldType: Identifiable & Hashable>: View

init(
field: TextFieldType,
fontStyle: UIFont.Style = .title2,
placeholder: String,
text: Binding<String>,
isEnabled: Bool = true,
Expand All @@ -26,6 +28,7 @@ struct StrigaRegistrationTextField<TextFieldType: Identifiable & Hashable>: View
submitLabel: SubmitLabel
) {
self.field = field
self.fontStyle = fontStyle
self.placeholder = placeholder
self._text = text
self.isEnabled = isEnabled
Expand All @@ -41,7 +44,7 @@ struct StrigaRegistrationTextField<TextFieldType: Identifiable & Hashable>: View
guard editing else { return }
focus = field
})
.font(uiFont: .font(of: .title2))
.font(uiFont: .font(of: fontStyle))
.foregroundColor(isEnabled ? Color(asset: Asset.Colors.night) : Color(asset: Asset.Colors.night).opacity(0.3))
.padding(EdgeInsets(top: 14, leading: 16, bottom: 14, trailing: 20))
.frame(height: 58)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ struct WithdrawView: View {
) {
StrigaRegistrationTextField<WithdrawViewField>(
field: .IBAN,
fontStyle: .text3,
placeholder: "",
text: $viewModel.IBAN,
showClearButton: true,
Expand All @@ -72,6 +73,7 @@ struct WithdrawView: View {
) {
StrigaRegistrationTextField<WithdrawViewField>(
field: .BIC,
fontStyle: .text3,
placeholder: "",
text: $viewModel.BIC,
showClearButton: true,
Expand All @@ -87,6 +89,7 @@ struct WithdrawView: View {
status: .valid) {
StrigaRegistrationTextField<WithdrawViewField>(
field: .receiver,
fontStyle: .text3,
placeholder: "",
text: $viewModel.receiver,
isEnabled: false,
Expand Down

0 comments on commit 467bf28

Please sign in to comment.