Skip to content

Commit

Permalink
chore: add localization to product detail add to cart button
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesqquick committed Nov 8, 2024
1 parent 713dfda commit e50e227
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/vibes/soul/sections/product-detail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Price, PriceLabel } from '@/vibes/soul/primitives/price-label';
import { Rating } from '@/vibes/soul/primitives/rating';
import { ProductGallery } from '@/vibes/soul/sections/product-detail/product-gallery';
import { useTranslations } from 'next-intl';

import { ProductDetailForm, ProductDetailFormAction } from './product-detail-form';
import { Field } from './schema';
Expand All @@ -24,6 +25,8 @@ type Props<F extends Field> = {
};

export function ProductDetail<F extends Field>({ product, action, fields }: Props<F>) {
const t = useTranslations('Components.AddToCartButton');

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 +56,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={t('addToCart')}
/>
</div>
</div>
</section>
Expand Down

0 comments on commit e50e227

Please sign in to comment.