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 showError: Bool = false
|
||||||
|
@Published var showPassword: Bool = false
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,20 @@ struct SettingsFeedbinAccountView: View {
|
||||||
List {
|
List {
|
||||||
Section(header: AccountHeaderImageView(image: AppAssets.image(for: .feedbin)!)) {
|
Section(header: AccountHeaderImageView(image: AppAssets.image(for: .feedbin)!)) {
|
||||||
TextField("Email", text: $settingsModel.email).textContentType(.emailAddress)
|
TextField("Email", text: $settingsModel.email).textContentType(.emailAddress)
|
||||||
|
HStack {
|
||||||
|
if settingsModel.showPassword {
|
||||||
|
TextField("Password", text:$settingsModel.password)
|
||||||
|
}
|
||||||
|
else {
|
||||||
SecureField("Password", text: $settingsModel.password)
|
SecureField("Password", text: $settingsModel.password)
|
||||||
}
|
}
|
||||||
|
Button(action: {
|
||||||
|
settingsModel.showPassword.toggle()
|
||||||
|
}) {
|
||||||
|
Text(settingsModel.showPassword ? "Hide" : "Show")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Section(footer: errorFooter) {
|
Section(footer: errorFooter) {
|
||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
Loading…
Reference in New Issue