-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marcos Candeia <[email protected]>
- Loading branch information
Showing
3 changed files
with
6 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"imports": { | ||
"$store/": "./", | ||
"$live/": "https://denopkg.com/deco-cx/live@1793c3980d9244aac8da841a90da40dad5b37a68/", | ||
"$live/": "https://denopkg.com/deco-cx/live@ff1f0c6e08b0d5c25f877ae40223f4e9b559fe01/", | ||
"deco-sites/std/": "https://denopkg.com/deco-sites/[email protected]/", | ||
"partytown/": "https://deno.land/x/[email protected]/", | ||
"$fresh/": "https://deno.land/x/[email protected]/", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,12 @@ import { HandlerContext } from "$fresh/src/server/types.ts"; | |
import ProductShelf, { | ||
Props as ProductShelfProps, | ||
} from "$store/components/product/ProductShelf.tsx"; | ||
import { Product } from "deco-sites/std/commerce/types.ts"; | ||
import { StateVTEX } from "deco-sites/std/commerce/vtex/types.ts"; | ||
import loader, { | ||
Props as LoaderProps, | ||
} from "deco-sites/std/functions/vtexProductList.ts"; | ||
import { LiveConfig } from "https://denopkg.com/deco-cx/[email protected]/blocks/handler.ts"; | ||
|
||
export interface Props { | ||
title: string; | ||
itemsPerPage?: number; | ||
} | ||
|
||
function ProductShelfSection(props: ProductShelfProps) { | ||
return <ProductShelf {...props} />; | ||
} | ||
|
@@ -22,11 +16,11 @@ export async function getProps( | |
request: Request, | ||
ctx: HandlerContext< | ||
unknown, | ||
LiveConfig<Props & LoaderProps, StateVTEX> | ||
LiveConfig<LoaderProps, StateVTEX> | ||
>, | ||
): Promise<ProductShelfProps> { | ||
): Promise<Pick<ProductShelfProps, "products">> { | ||
const { data: products } = await loader(request, ctx, ctx.state.$live); | ||
return { ...ctx.state.$live, products }; | ||
return { products }; | ||
} | ||
|
||
export default ProductShelfSection; |