Skip to content

Commit

Permalink
fix(app): stop propagation link on card
Browse files Browse the repository at this point in the history
  • Loading branch information
GeovannyGil committed Oct 4, 2024
1 parent bcc98b9 commit 979d201
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/app/src/components/links/card-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@ const CardLink = ({
key: link,
});

const handleClick = () => {
const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {
if (!id) return;
e.stopPropagation();
if (onClick) onClick(id);
};

const handleClickLink = (e: React.MouseEvent<HTMLAnchorElement>) => {
e.stopPropagation();
};

return (
<li className="w-full group/card border-gray-200 bg-white border rounded-xl transition-[filter] hover:drop-shadow-card-hover">
{/* biome-ignore lint/a11y/useKeyWithClickEvents: <explanation> */}
Expand Down Expand Up @@ -83,6 +88,7 @@ const CardLink = ({
<Lucide.CornerDownRight className="w-3 h-3 shrink-0 text-gray-400" />
<a
href={url}
onClick={handleClickLink}
className="truncate text-gray-500 transition-colors hover:text-gray-700 hover:underline hover:underline-offset-2"
>
{/* {url.replace(/^https?:\/\//, "")} */}
Expand Down
7 changes: 7 additions & 0 deletions apps/app/src/components/payment/checkout-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ const CheckoutForm = ({ defaultCountry }: { defaultCountry: string }) => {
setStatusPayment("success");
}

if (
result?.data?.code === CODE_STATUS_LOCAL_PAYMENT.LINK_EXPIRED ||
result?.data?.code === CODE_STATUS_LOCAL_PAYMENT.LINK_NOT_FOUND
) {
throw Error(result?.data?.code);
}

if (result?.data?.code === CODE_STATUS_LOCAL_PAYMENT.PAYMENT_ERROR) {
setStatusPayment("error");
setMessageError(
Expand Down

0 comments on commit 979d201

Please sign in to comment.