Add current locale to commerce provider

This commit is contained in:
Luis Alvarez
2020-10-25 18:21:28 -05:00
parent 3f337737e8
commit e111d351bf
2 changed files with 13 additions and 11 deletions

View File

@@ -26,6 +26,11 @@ const ProductCard: FC<Props> = ({
priority,
}) => {
const src = p.images.edges?.[0]?.node.urlLarge!
const { price } = usePrice({
amount: p.prices?.price?.value,
baseAmount: p.prices?.retailPrice?.value,
currencyCode: p.prices?.price?.currencyCode!,
})
if (variant === 'slim') {
return (
@@ -47,12 +52,6 @@ const ProductCard: FC<Props> = ({
)
}
const { price } = usePrice({
amount: p.prices?.price?.value,
baseAmount: p.prices?.retailPrice?.value,
currencyCode: p.prices?.price?.currencyCode!,
})
return (
<Link href={`product${p.path}`}>
<a