Adding more data
@ -17,9 +17,9 @@ export default function getAllProductsOperation({
|
||||
config?: Partial<LocalConfig>
|
||||
preview?: boolean
|
||||
} = {}): Promise<{ products: Product[] | any[] }> {
|
||||
return Promise.resolve({
|
||||
return {
|
||||
products: data.products,
|
||||
})
|
||||
}
|
||||
}
|
||||
return getAllProducts
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
export type Page = any
|
||||
export type GetPageResult = { page?: Page }
|
||||
|
||||
export type PageVariables = {
|
||||
id: number
|
||||
}
|
||||
|
@ -17,9 +17,9 @@ export default function getProductOperation({
|
||||
config?: Partial<LocalConfig>
|
||||
preview?: boolean
|
||||
} = {}): Promise<Product | {} | any> {
|
||||
return Promise.resolve({
|
||||
product: data.products[0],
|
||||
})
|
||||
return {
|
||||
product: data.products.find(({ slug }) => slug === variables!.slug),
|
||||
}
|
||||
}
|
||||
|
||||
return getProduct
|
||||
|
@ -21,7 +21,20 @@ export default function getSiteInfoOperation({}: OperationContext<any>) {
|
||||
preview?: boolean
|
||||
} = {}): Promise<GetSiteInfoResult> {
|
||||
return Promise.resolve({
|
||||
categories: [],
|
||||
categories: [
|
||||
{
|
||||
id: 'new-arrivals',
|
||||
name: 'New Arrivals',
|
||||
slug: 'new-arrivals',
|
||||
path: '/new-arrivals',
|
||||
},
|
||||
{
|
||||
id: 'featured',
|
||||
name: 'Featured',
|
||||
slug: 'featured',
|
||||
path: '/featured',
|
||||
},
|
||||
],
|
||||
brands: [],
|
||||
})
|
||||
}
|
||||
|
@ -80,42 +80,54 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjA=",
|
||||
"name": "New Short Sleeve T-Shirt",
|
||||
"id": "Z2lkOi8vc2hvcGlmeS9Qcm9ksdWN0LzU0NDczMjUwMjQ0MjA=",
|
||||
"name": "Lightweight Jacket",
|
||||
"vendor": "Next.js",
|
||||
"path": "/new-short-sleeve-t-shirt",
|
||||
"slug": "new-short-sleeve-t-shirt",
|
||||
"price": { "value": 25, "currencyCode": "USD" },
|
||||
"path": "/lightweight-jacket",
|
||||
"slug": "lightweight-jacket",
|
||||
"price": { "value": 249.99, "currencyCode": "USD" },
|
||||
"descriptionHtml": "<p><span>Show off your love for Next.js and Vercel with this unique, </span><strong>limited edition</strong><span> t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! </span><strong>All proceeds will be donated to charity.</strong></p>",
|
||||
"images": [
|
||||
{
|
||||
"url": "/assets/drop-shirt-0.png",
|
||||
"altText": "Shirt",
|
||||
"url": "/assets/lightweight-jacket-0.png",
|
||||
"altText": "Lightweight Jacket",
|
||||
"width": 1000,
|
||||
"height": 1000
|
||||
},
|
||||
{
|
||||
"url": "/assets/drop-shirt-1.png",
|
||||
"altText": "Shirt",
|
||||
"url": "/assets/lightweight-jacket-1.png",
|
||||
"altText": "Lightweight Jacket",
|
||||
"width": 1000,
|
||||
"height": 1000
|
||||
},
|
||||
{
|
||||
"url": "/assets/drop-shirt-2.png",
|
||||
"altText": "Shirt",
|
||||
"url": "/assets/lightweight-jacket-2.png",
|
||||
"altText": "Lightweight Jacket",
|
||||
"width": 1000,
|
||||
"height": 1000
|
||||
},
|
||||
{
|
||||
"url": "/assets/drop-shirt-3.png",
|
||||
"altText": "Shirt",
|
||||
"url": "/assets/lightweight-jacket-3.png",
|
||||
"altText": "Lightweight Jacket",
|
||||
"width": 1000,
|
||||
"height": 1000
|
||||
},
|
||||
{
|
||||
"url": "/assets/lightweight-jacket-4.png",
|
||||
"altText": "Lightweight Jacket",
|
||||
"width": 1000,
|
||||
"height": 1000
|
||||
},
|
||||
{
|
||||
"url": "/assets/lightweight-jacket-5.png",
|
||||
"altText": "Lightweight Jacket",
|
||||
"width": 1000,
|
||||
"height": 1000
|
||||
}
|
||||
],
|
||||
"variants": [
|
||||
{
|
||||
"id": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjAss=",
|
||||
"id": "Z2lkOid8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjAss=",
|
||||
"options": [
|
||||
{
|
||||
"__typename": "MultipleChoiceOption",
|
||||
@ -159,34 +171,46 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjA=",
|
||||
"name": "New Short Sleeve T-Shirt",
|
||||
"id": "Z2lkOis8vc2hvcGlmsddeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjA=",
|
||||
"name": "Shirt",
|
||||
"vendor": "Next.js",
|
||||
"path": "/new-short-sleeve-t-shirt",
|
||||
"slug": "new-short-sleeve-t-shirt",
|
||||
"path": "/shirt",
|
||||
"slug": "shirt",
|
||||
"price": { "value": 25, "currencyCode": "USD" },
|
||||
"descriptionHtml": "<p><span>Show off your love for Next.js and Vercel with this unique, </span><strong>limited edition</strong><span> t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! </span><strong>All proceeds will be donated to charity.</strong></p>",
|
||||
"images": [
|
||||
{
|
||||
"url": "/assets/drop-shirt-0.png",
|
||||
"url": "/assets/t-shirt-0.png",
|
||||
"altText": "Shirt",
|
||||
"width": 1000,
|
||||
"height": 1000
|
||||
},
|
||||
{
|
||||
"url": "/assets/drop-shirt-1.png",
|
||||
"url": "/assets/t-shirt-1.png",
|
||||
"altText": "Shirt",
|
||||
"width": 1000,
|
||||
"height": 1000
|
||||
},
|
||||
{
|
||||
"url": "/assets/drop-shirt-2.png",
|
||||
"url": "/assets/t-shirt-2.png",
|
||||
"altText": "Shirt",
|
||||
"width": 1000,
|
||||
"height": 1000
|
||||
},
|
||||
{
|
||||
"url": "/assets/drop-shirt-3.png",
|
||||
"url": "/assets/t-shirt-3.png",
|
||||
"altText": "Shirt",
|
||||
"width": 1000,
|
||||
"height": 1000
|
||||
},
|
||||
{
|
||||
"url": "/assets/t-shirt-4.png",
|
||||
"altText": "Shirt",
|
||||
"width": 1000,
|
||||
"height": 1000
|
||||
},
|
||||
{
|
||||
"url": "/assets/t-shirt-5.png",
|
||||
"altText": "Shirt",
|
||||
"width": 1000,
|
||||
"height": 1000
|
||||
@ -194,7 +218,7 @@
|
||||
],
|
||||
"variants": [
|
||||
{
|
||||
"id": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjAss=",
|
||||
"id": "Z2lkOi8vc2hvcGlmeS9Qcms9kdWN0LzU0NDczMjUwMjQ0MjAss=",
|
||||
"options": [
|
||||
{
|
||||
"__typename": "MultipleChoiceOption",
|
||||
|
BIN
public/assets/lightweight-jacket-0.png
Normal file
After Width: | Height: | Size: 1.8 MiB |
BIN
public/assets/lightweight-jacket-1.png
Normal file
After Width: | Height: | Size: 7.5 MiB |
BIN
public/assets/lightweight-jacket-2.png
Normal file
After Width: | Height: | Size: 5.1 MiB |
BIN
public/assets/lightweight-jacket-3.png
Normal file
After Width: | Height: | Size: 1.6 MiB |
BIN
public/assets/lightweight-jacket-4.png
Normal file
After Width: | Height: | Size: 4.9 MiB |
BIN
public/assets/lightweight-jacket-5.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
public/assets/t-shirt-0.png
Normal file
After Width: | Height: | Size: 406 KiB |
BIN
public/assets/t-shirt-1.png
Normal file
After Width: | Height: | Size: 330 KiB |
BIN
public/assets/t-shirt-2.png
Normal file
After Width: | Height: | Size: 420 KiB |
BIN
public/assets/t-shirt-3.png
Normal file
After Width: | Height: | Size: 972 KiB |
BIN
public/assets/t-shirt-4.png
Normal file
After Width: | Height: | Size: 356 KiB |
BIN
public/assets/t-shirt-5.png
Normal file
After Width: | Height: | Size: 839 KiB |
Before Width: | Height: | Size: 754 KiB |
@ -22,14 +22,15 @@
|
||||
"@components/*": ["components/*"],
|
||||
"@commerce": ["framework/commerce"],
|
||||
"@commerce/*": ["framework/commerce/*"],
|
||||
"@framework": ["framework/shopify"],
|
||||
"@framework/*": ["framework/shopify/*"]
|
||||
"@framework": ["framework/local"],
|
||||
"@framework/*": ["framework/local/*"]
|
||||
}
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"./framework/bigcommerce",
|
||||
"./framework/shopify",
|
||||
"./framework/swell",
|
||||
"./framework/vendure",
|
||||
"./framework/saleor"
|
||||
|