fix: multiple components using wrong locale for ProductCard links
- homepage page.tsx was passing productLocale (SR/EN) instead of locale (sr/en) to ProductCard - ProductShowcase default locale was "SR" instead of "sr" - ProductBenefits default locale was "SR" instead of "sr" These caused URLs like /en/SR/products/... when clicking products
This commit is contained in:
@@ -78,7 +78,7 @@ export default async function Homepage({ params }: { params: Promise<{ locale: s
|
||||
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 lg:gap-8">
|
||||
{featuredProducts.map((product, index) => (
|
||||
<ProductCard key={product.id} product={product} index={index} locale={productLocale} />
|
||||
<ProductCard key={product.id} product={product} index={index} locale={locale} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ interface ProductShowcaseProps {
|
||||
locale?: string;
|
||||
}
|
||||
|
||||
export default function ProductShowcase({ products, locale = "SR" }: ProductShowcaseProps) {
|
||||
export default function ProductShowcase({ products, locale = "sr" }: ProductShowcaseProps) {
|
||||
if (!products || products.length === 0) return null;
|
||||
|
||||
return (
|
||||
|
||||
@@ -7,7 +7,7 @@ interface ProductBenefitsProps {
|
||||
locale?: string;
|
||||
}
|
||||
|
||||
export default function ProductBenefits({ locale = "SR" }: ProductBenefitsProps) {
|
||||
export default function ProductBenefits({ locale = "sr" }: ProductBenefitsProps) {
|
||||
const t = useTranslations("ProductBenefits");
|
||||
|
||||
const benefits = [
|
||||
|
||||
Reference in New Issue
Block a user