show/hide password when signing up
This commit is contained in:
parent
32506b25ae
commit
841da2d570
|
@ -18,7 +18,6 @@ class AddFeedlyViewModel: ObservableObject, OAuthAccountAuthorizationOperationDe
|
||||||
@Published var showError: Bool = false
|
@Published var showError: Bool = false
|
||||||
@Published var username: String = ""
|
@Published var username: String = ""
|
||||||
@Published var password: String = ""
|
@Published var password: String = ""
|
||||||
@Published var showPassword: Bool = false
|
|
||||||
|
|
||||||
func authenticateFeedly() {
|
func authenticateFeedly() {
|
||||||
isAuthenticating = true
|
isAuthenticating = true
|
||||||
|
|
|
@ -19,6 +19,7 @@ class AddNewsBlurViewModel: ObservableObject, AddAccountSignUp {
|
||||||
@Published var username: String = ""
|
@Published var username: String = ""
|
||||||
@Published var password: String = ""
|
@Published var password: String = ""
|
||||||
@Published var canDismiss: Bool = false
|
@Published var canDismiss: Bool = false
|
||||||
|
@Published var showPassword: Bool = false
|
||||||
|
|
||||||
func authenticateNewsBlur() {
|
func authenticateNewsBlur() {
|
||||||
isAuthenticating = true
|
isAuthenticating = true
|
||||||
|
|
|
@ -34,7 +34,32 @@ struct AddFeedWranglerAccountView: View {
|
||||||
.scaleEffect(CGSize(width: 0.5, height: 0.5))
|
.scaleEffect(CGSize(width: 0.5, height: 0.5))
|
||||||
.hidden(!model.isAuthenticating) , content: {
|
.hidden(!model.isAuthenticating) , content: {
|
||||||
TextField("me@email.com", text: $model.username)
|
TextField("me@email.com", text: $model.username)
|
||||||
SecureField("•••••••••••", text: $model.password)
|
if model.showPassword == false {
|
||||||
|
ZStack {
|
||||||
|
HStack {
|
||||||
|
SecureField("Password", text: $model.password)
|
||||||
|
Spacer()
|
||||||
|
Image(systemName: "eye.fill")
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
.onTapGesture {
|
||||||
|
model.showPassword = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ZStack {
|
||||||
|
HStack {
|
||||||
|
TextField("Password", text: $model.password)
|
||||||
|
Spacer()
|
||||||
|
Image(systemName: "eye.slash.fill")
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
.onTapGesture {
|
||||||
|
model.showPassword = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}.navigationBarItems(leading:
|
}.navigationBarItems(leading:
|
||||||
Button(action: {
|
Button(action: {
|
||||||
|
|
|
@ -32,7 +32,32 @@ struct AddNewsBlurAccountView: View {
|
||||||
.scaleEffect(CGSize(width: 0.5, height: 0.5))
|
.scaleEffect(CGSize(width: 0.5, height: 0.5))
|
||||||
.hidden(!model.isAuthenticating) , content: {
|
.hidden(!model.isAuthenticating) , content: {
|
||||||
TextField("me@email.com", text: $model.username)
|
TextField("me@email.com", text: $model.username)
|
||||||
SecureField("•••••••••••", text: $model.password)
|
if model.showPassword == false {
|
||||||
|
ZStack {
|
||||||
|
HStack {
|
||||||
|
SecureField("Password", text: $model.password)
|
||||||
|
Spacer()
|
||||||
|
Image(systemName: "eye.fill")
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
.onTapGesture {
|
||||||
|
model.showPassword = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ZStack {
|
||||||
|
HStack {
|
||||||
|
TextField("Password", text: $model.password)
|
||||||
|
Spacer()
|
||||||
|
Image(systemName: "eye.slash.fill")
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
.onTapGesture {
|
||||||
|
model.showPassword = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}.navigationBarItems(leading:
|
}.navigationBarItems(leading:
|
||||||
Button(action: {
|
Button(action: {
|
||||||
|
|
Loading…
Reference in New Issue