generated from deco-sites/storefront
-
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.
feat: finalizado 80% da home Desktop. falta Footer e mobile
- Loading branch information
1 parent
975b3f6
commit 027567d
Showing
13 changed files
with
532 additions
and
52 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
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,65 @@ | ||
import { SendEventOnView } from "$store/components/Analytics.tsx"; | ||
import ProductCardOdd, { | ||
Layout as cardLayout, | ||
} from "$store/components/product/ProductCardOdd.tsx"; | ||
// import Icon from "$store/components/ui/Icon.tsx"; | ||
import Header from "$store/components/ui/SectionHeader.tsx"; | ||
import { useId } from "$store/sdk/useId.ts"; | ||
// import { useOffer } from "$store/sdk/useOffer.ts"; | ||
import { usePlatform } from "$store/sdk/usePlatform.tsx"; | ||
import type { Product } from "apps/commerce/types.ts"; | ||
import type { ImageWidget } from "apps/admin/widgets.ts"; | ||
// import { mapProductToAnalyticsItem } from "apps/commerce/utils/productToAnalyticsItem.ts"; | ||
|
||
export interface Props { | ||
products: Product[] | null; | ||
title?: string; | ||
imageUrl?: ImageWidget; | ||
description?: string; | ||
layout?: { | ||
headerAlignment?: "center" | "left"; | ||
headerfontSize?: "Normal" | "Large"; | ||
}; | ||
cardLayout?: cardLayout; | ||
} | ||
|
||
function CustomOddGrid({ | ||
products, | ||
title, | ||
description, | ||
layout, | ||
cardLayout, | ||
imageUrl, | ||
}: Props) { | ||
const id = useId(); | ||
const platform = usePlatform(); | ||
|
||
if (!products || products.length === 0) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div class="w-full container"> | ||
<Header | ||
title={title || ""} | ||
description={description || ""} | ||
fontSize={"Large"} | ||
alignment={"center"} | ||
image={imageUrl} | ||
/> | ||
<div id={id} class="shelf-custom-items odd"> | ||
{products?.map((product, index) => ( | ||
<ProductCardOdd | ||
product={product} | ||
itemListName={title} | ||
layout={cardLayout} | ||
platform={platform} | ||
index={index} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default CustomOddGrid; |
Oops, something went wrong.