diff --git a/account-kit/react/src/components/auth/card/add-passkey.tsx b/account-kit/react/src/components/auth/card/add-passkey.tsx index f12f555b31..7f6c171c1c 100644 --- a/account-kit/react/src/components/auth/card/add-passkey.tsx +++ b/account-kit/react/src/components/auth/card/add-passkey.tsx @@ -1,4 +1,5 @@ import { useAddPasskey } from "../../../hooks/useAddPasskey.js"; +import { useUiConfig } from "../../../hooks/useUiConfig.js"; import { AddPasskeyIllustration } from "../../../icons/illustrations/add-passkey.js"; import { PasskeyShieldIllustration, @@ -8,7 +9,6 @@ import { ls } from "../../../strings.js"; import { Button } from "../../button.js"; import { PoweredBy } from "../../poweredby.js"; import { useAuthContext } from "../context.js"; -import type { AuthCardProps } from "./index.js"; const BENEFITS = [ { @@ -24,7 +24,8 @@ const BENEFITS = [ ]; // eslint-disable-next-line jsdoc/require-jsdoc -export const AddPasskey = ({ config }: { config: AuthCardProps }) => { +export const AddPasskey = () => { + const { illustrationStyle } = useUiConfig(); const { setAuthStep } = useAuthContext(); const { addPasskey, isAddingPasskey } = useAddPasskey({ onSuccess: () => { @@ -36,7 +37,7 @@ export const AddPasskey = ({ config }: { config: AuthCardProps }) => {
{title}
diff --git a/account-kit/react/src/components/auth/card/index.tsx b/account-kit/react/src/components/auth/card/index.tsx index 62e62c26ea..1f8f65d0ef 100644 --- a/account-kit/react/src/components/auth/card/index.tsx +++ b/account-kit/react/src/components/auth/card/index.tsx @@ -1,54 +1,53 @@ -import { - useCallback, - useLayoutEffect, - useMemo, - useRef, - type ReactNode, -} from "react"; +import { useCallback, useLayoutEffect, useMemo, useRef } from "react"; import { useSignerStatus } from "../../../hooks/useSignerStatus.js"; import { IS_SIGNUP_QP } from "../../constants.js"; import { useAuthContext } from "../context.js"; -import type { AuthIllustrationStyle, AuthType } from "../types.js"; import { Step } from "./steps.js"; import { Notification } from "../../notification.js"; import { useAuthError } from "../../../hooks/useAuthError.js"; import { Navigation } from "../../navigation.js"; import { useAuthModal } from "../../../hooks/useAuthModal.js"; import { useElementHeight } from "../../../hooks/useElementHeight.js"; +import { useUiConfig } from "../../../hooks/useUiConfig.js"; export type AuthCardProps = { - hideError?: boolean; - header?: ReactNode; - showSignInText?: boolean; - illustrationStyle?: AuthIllustrationStyle; - // Each section can contain multiple auth types which will be grouped together - // and separated by an OR divider - sections?: AuthType[][]; className?: string; - onAuthSuccess?: () => void; }; /** * React component containing an Auth view with configured auth methods + * and options based on the config passed to the AlchemyAccountProvider * - * @param props Card Props - * @param props.header optional header for the card (good place to put your app name or logo) - * @param props.showSignInText optional boolean to show the sign in text (defaults to true) - * @param props.sections array of sections, each containing an array of auth types + * @param {AuthCardProps} props Card Props + * @param {string} props.className optional class name to apply to the card * @returns a react component containing the AuthCard */ -export const AuthCard = ( - props: AuthCardProps & { showNavigation?: boolean; showClose?: boolean } -) => { - const { showClose = false, onAuthSuccess, hideError } = props; +export const AuthCard = (props: AuthCardProps) => { + return