mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Make image, variant, and cart updates faster with useOptimistic
(#1365)
This commit is contained in:
@@ -2,7 +2,6 @@ import { AddToCart } from 'components/cart/add-to-cart';
|
||||
import Price from 'components/price';
|
||||
import Prose from 'components/prose';
|
||||
import { Product } from 'lib/shopify/types';
|
||||
import { Suspense } from 'react';
|
||||
import { VariantSelector } from './variant-selector';
|
||||
|
||||
export function ProductDescription({ product }: { product: Product }) {
|
||||
@@ -17,20 +16,14 @@ export function ProductDescription({ product }: { product: Product }) {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Suspense fallback={null}>
|
||||
<VariantSelector options={product.options} variants={product.variants} />
|
||||
</Suspense>
|
||||
|
||||
<VariantSelector options={product.options} variants={product.variants} />
|
||||
{product.descriptionHtml ? (
|
||||
<Prose
|
||||
className="mb-6 text-sm leading-tight dark:text-white/[60%]"
|
||||
html={product.descriptionHtml}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
<Suspense fallback={null}>
|
||||
<AddToCart variants={product.variants} availableForSale={product.availableForSale} />
|
||||
</Suspense>
|
||||
<AddToCart product={product} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user