-
Notifications
You must be signed in to change notification settings - Fork 484
refactor: UI tweaks #1255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
refactor: UI tweaks #1255
Conversation
Divider() | ||
EmailLinkView() | ||
} else if authService.authView == .phoneAuth { | ||
// TODO: - how are we rendering the phone auth View?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the nub of the problem and it is the same problem we have rendering the buttons. Core auth package doesn't know about PhoneAuthView so how can we render it?
We could:
- Use AnyView again like with rendering buttons.
- Move Phone Auth package in to Core Auth package - A couple hundred lines of code extra, not a tremendous amount.
- An alternative solution???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match behavior from old FirebaseUI, this should be a button that launches the phone auth view flow in a modal view. I think if we can we should keep it a separate package despite its small size since it's less popular than email auth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated to present a modal, I've had to follow a similar pattern to renderingButtons()
logic for the same reason discussed previously (i.e. using AnyView): dea04f6
(#1255)

|
||
public var currentModal: AuthModalContentType? | ||
|
||
public var authModalViewBuilderRegistry: [AuthModalContentType: () -> AnyView] = [:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a function anyway, why not make this @ViewBuilder
?
2c4dd76
(#1255)af59d88
(#1255)bf20f0c
(#1255)To give you context on Phone Auth, the UI was rendering directly in the AuthPickerView:

The aim was to make it Phone Auth a button so it would make AuthPickerView less cluttered and closer to previous implementation:

The problem we have now is - how do we shift the View to Phone Auth? It has to happen from within Core Auth package (AuthPickerView). See comment for further details: https://github.com/firebase/FirebaseUI-iOS/pull/1255/files#r2088761197
I guess we should bear in mind this is for alpha release at the moment.