Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

James/vib 814 #1574

Open
wants to merge 2 commits into
base: vibes/soul-with-makeswift
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion core/app/[locale]/(default)/product/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export default async function Product({ params: { locale, slug }, searchParams }
setRequestLocale(locale);

const t = await getTranslations('Product');
const c = await getTranslations('Components');

const ctaLabel = c('AddToCartButton.addToCart')

const format = await getFormatter();

Expand Down Expand Up @@ -324,7 +327,7 @@ export default async function Product({ params: { locale, slug }, searchParams }

return (
<>
<ProductDetail action={addToCart} fields={formattedFields} product={formattedProduct} />
<ProductDetail action={addToCart} fields={formattedFields} product={formattedProduct} ctaLabel={ctaLabel} />

<ProductDescription
accordions={accordions}
Expand Down
11 changes: 9 additions & 2 deletions core/vibes/soul/sections/product-detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ type Props<F extends Field> = {
product: ProductDetailProduct;
action: ProductDetailFormAction<F>;
fields: F[];
ctaLabel: string;
};

export function ProductDetail<F extends Field>({ product, action, fields }: Props<F>) {
export function ProductDetail<F extends Field>({ product, action, fields, ctaLabel }: Props<F>) {

return (
<section className="@container">
<div className="mx-auto grid w-full max-w-screen-xl grid-cols-1 items-stretch gap-x-8 gap-y-10 px-4 py-10 @xl:px-6 @xl:py-14 @2xl:grid-cols-2 @4xl:px-8 @4xl:py-20 @5xl:gap-x-16">
Expand Down Expand Up @@ -53,7 +55,12 @@ export function ProductDetail<F extends Field>({ product, action, fields }: Prop
<p className="mb-6 text-contrast-500">{product.description}</p>
)}

<ProductDetailForm action={action} fields={fields} productId={product.id} />
<ProductDetailForm
action={action}
fields={fields}
productId={product.id}
ctaLabel={ctaLabel}
/>
</div>
</div>
</section>
Expand Down
Loading