Skip to content

Commit

Permalink
fix: handle skip on connection-error
Browse files Browse the repository at this point in the history
  • Loading branch information
RobChangCA committed Nov 19, 2024
1 parent 4fcd939 commit 03c53d5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions account-kit/react/src/components/auth/card/add-passkey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const AddPasskey = () => {
icon={<PasskeyConnectionFailed />}
shouldDisconnect={false}
handleTryAgain={addPasskey}
handleSkip={() => setAuthStep({ type: "complete" })}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type ConnectionErrorProps = {
handleTryAgain?: () => void;
handleUseAnotherMethod?: () => void;
shouldDisconnect?: boolean;
handleSkip?: () => void;
};

export const ConnectionError = ({
Expand All @@ -22,6 +23,7 @@ export const ConnectionError = ({
handleTryAgain,
handleUseAnotherMethod,
shouldDisconnect = true,
handleSkip,
}: ConnectionErrorProps) => {
const { config } = useAlchemyAccountContext();

Expand Down Expand Up @@ -53,6 +55,15 @@ export const ConnectionError = ({
{ls.error.cta.useAnotherMethod}
</Button>
)}
{handleSkip && (
<Button
onClick={handleSkip}
variant={"social"}
className="border-0 bg-btn-secondary"
>
{ls.error.cta.skip}
</Button>
)}
</div>
);
};
1 change: 1 addition & 0 deletions account-kit/react/src/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const STRINGS = {
cta: {
tryAgain: "Try again",
useAnotherMethod: "Use another method",
skip: "Skip",
},
customErrorMessages: {
eoa: {
Expand Down

0 comments on commit 03c53d5

Please sign in to comment.