mirror of
https://github.com/vercel/commerce.git
synced 2025-05-16 14:36:59 +00:00
Finish migration
This commit is contained in:
parent
e5ebf60e83
commit
ef8bb5914e
@ -10,6 +10,7 @@ import {
|
||||
SelectedOptions,
|
||||
} from '../helpers'
|
||||
import { Box, Stack, Text as ChakraText } from '@chakra-ui/react'
|
||||
import { Metafield } from '@commerce/types/common'
|
||||
|
||||
import productDetailsMetafields from '../../../static_data/productDetailsMetafields.json'
|
||||
|
||||
@ -43,8 +44,6 @@ const ProductSidebar: FC<ProductSidebarProps> = ({ product, className }) => {
|
||||
}
|
||||
}
|
||||
|
||||
console.log(product.metafields!.custom)
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
<ProductOptions
|
||||
@ -57,7 +56,7 @@ const ProductSidebar: FC<ProductSidebarProps> = ({ product, className }) => {
|
||||
|
||||
<Box>
|
||||
<Stack>
|
||||
{productDetailsMetafields.metafields[0].names.map((meta) => (
|
||||
{productDetailsMetafields.metafields[0].names.map((meta: any) => (
|
||||
<Box key={meta.key}>
|
||||
<ChakraText
|
||||
as={'span'}
|
||||
@ -67,9 +66,7 @@ const ProductSidebar: FC<ProductSidebarProps> = ({ product, className }) => {
|
||||
{meta.name}:{' '}
|
||||
</ChakraText>
|
||||
<ChakraText as={'span'}>
|
||||
{product.metafields.custom
|
||||
.filter((o) => o.key == meta.key)
|
||||
.map((o) => o.value)}
|
||||
{product.metafields!.custom[meta.key as keyof Metafield].value}
|
||||
</ChakraText>
|
||||
</Box>
|
||||
))}
|
||||
|
@ -31,8 +31,6 @@ export async function getStaticProps({
|
||||
const pagesPromise = commerce.getAllPages({ config, preview })
|
||||
const siteInfoPromise = commerce.getSiteInfo({ config, preview })
|
||||
|
||||
console.log(withMetafields)
|
||||
|
||||
const productPromise = commerce.getProduct({
|
||||
variables: {
|
||||
slug: params!.slug,
|
||||
@ -52,8 +50,6 @@ export async function getStaticProps({
|
||||
const { product } = await productPromise
|
||||
const { products: relatedProducts } = await allProductsPromise
|
||||
|
||||
console.log(product)
|
||||
|
||||
if (!product) {
|
||||
return {
|
||||
notFound: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user