4
0
forked from crowetic/commerce

Fix next/link should be used with anchor as children #330 (#482)

This commit is contained in:
Vinicius Zucatti 2021-09-23 19:32:17 -03:00 committed by GitHub
parent 381cefae0e
commit c440ff06d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 19 deletions

View File

@ -85,6 +85,7 @@ const CartItem = ({
<div className="flex flex-row space-x-4 py-4"> <div className="flex flex-row space-x-4 py-4">
<div className="w-16 h-16 bg-violet relative overflow-hidden cursor-pointer z-0"> <div className="w-16 h-16 bg-violet relative overflow-hidden cursor-pointer z-0">
<Link href={`/product/${item.path}`}> <Link href={`/product/${item.path}`}>
<a>
<Image <Image
onClick={() => closeSidebarIfPresent()} onClick={() => closeSidebarIfPresent()}
className={s.productImage} className={s.productImage}
@ -94,16 +95,19 @@ const CartItem = ({
alt={item.variant.image!.altText} alt={item.variant.image!.altText}
unoptimized unoptimized
/> />
</a>
</Link> </Link>
</div> </div>
<div className="flex-1 flex flex-col text-base"> <div className="flex-1 flex flex-col text-base">
<Link href={`/product/${item.path}`}> <Link href={`/product/${item.path}`}>
<a>
<span <span
className={s.productName} className={s.productName}
onClick={() => closeSidebarIfPresent()} onClick={() => closeSidebarIfPresent()}
> >
{item.name} {item.name}
</span> </span>
</a>
</Link> </Link>
{options && options.length > 0 && ( {options && options.length > 0 && (
<div className="flex items-center pb-1"> <div className="flex items-center pb-1">

View File

@ -74,9 +74,11 @@ const CartSidebarView: FC = () => {
<> <>
<div className="px-4 sm:px-6 flex-1"> <div className="px-4 sm:px-6 flex-1">
<Link href="/cart"> <Link href="/cart">
<a>
<Text variant="sectionHeading" onClick={handleClose}> <Text variant="sectionHeading" onClick={handleClose}>
My Cart My Cart
</Text> </Text>
</a>
</Link> </Link>
<ul className={s.lineItemsList}> <ul className={s.lineItemsList}>
{data!.lineItems.map((item: any) => ( {data!.lineItems.map((item: any) => (

View File

@ -44,7 +44,9 @@ const CheckoutSidebarView: FC = () => {
> >
<div className="px-4 sm:px-6 flex-1"> <div className="px-4 sm:px-6 flex-1">
<Link href="/cart"> <Link href="/cart">
<a>
<Text variant="sectionHeading">Checkout</Text> <Text variant="sectionHeading">Checkout</Text>
</a>
</Link> </Link>
<PaymentWidget <PaymentWidget