Merge pull request #2260 from rizwankce/show-password-for-feedbin-accouunt-view

Add show/hide password for feedbin account view
This commit is contained in:
Maurice Parker 2020-07-13 16:00:01 -05:00 committed by GitHub
commit 1a74701052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -41,6 +41,7 @@ class SettingsFeedbinAccountModel: ObservableObject {
}
}
@Published var showError: Bool = false
@Published var showPassword: Bool = false
init() {

View File

@ -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 {