-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from deco-sites/karla-tec3
Karla tec3
- Loading branch information
Showing
8 changed files
with
237 additions
and
93 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"__resolveType": "site/sections/Product/ShelfWithImage.tsx", | ||
"section": { | ||
"__resolveType": "site/sections/Product/ProductShelf.tsx", | ||
"products": { | ||
"__resolveType": "vnda/loaders/productList.ts", | ||
"count": 10, | ||
"sort": "newest", | ||
"tags": [ | ||
"decoracao" | ||
], | ||
"typeTags": [], | ||
"ids": [] | ||
} | ||
}, | ||
"image": { | ||
"src": "https://deco-sites-assets.s3.sa-east-1.amazonaws.com/arena-center/48475062-46da-401d-b0c2-766697d1c636/image.png" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
.deco/blocks/Preview%20%2Fsections%2FCategoriesProdutctsShelf.tsx.json
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"__resolveType": "site/sections/CategoriesProdutctsShelf.tsx" | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import Image from "apps/website/components/Image.tsx"; | ||
import type { ImageWidget } from "apps/admin/widgets.ts"; | ||
import S from "../components/ui/Section.tsx"; | ||
import { type Section } from "@deco/deco/blocks"; | ||
import { Product } from "apps/commerce/types.ts"; | ||
import ProductSlider from "../components/product/ProductSlider.tsx"; | ||
import { mapProductToAnalyticsItem } from "apps/commerce/utils/productToAnalyticsItem.ts"; | ||
import { useOffer } from "../sdk/useOffer.ts"; | ||
import { useSendEvent } from "../sdk/useSendEvent.ts"; | ||
|
||
/** @titleby title */ | ||
export interface ProductCategoryList { | ||
products: Product[] | null; | ||
/**@Categoria */ | ||
title: string; | ||
} | ||
|
||
export interface Props { | ||
productList: ProductCategoryList[]; | ||
image: { | ||
src: ImageWidget; | ||
alt?: string; | ||
href?: string; | ||
}; | ||
title: string; | ||
} | ||
function CategoriesProductsShelf({ productList, image,title }: Props) { | ||
|
||
|
||
|
||
|
||
// const viewItemListEvent = useSendEvent({ | ||
// on: "view", | ||
// event: { | ||
// name: "view_item_list", | ||
// params: { | ||
// item_list_name: title, | ||
// items: products1.map((product, index) => | ||
// mapProductToAnalyticsItem({ | ||
// index, | ||
// product, | ||
// ...useOffer(product.offers), | ||
// }) | ||
// ), | ||
// }, | ||
// }, | ||
// }); | ||
return ( | ||
<div class="container max-w-[1440px] mx-auto mt-10 px-11"> | ||
<div> | ||
<p>{ title }</p> | ||
</div> | ||
<div class="flex"> | ||
<div class=" w-[394px] h-[498px] "> | ||
<a href={image.href} class="hidden lg:flex gap-3"> | ||
<Image | ||
src={image.src} | ||
class="w-[394px] h-[498px] object-cover" | ||
width={394} | ||
height={498} | ||
alt={image.alt} | ||
fit="cover" | ||
/> | ||
</a> | ||
</div> | ||
<div> | ||
{productList[0].products && ( | ||
<ProductSlider products={productList[0].products} /> | ||
)} | ||
|
||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
export const LoadingFallback = () => <S.Placeholder height="640px" />; | ||
export default CategoriesProductsShelf; |
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