@@ -30,39 +30,44 @@ extension AuthPickerView: View {
30
30
authPickerTitleView
31
31
if authService. authenticationState == . authenticated {
32
32
SignedInView ( )
33
- } else if authService. authView == . passwordRecovery {
34
- PasswordRecoveryView ( )
35
- } else if authService. authView == . emailLink {
36
- EmailLinkView ( )
37
33
} else {
38
- if authService. emailSignInEnabled {
39
- Text ( authService. authenticationFlow == . login ? authService. string
40
- . emailLoginFlowLabel : authService. string. emailSignUpFlowLabel)
41
- Divider ( )
42
- EmailAuthView ( )
43
- }
44
- VStack {
45
- authService. renderButtons ( )
46
- } . padding ( . horizontal)
47
- if authService. emailSignInEnabled {
48
- Divider ( )
49
- HStack {
50
- Text ( authService
51
- . authenticationFlow == . login ? authService. string. dontHaveAnAccountYetLabel :
52
- authService. string. alreadyHaveAnAccountLabel)
53
- Button ( action: {
54
- withAnimation {
55
- switchFlow ( )
34
+ switch authService. authView {
35
+ case . passwordRecovery:
36
+ PasswordRecoveryView ( )
37
+ case . emailLink:
38
+ EmailLinkView ( )
39
+ case . authPicker:
40
+ if authService. emailSignInEnabled {
41
+ Text ( authService. authenticationFlow == . login ? authService. string
42
+ . emailLoginFlowLabel : authService. string. emailSignUpFlowLabel)
43
+ Divider ( )
44
+ EmailAuthView ( )
45
+ }
46
+ VStack {
47
+ authService. renderButtons ( )
48
+ } . padding ( . horizontal)
49
+ if authService. emailSignInEnabled {
50
+ Divider ( )
51
+ HStack {
52
+ Text ( authService
53
+ . authenticationFlow == . login ? authService. string. dontHaveAnAccountYetLabel :
54
+ authService. string. alreadyHaveAnAccountLabel)
55
+ Button ( action: {
56
+ withAnimation {
57
+ switchFlow ( )
58
+ }
59
+ } ) {
60
+ Text ( authService. authenticationFlow == . signUp ? authService. string
61
+ . emailLoginFlowLabel : authService. string. emailSignUpFlowLabel)
62
+ . fontWeight ( . semibold)
63
+ . foregroundColor ( . blue)
56
64
}
57
- } ) {
58
- Text ( authService. authenticationFlow == . signUp ? authService. string
59
- . emailLoginFlowLabel : authService. string. emailSignUpFlowLabel)
60
- . fontWeight ( . semibold)
61
- . foregroundColor ( . blue)
62
65
}
63
66
}
64
67
PrivacyTOCsView ( displayMode: . footer)
65
68
Text ( authService. errorMessage) . foregroundColor ( . red)
69
+ default :
70
+ EmptyView ( )
66
71
}
67
72
}
68
73
}
0 commit comments