Skip to content

Commit 1853f80

Browse files
chore: use label argument instead of label closure
1 parent a110a70 commit 1853f80

File tree

8 files changed

+26
-26
lines changed

8 files changed

+26
-26
lines changed

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/AuthPickerView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ extension AuthPickerView: View {
3838
withAnimation {
3939
switchFlow()
4040
}
41-
}) {
41+
}, label: {
4242
Text(authService.authenticationFlow == .signUp ? "Log in" : "Sign up")
4343
.fontWeight(.semibold)
4444
.foregroundColor(.blue)
45-
}
45+
})
4646
}
4747
Text(authService.errorMessage).foregroundColor(.red)
4848
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/EmailAuthView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ extension EmailAuthView: View {
8282
if authService.authenticationFlow == .login {
8383
Button(action: {
8484
authService.authView = .passwordRecovery
85-
}) {
85+
}, label: {
8686
Text("Forgotten Password?")
87-
}
87+
})
8888
}
8989

9090
if authService.authenticationFlow == .signUp {
@@ -108,7 +108,7 @@ extension EmailAuthView: View {
108108
if authService.authenticationFlow == .login { await signInWithEmailPassword() }
109109
else { await createUserWithEmailPassword() }
110110
}
111-
}) {
111+
}, label: {
112112
if authService.authenticationState != .authenticating {
113113
Text(authService.authenticationFlow == .login ? "Log in with password" : "Sign up")
114114
.padding(.vertical, 8)
@@ -119,16 +119,16 @@ extension EmailAuthView: View {
119119
.padding(.vertical, 8)
120120
.frame(maxWidth: .infinity)
121121
}
122-
}
122+
})
123123
.disabled(!isValid)
124124
.padding([.top, .bottom], 8)
125125
.frame(maxWidth: .infinity)
126126
.buttonStyle(.borderedProminent)
127127
Button(action: {
128128
authService.authView = .passwordRecovery
129-
}) {
129+
}, label: {
130130
Text("Prefer Email link sign-in?")
131-
}
131+
})
132132
}
133133
}
134134
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/EmailLinkView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ extension EmailLinkView: View {
3535
await sendEmailLink()
3636
authService.emailLink = email
3737
}
38-
}) {
38+
}, label: {
3939
Text("Send email sign-in link")
4040
.padding(.vertical, 8)
4141
.frame(maxWidth: .infinity)
42-
}
42+
})
4343
.disabled(!CommonUtils.isValidEmail(email))
4444
.padding([.top, .bottom], 8)
4545
.frame(maxWidth: .infinity)
@@ -66,11 +66,11 @@ extension EmailLinkView: View {
6666
}
6767
.navigationBarItems(leading: Button(action: {
6868
authService.authView = .authPicker
69-
}) {
69+
}, label: {
7070
Image(systemName: "chevron.left")
7171
.foregroundColor(.blue)
7272
Text("Back")
7373
.foregroundColor(.blue)
74-
})
74+
}))
7575
}
7676
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/PasswordRecoveryView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ extension PasswordRecoveryView: View {
3333
Task {
3434
await sendPasswordRecoveryEmail()
3535
}
36-
}) {
36+
}, label: {
3737
Text("Password Recovery")
3838
.padding(.vertical, 8)
3939
.frame(maxWidth: .infinity)
40-
}
40+
})
4141
.disabled(!CommonUtils.isValidEmail(email))
4242
.padding([.top, .bottom], 8)
4343
.frame(maxWidth: .infinity)
@@ -59,11 +59,11 @@ extension PasswordRecoveryView: View {
5959
}
6060
.navigationBarItems(leading: Button(action: {
6161
authService.authView = .authPicker
62-
}) {
62+
}, label: {
6363
Image(systemName: "chevron.left")
6464
.foregroundColor(.blue)
6565
Text("Back")
6666
.foregroundColor(.blue)
67-
})
67+
}))
6868
}
6969
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/VerifyEmailView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ extension VerifyEmailView: View {
1919
Task {
2020
await sendEmailVerification()
2121
}
22-
}) {
22+
}, label: {
2323
Text("Verify email address?")
2424
.padding(.vertical, 8)
2525
.frame(maxWidth: .infinity)
26-
}
26+
})
2727
.padding([.top, .bottom], 8)
2828
.frame(maxWidth: .infinity)
2929
.buttonStyle(.borderedProminent)

FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Views/SignInWithFacebookButton.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extension SignInWithFacebookButton: View {
6060
}
6161
}
6262
}
63-
}) {
63+
}, label: {
6464
HStack {
6565
Image(systemName: "f.circle.fill")
6666
.font(.title)
@@ -73,7 +73,7 @@ extension SignInWithFacebookButton: View {
7373
.frame(maxWidth: .infinity)
7474
.background(Color.blue)
7575
.cornerRadius(8)
76-
}
76+
})
7777
.alert(isPresented: $showCanceledAlert) {
7878
Alert(
7979
title: Text("Facebook login cancelled"),

FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Views/SignInWithGoogleButton.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extension SignInWithGoogleButton: View {
2020
Task {
2121
try await signInWithGoogle()
2222
}
23-
}) {
23+
}, label: {
2424
if authService.authenticationState != .authenticating {
2525
HStack {
2626
Image(systemName: "globe") // Placeholder for Google logo
@@ -46,6 +46,6 @@ extension SignInWithGoogleButton: View {
4646
.padding(.vertical, 8)
4747
.frame(maxWidth: .infinity)
4848
}
49-
}
49+
})
5050
}
5151
}

FirebaseSwiftUI/FirebasePhoneAuthSwiftUI/Sources/Views/PhoneAuthButtonView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ extension PhoneAuthButtonView: View {
3939
)
4040
}
4141
}
42-
}) {
42+
}, label: {
4343
Text("Send SMS code")
4444
.padding(.vertical, 8)
4545
.frame(maxWidth: .infinity)
46-
}
46+
})
4747
.disabled(!PhoneUtils.isValidPhoneNumber(phoneNumber))
4848
.padding([.top, .bottom], 8)
4949
.frame(maxWidth: .infinity)
@@ -69,15 +69,15 @@ extension PhoneAuthButtonView: View {
6969
}
7070
showVerificationCodeInput = false
7171
}
72-
}) {
72+
}, label: {
7373
Text("Verify phone number and sign-in")
7474
.foregroundColor(.white)
7575
.padding()
7676
.frame(maxWidth: .infinity)
7777
.background(Color.green)
7878
.cornerRadius(8)
7979
.padding(.horizontal)
80-
}
80+
})
8181
}.onOpenURL { url in
8282
authService.auth.canHandle(url)
8383
}

0 commit comments

Comments
 (0)