Add show/hide password for feedbin account view
This commit is contained in:
parent
17e1247ff0
commit
b95697bf0d
|
@ -41,6 +41,7 @@ class SettingsFeedbinAccountModel: ObservableObject {
|
|||
}
|
||||
}
|
||||
@Published var showError: Bool = false
|
||||
@Published var showPassword: Bool = false
|
||||
|
||||
init() {
|
||||
|
||||
|
|
|
@ -30,8 +30,20 @@ struct SettingsFeedbinAccountView: View {
|
|||
List {
|
||||
Section(header: AccountHeaderImageView(image: AppAssets.image(for: .feedbin)!)) {
|
||||
TextField("Email", text: $settingsModel.email).textContentType(.emailAddress)
|
||||
HStack {
|
||||
if settingsModel.showPassword {
|
||||
TextField("Password", text:$settingsModel.password)
|
||||
}
|
||||
else {
|
||||
SecureField("Password", text: $settingsModel.password)
|
||||
}
|
||||
Button(action: {
|
||||
settingsModel.showPassword.toggle()
|
||||
}) {
|
||||
Text(settingsModel.showPassword ? "Hide" : "Show")
|
||||
}
|
||||
}
|
||||
}
|
||||
Section(footer: errorFooter) {
|
||||
HStack {
|
||||
Spacer()
|
||||
|
|
Loading…
Reference in New Issue