mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Merge branch 'master' of github.com:vercel/commerce into outgrow-reaction-commerce-provider
Signed-off-by: Loan Laux <loan@outgrow.io>
This commit is contained in:
@@ -10,7 +10,7 @@ interface Props {
|
||||
className?: string
|
||||
product: Product
|
||||
variant?: 'slim' | 'simple'
|
||||
imgProps?: Omit<ImageProps, 'src'>
|
||||
imgProps?: Omit<any, 'src'>
|
||||
}
|
||||
|
||||
const placeholderImg = '/product-img-placeholder.svg'
|
||||
|
@@ -32,10 +32,11 @@ const ProductView: FC<Props> = ({ product }) => {
|
||||
|
||||
useEffect(() => {
|
||||
// Selects the default option
|
||||
product.variants[0].options?.forEach((v) => {
|
||||
const options = product.variants[0].options || []
|
||||
options.forEach((v) => {
|
||||
setChoices((choices) => ({
|
||||
...choices,
|
||||
[v.displayName.toLowerCase()]: v.values[0].label.toLowerCase(),
|
||||
[v.displayName.toLowerCase()]: v.values[0]?.label.toLowerCase(),
|
||||
}))
|
||||
})
|
||||
}, [])
|
||||
|
Reference in New Issue
Block a user