Adding more data

This commit is contained in:
Bel Curcio 2021-06-14 22:28:49 -03:00
parent e0da7f4261
commit aec233bf54
20 changed files with 487 additions and 705 deletions

View File

@ -17,9 +17,9 @@ export default function getAllProductsOperation({
config?: Partial<LocalConfig> config?: Partial<LocalConfig>
preview?: boolean preview?: boolean
} = {}): Promise<{ products: Product[] | any[] }> { } = {}): Promise<{ products: Product[] | any[] }> {
return Promise.resolve({ return {
products: data.products, products: data.products,
}) }
} }
return getAllProducts return getAllProducts
} }

View File

@ -1,5 +1,6 @@
export type Page = any export type Page = any
export type GetPageResult = { page?: Page } export type GetPageResult = { page?: Page }
export type PageVariables = { export type PageVariables = {
id: number id: number
} }

View File

@ -17,9 +17,9 @@ export default function getProductOperation({
config?: Partial<LocalConfig> config?: Partial<LocalConfig>
preview?: boolean preview?: boolean
} = {}): Promise<Product | {} | any> { } = {}): Promise<Product | {} | any> {
return Promise.resolve({ return {
product: data.products[0], product: data.products.find(({ slug }) => slug === variables!.slug),
}) }
} }
return getProduct return getProduct

View File

@ -21,7 +21,20 @@ export default function getSiteInfoOperation({}: OperationContext<any>) {
preview?: boolean preview?: boolean
} = {}): Promise<GetSiteInfoResult> { } = {}): Promise<GetSiteInfoResult> {
return Promise.resolve({ 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: [], brands: [],
}) })
} }

View File

@ -80,42 +80,54 @@
] ]
}, },
{ {
"id": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjA=", "id": "Z2lkOi8vc2hvcGlmeS9Qcm9ksdWN0LzU0NDczMjUwMjQ0MjA=",
"name": "New Short Sleeve T-Shirt", "name": "Lightweight Jacket",
"vendor": "Next.js", "vendor": "Next.js",
"path": "/new-short-sleeve-t-shirt", "path": "/lightweight-jacket",
"slug": "new-short-sleeve-t-shirt", "slug": "lightweight-jacket",
"price": { "value": 25, "currencyCode": "USD" }, "price": { "value": 249.99, "currencyCode": "USD" },
"descriptionHtml": "<p><span>Show off your love for Next.js and Vercel with this unique,&nbsp;</span><strong>limited edition</strong><span>&nbsp;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!&nbsp;</span><strong>All proceeds will be donated to charity.</strong></p>", "descriptionHtml": "<p><span>Show off your love for Next.js and Vercel with this unique,&nbsp;</span><strong>limited edition</strong><span>&nbsp;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!&nbsp;</span><strong>All proceeds will be donated to charity.</strong></p>",
"images": [ "images": [
{ {
"url": "/assets/drop-shirt-0.png", "url": "/assets/lightweight-jacket-0.png",
"altText": "Shirt", "altText": "Lightweight Jacket",
"width": 1000, "width": 1000,
"height": 1000 "height": 1000
}, },
{ {
"url": "/assets/drop-shirt-1.png", "url": "/assets/lightweight-jacket-1.png",
"altText": "Shirt", "altText": "Lightweight Jacket",
"width": 1000, "width": 1000,
"height": 1000 "height": 1000
}, },
{ {
"url": "/assets/drop-shirt-2.png", "url": "/assets/lightweight-jacket-2.png",
"altText": "Shirt", "altText": "Lightweight Jacket",
"width": 1000, "width": 1000,
"height": 1000 "height": 1000
}, },
{ {
"url": "/assets/drop-shirt-3.png", "url": "/assets/lightweight-jacket-3.png",
"altText": "Shirt", "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, "width": 1000,
"height": 1000 "height": 1000
} }
], ],
"variants": [ "variants": [
{ {
"id": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjAss=", "id": "Z2lkOid8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjAss=",
"options": [ "options": [
{ {
"__typename": "MultipleChoiceOption", "__typename": "MultipleChoiceOption",
@ -159,34 +171,46 @@
] ]
}, },
{ {
"id": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjA=", "id": "Z2lkOis8vc2hvcGlmsddeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjA=",
"name": "New Short Sleeve T-Shirt", "name": "Shirt",
"vendor": "Next.js", "vendor": "Next.js",
"path": "/new-short-sleeve-t-shirt", "path": "/shirt",
"slug": "new-short-sleeve-t-shirt", "slug": "shirt",
"price": { "value": 25, "currencyCode": "USD" }, "price": { "value": 25, "currencyCode": "USD" },
"descriptionHtml": "<p><span>Show off your love for Next.js and Vercel with this unique,&nbsp;</span><strong>limited edition</strong><span>&nbsp;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!&nbsp;</span><strong>All proceeds will be donated to charity.</strong></p>", "descriptionHtml": "<p><span>Show off your love for Next.js and Vercel with this unique,&nbsp;</span><strong>limited edition</strong><span>&nbsp;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!&nbsp;</span><strong>All proceeds will be donated to charity.</strong></p>",
"images": [ "images": [
{ {
"url": "/assets/drop-shirt-0.png", "url": "/assets/t-shirt-0.png",
"altText": "Shirt", "altText": "Shirt",
"width": 1000, "width": 1000,
"height": 1000 "height": 1000
}, },
{ {
"url": "/assets/drop-shirt-1.png", "url": "/assets/t-shirt-1.png",
"altText": "Shirt", "altText": "Shirt",
"width": 1000, "width": 1000,
"height": 1000 "height": 1000
}, },
{ {
"url": "/assets/drop-shirt-2.png", "url": "/assets/t-shirt-2.png",
"altText": "Shirt", "altText": "Shirt",
"width": 1000, "width": 1000,
"height": 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", "altText": "Shirt",
"width": 1000, "width": 1000,
"height": 1000 "height": 1000
@ -194,7 +218,7 @@
], ],
"variants": [ "variants": [
{ {
"id": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjAss=", "id": "Z2lkOi8vc2hvcGlmeS9Qcms9kdWN0LzU0NDczMjUwMjQ0MjAss=",
"options": [ "options": [
{ {
"__typename": "MultipleChoiceOption", "__typename": "MultipleChoiceOption",

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
public/assets/t-shirt-0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

BIN
public/assets/t-shirt-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

BIN
public/assets/t-shirt-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 KiB

BIN
public/assets/t-shirt-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 KiB

BIN
public/assets/t-shirt-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 KiB

BIN
public/assets/t-shirt-5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 754 KiB

View File

@ -22,14 +22,15 @@
"@components/*": ["components/*"], "@components/*": ["components/*"],
"@commerce": ["framework/commerce"], "@commerce": ["framework/commerce"],
"@commerce/*": ["framework/commerce/*"], "@commerce/*": ["framework/commerce/*"],
"@framework": ["framework/shopify"], "@framework": ["framework/local"],
"@framework/*": ["framework/shopify/*"] "@framework/*": ["framework/local/*"]
} }
}, },
"include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"], "include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],
"exclude": [ "exclude": [
"node_modules", "node_modules",
"./framework/bigcommerce", "./framework/bigcommerce",
"./framework/shopify",
"./framework/swell", "./framework/swell",
"./framework/vendure", "./framework/vendure",
"./framework/saleor" "./framework/saleor"

1091
yarn.lock

File diff suppressed because it is too large Load Diff