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,7 +30,19 @@ struct SettingsFeedbinAccountView: View {
|
|||
List {
|
||||
Section(header: AccountHeaderImageView(image: AppAssets.image(for: .feedbin)!)) {
|
||||
TextField("Email", text: $settingsModel.email).textContentType(.emailAddress)
|
||||
SecureField("Password", text: $settingsModel.password)
|
||||
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 {
|
||||
|
|
Loading…
Reference in New Issue