Skip to content

Commit

Permalink
fix: handle Enter for CheckoutUserAuth component
Browse files Browse the repository at this point in the history
  • Loading branch information
masterprog-cmd committed Oct 4, 2024
1 parent 5ada264 commit 17ca9d3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/app/payment/components/checkout/CheckoutUserAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,21 @@ export const CheckoutUserAuth = ({
signUp: translate('auth.signup.login'),
};

const handleKeyDown = (e: React.KeyboardEvent) => {
if (e.key === 'Enter') {
e.preventDefault();
}
};

return (
<div className="flex flex-col space-y-8">
<p className="text-2xl font-semibold text-gray-100">
1. {translate(`checkout.authComponent.title.${authMethod}`)}
</p>
<div className="flex flex-col space-y-4 rounded-2xl border border-gray-10 bg-surface p-5">
<div
onKeyDown={handleKeyDown}
className="flex flex-col space-y-4 rounded-2xl border border-gray-10 bg-surface p-5"
>
{isUserSignedIn ? (
<div className="flex w-full items-center justify-center">
<div className="flex flex-col items-center gap-2.5">
Expand Down

0 comments on commit 17ca9d3

Please sign in to comment.