-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: read auth card props from context, simplify UI config (#789)
- Loading branch information
Showing
24 changed files
with
240 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 4 additions & 6 deletions
10
account-kit/react/src/components/auth/card/loading/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
import { useAuthContext } from "../context.js"; | ||
import { AddPasskey } from "./add-passkey.js"; | ||
import { EoaConnectCard } from "./eoa.js"; | ||
import type { AuthCardProps } from "./index.js"; | ||
import { LoadingAuth } from "./loading/index.js"; | ||
import { MainAuthContent } from "./main.js"; | ||
import { PasskeyAdded } from "./passkey-added.js"; | ||
|
||
// eslint-disable-next-line jsdoc/require-jsdoc | ||
export const Step = (props: AuthCardProps) => { | ||
export const Step = () => { | ||
const { authStep } = useAuthContext(); | ||
|
||
switch (authStep.type) { | ||
case "email_verify": | ||
case "passkey_verify": | ||
case "email_completing": | ||
return <LoadingAuth config={props} context={authStep} />; | ||
return <LoadingAuth context={authStep} />; | ||
case "passkey_create": | ||
return <AddPasskey config={props} />; | ||
return <AddPasskey />; | ||
case "passkey_create_success": | ||
return <PasskeyAdded config={props} />; | ||
return <PasskeyAdded />; | ||
case "eoa_connect": | ||
return <EoaConnectCard authStep={authStep} />; | ||
case "complete": | ||
case "initial": | ||
default: | ||
return <MainAuthContent {...props} />; | ||
return <MainAuthContent />; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.