-
Notifications
You must be signed in to change notification settings - Fork 133
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
feat: add UI config defaults, better back navigation to auth UI #827
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -49,7 +49,7 @@ export const AddPasskey = () => { | |||
{BENEFITS.map(({ title, icon: Icon, description }) => ( | |||
<div key={title} className="flex gap-2"> | |||
<div className="h-5 w-5 flex items-center justify-center"> | |||
<Icon illustrationStyle={illustrationStyle ?? "flat"} /> | |||
<Icon illustrationStyle={illustrationStyle} /> |
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.
@moldy530 if you'd prefer I can move reading this from the hook into the icon components; it felt a bit weird to have icon components that read from a context to configure themselves but it could also be... not that weird, defer to you
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.
yea I was thinking about that too, but since all of the components we're building are meant to be used internally I think it's ok since it removes a good bit of boilerplate
21fa358
to
da17037
Compare
const canGoBack = useMemo(() => { | ||
return ["email_verify"].includes(authStep.type); | ||
return ["email_verify", "passkey_verify"].includes(authStep.type); | ||
}, [authStep]); | ||
|
||
const onBack = useCallback(() => { |
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.
we should also clear the QP (or at least the bundle QP)
Now that we have a
useUiConfig
hook for reading the provided UI configuration from the context, we can use it as a central place to set some configuration defaults that will be shared across the UI components. This also allows us to have fewer optional/nullable values and results in cleaner code.Additionally, this PR cleans up the "go back" implementation in the auth components.
Pull Request Checklist
yarn test
)site
folder, and guidelines for updating/adding docs can be found in the contribution guide)feat!: breaking change
)yarn lint:check
) and fix any issues? (yarn lint:write
)PR-Codex overview
This PR updates how UI configurations are handled in the Account Kit React components.
Detailed summary