Skip to content

Commit

Permalink
feat: ProductCategories component created and ShelfWithImage refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriassuncx committed May 28, 2024
1 parent 7c635e2 commit 568469e
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 85 deletions.
61 changes: 61 additions & 0 deletions components/ui/ProductCategories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import Image from "apps/website/components/Image.tsx";
import type { HTMLWidget, ImageWidget } from "apps/admin/widgets.ts";

export interface Props {
title: HTMLWidget;
/** @format color-input */
backgroundColor?: string;
categories?: Array<
{
icon: ImageWidget;
label: string;
link: string;
description: string;
width?: number;
height?: number;
}
>;
}

export default function ProductCategories(
{ title, categories, backgroundColor }: Props,
) {
return (
<div
style={{ backgroundColor }}
class="flex items-center justify-center w-full h-full"
>
<div class="flex flex-col lg:flex-row lg:items-center justify-between container max-w-[95%] lg:max-w-[1350px] px-4 gap-6 py-6">
<div
class="leading-[18px] lg:text-[26px] lg:leading-[30px] text-nowrap"
dangerouslySetInnerHTML={{ __html: title }}
/>

<div class="flex flex-row w-full items-center lg:justify-center gap-6 overflow-x-auto lg:overflow-hidden scrollbar pb-4">
{categories?.map((
{ icon, label, link, description, width, height },
) => (
<a
href={link}
aria-label={description ?? label}
class="flex flex-col gap-3 items-center justify-center text-center w-[139px] h-full max-h-[168px] cursor-pointer"
>
<Image
src={icon}
alt={description}
width={width || 139}
height={height || 139}
loading="lazy"
class="object-cover rounded-full"
/>

<span class="text-sm leading-4 text-black-neutral truncate">
{label}
</span>
</a>
))}
</div>
</div>
</div>
);
}
170 changes: 86 additions & 84 deletions manifest.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,48 +27,49 @@ import * as $$$$$$17 from "./sections/Content/ImageSection.tsx";
import * as $$$$$$18 from "./sections/Content/Intro.tsx";
import * as $$$$$$19 from "./sections/Content/Logos.tsx";
import * as $$$$$$20 from "./sections/Content/Partners.tsx";
import * as $$$$$$21 from "./sections/Content/PurchaseBenefits.tsx";
import * as $$$$$$22 from "./sections/Content/RichText.tsx";
import * as $$$$$$23 from "./sections/Content/Table.tsx";
import * as $$$$$$24 from "./sections/Content/Testimonials.tsx";
import * as $$$$$$25 from "./sections/Content/TextWithImage.tsx";
import * as $$$$$$26 from "./sections/Footer/Footer.tsx";
import * as $$$$$$27 from "./sections/Gallery.tsx";
import * as $$$$$$28 from "./sections/Header/Header.tsx";
import * as $$$$$$29 from "./sections/Images/BannerGrid.tsx";
import * as $$$$$$30 from "./sections/Images/Carousel.tsx";
import * as $$$$$$31 from "./sections/Images/CarouselBannerWithTitle.tsx";
import * as $$$$$$32 from "./sections/Images/DoubleBanners.tsx";
import * as $$$$$$33 from "./sections/Images/ImageGallery.tsx";
import * as $$$$$$34 from "./sections/Images/ShoppableBanner.tsx";
import * as $$$$$$35 from "./sections/Images/ThirdBanners.tsx";
import * as $$$$$$36 from "./sections/Layout/Container.tsx";
import * as $$$$$$37 from "./sections/Layout/Flex.tsx";
import * as $$$$$$38 from "./sections/Layout/Grid.tsx";
import * as $$$$$$39 from "./sections/Layout/GridItem.tsx";
import * as $$$$$$40 from "./sections/Links/LinkTree.tsx";
import * as $$$$$$41 from "./sections/Links/Shortcuts.tsx";
import * as $$$$$$42 from "./sections/Miscellaneous/CampaignTimer.tsx";
import * as $$$$$$43 from "./sections/Miscellaneous/CookieConsent.tsx";
import * as $$$$$$44 from "./sections/Miscellaneous/RegionPopup.tsx";
import * as $$$$$$45 from "./sections/Miscellaneous/Slide.tsx";
import * as $$$$$$46 from "./sections/Newsletter/Newsletter.tsx";
import * as $$$$$$47 from "./sections/Product/BuyTogether.tsx";
import * as $$$$$$48 from "./sections/Product/ImageGalleryFrontBack.tsx";
import * as $$$$$$49 from "./sections/Product/ImageGallerySlider.tsx";
import * as $$$$$$50 from "./sections/Product/NotFound.tsx";
import * as $$$$$$51 from "./sections/Product/NotFoundChallenge.tsx";
import * as $$$$$$52 from "./sections/Product/ProductDescription.tsx";
import * as $$$$$$53 from "./sections/Product/ProductInfo.tsx";
import * as $$$$$$54 from "./sections/Product/ProductShelf.tsx";
import * as $$$$$$55 from "./sections/Product/ProductShelfTabbed.tsx";
import * as $$$$$$56 from "./sections/Product/SearchResult.tsx";
import * as $$$$$$57 from "./sections/Product/ShelfWithImage.tsx";
import * as $$$$$$58 from "./sections/Product/SimilarsProducts.tsx";
import * as $$$$$$59 from "./sections/Product/Wishlist.tsx";
import * as $$$$$$60 from "./sections/Social/InstagramPosts.tsx";
import * as $$$$$$61 from "./sections/Social/WhatsApp.tsx";
import * as $$$$$$62 from "./sections/Theme/Theme.tsx";
import * as $$$$$$21 from "./sections/Content/ProductCategories.tsx";
import * as $$$$$$22 from "./sections/Content/PurchaseBenefits.tsx";
import * as $$$$$$23 from "./sections/Content/RichText.tsx";
import * as $$$$$$24 from "./sections/Content/Table.tsx";
import * as $$$$$$25 from "./sections/Content/Testimonials.tsx";
import * as $$$$$$26 from "./sections/Content/TextWithImage.tsx";
import * as $$$$$$27 from "./sections/Footer/Footer.tsx";
import * as $$$$$$28 from "./sections/Gallery.tsx";
import * as $$$$$$29 from "./sections/Header/Header.tsx";
import * as $$$$$$30 from "./sections/Images/BannerGrid.tsx";
import * as $$$$$$31 from "./sections/Images/Carousel.tsx";
import * as $$$$$$32 from "./sections/Images/CarouselBannerWithTitle.tsx";
import * as $$$$$$33 from "./sections/Images/DoubleBanners.tsx";
import * as $$$$$$34 from "./sections/Images/ImageGallery.tsx";
import * as $$$$$$35 from "./sections/Images/ShoppableBanner.tsx";
import * as $$$$$$36 from "./sections/Images/ThirdBanners.tsx";
import * as $$$$$$37 from "./sections/Layout/Container.tsx";
import * as $$$$$$38 from "./sections/Layout/Flex.tsx";
import * as $$$$$$39 from "./sections/Layout/Grid.tsx";
import * as $$$$$$40 from "./sections/Layout/GridItem.tsx";
import * as $$$$$$41 from "./sections/Links/LinkTree.tsx";
import * as $$$$$$42 from "./sections/Links/Shortcuts.tsx";
import * as $$$$$$43 from "./sections/Miscellaneous/CampaignTimer.tsx";
import * as $$$$$$44 from "./sections/Miscellaneous/CookieConsent.tsx";
import * as $$$$$$45 from "./sections/Miscellaneous/RegionPopup.tsx";
import * as $$$$$$46 from "./sections/Miscellaneous/Slide.tsx";
import * as $$$$$$47 from "./sections/Newsletter/Newsletter.tsx";
import * as $$$$$$48 from "./sections/Product/BuyTogether.tsx";
import * as $$$$$$49 from "./sections/Product/ImageGalleryFrontBack.tsx";
import * as $$$$$$50 from "./sections/Product/ImageGallerySlider.tsx";
import * as $$$$$$51 from "./sections/Product/NotFound.tsx";
import * as $$$$$$52 from "./sections/Product/NotFoundChallenge.tsx";
import * as $$$$$$53 from "./sections/Product/ProductDescription.tsx";
import * as $$$$$$54 from "./sections/Product/ProductInfo.tsx";
import * as $$$$$$55 from "./sections/Product/ProductShelf.tsx";
import * as $$$$$$56 from "./sections/Product/ProductShelfTabbed.tsx";
import * as $$$$$$57 from "./sections/Product/SearchResult.tsx";
import * as $$$$$$58 from "./sections/Product/ShelfWithImage.tsx";
import * as $$$$$$59 from "./sections/Product/SimilarsProducts.tsx";
import * as $$$$$$60 from "./sections/Product/Wishlist.tsx";
import * as $$$$$$61 from "./sections/Social/InstagramPosts.tsx";
import * as $$$$$$62 from "./sections/Social/WhatsApp.tsx";
import * as $$$$$$63 from "./sections/Theme/Theme.tsx";

const manifest = {
"loaders": {
Expand Down Expand Up @@ -99,50 +100,51 @@ const manifest = {
"deco-sites/maconequiio/sections/Content/Intro.tsx": $$$$$$18,
"deco-sites/maconequiio/sections/Content/Logos.tsx": $$$$$$19,
"deco-sites/maconequiio/sections/Content/Partners.tsx": $$$$$$20,
"deco-sites/maconequiio/sections/Content/PurchaseBenefits.tsx": $$$$$$21,
"deco-sites/maconequiio/sections/Content/RichText.tsx": $$$$$$22,
"deco-sites/maconequiio/sections/Content/Table.tsx": $$$$$$23,
"deco-sites/maconequiio/sections/Content/Testimonials.tsx": $$$$$$24,
"deco-sites/maconequiio/sections/Content/TextWithImage.tsx": $$$$$$25,
"deco-sites/maconequiio/sections/Footer/Footer.tsx": $$$$$$26,
"deco-sites/maconequiio/sections/Gallery.tsx": $$$$$$27,
"deco-sites/maconequiio/sections/Header/Header.tsx": $$$$$$28,
"deco-sites/maconequiio/sections/Images/BannerGrid.tsx": $$$$$$29,
"deco-sites/maconequiio/sections/Images/Carousel.tsx": $$$$$$30,
"deco-sites/maconequiio/sections/Content/ProductCategories.tsx": $$$$$$21,
"deco-sites/maconequiio/sections/Content/PurchaseBenefits.tsx": $$$$$$22,
"deco-sites/maconequiio/sections/Content/RichText.tsx": $$$$$$23,
"deco-sites/maconequiio/sections/Content/Table.tsx": $$$$$$24,
"deco-sites/maconequiio/sections/Content/Testimonials.tsx": $$$$$$25,
"deco-sites/maconequiio/sections/Content/TextWithImage.tsx": $$$$$$26,
"deco-sites/maconequiio/sections/Footer/Footer.tsx": $$$$$$27,
"deco-sites/maconequiio/sections/Gallery.tsx": $$$$$$28,
"deco-sites/maconequiio/sections/Header/Header.tsx": $$$$$$29,
"deco-sites/maconequiio/sections/Images/BannerGrid.tsx": $$$$$$30,
"deco-sites/maconequiio/sections/Images/Carousel.tsx": $$$$$$31,
"deco-sites/maconequiio/sections/Images/CarouselBannerWithTitle.tsx":
$$$$$$31,
"deco-sites/maconequiio/sections/Images/DoubleBanners.tsx": $$$$$$32,
"deco-sites/maconequiio/sections/Images/ImageGallery.tsx": $$$$$$33,
"deco-sites/maconequiio/sections/Images/ShoppableBanner.tsx": $$$$$$34,
"deco-sites/maconequiio/sections/Images/ThirdBanners.tsx": $$$$$$35,
"deco-sites/maconequiio/sections/Layout/Container.tsx": $$$$$$36,
"deco-sites/maconequiio/sections/Layout/Flex.tsx": $$$$$$37,
"deco-sites/maconequiio/sections/Layout/Grid.tsx": $$$$$$38,
"deco-sites/maconequiio/sections/Layout/GridItem.tsx": $$$$$$39,
"deco-sites/maconequiio/sections/Links/LinkTree.tsx": $$$$$$40,
"deco-sites/maconequiio/sections/Links/Shortcuts.tsx": $$$$$$41,
"deco-sites/maconequiio/sections/Miscellaneous/CampaignTimer.tsx": $$$$$$42,
"deco-sites/maconequiio/sections/Miscellaneous/CookieConsent.tsx": $$$$$$43,
"deco-sites/maconequiio/sections/Miscellaneous/RegionPopup.tsx": $$$$$$44,
"deco-sites/maconequiio/sections/Miscellaneous/Slide.tsx": $$$$$$45,
"deco-sites/maconequiio/sections/Newsletter/Newsletter.tsx": $$$$$$46,
"deco-sites/maconequiio/sections/Product/BuyTogether.tsx": $$$$$$47,
$$$$$$32,
"deco-sites/maconequiio/sections/Images/DoubleBanners.tsx": $$$$$$33,
"deco-sites/maconequiio/sections/Images/ImageGallery.tsx": $$$$$$34,
"deco-sites/maconequiio/sections/Images/ShoppableBanner.tsx": $$$$$$35,
"deco-sites/maconequiio/sections/Images/ThirdBanners.tsx": $$$$$$36,
"deco-sites/maconequiio/sections/Layout/Container.tsx": $$$$$$37,
"deco-sites/maconequiio/sections/Layout/Flex.tsx": $$$$$$38,
"deco-sites/maconequiio/sections/Layout/Grid.tsx": $$$$$$39,
"deco-sites/maconequiio/sections/Layout/GridItem.tsx": $$$$$$40,
"deco-sites/maconequiio/sections/Links/LinkTree.tsx": $$$$$$41,
"deco-sites/maconequiio/sections/Links/Shortcuts.tsx": $$$$$$42,
"deco-sites/maconequiio/sections/Miscellaneous/CampaignTimer.tsx": $$$$$$43,
"deco-sites/maconequiio/sections/Miscellaneous/CookieConsent.tsx": $$$$$$44,
"deco-sites/maconequiio/sections/Miscellaneous/RegionPopup.tsx": $$$$$$45,
"deco-sites/maconequiio/sections/Miscellaneous/Slide.tsx": $$$$$$46,
"deco-sites/maconequiio/sections/Newsletter/Newsletter.tsx": $$$$$$47,
"deco-sites/maconequiio/sections/Product/BuyTogether.tsx": $$$$$$48,
"deco-sites/maconequiio/sections/Product/ImageGalleryFrontBack.tsx":
$$$$$$48,
"deco-sites/maconequiio/sections/Product/ImageGallerySlider.tsx": $$$$$$49,
"deco-sites/maconequiio/sections/Product/NotFound.tsx": $$$$$$50,
"deco-sites/maconequiio/sections/Product/NotFoundChallenge.tsx": $$$$$$51,
"deco-sites/maconequiio/sections/Product/ProductDescription.tsx": $$$$$$52,
"deco-sites/maconequiio/sections/Product/ProductInfo.tsx": $$$$$$53,
"deco-sites/maconequiio/sections/Product/ProductShelf.tsx": $$$$$$54,
"deco-sites/maconequiio/sections/Product/ProductShelfTabbed.tsx": $$$$$$55,
"deco-sites/maconequiio/sections/Product/SearchResult.tsx": $$$$$$56,
"deco-sites/maconequiio/sections/Product/ShelfWithImage.tsx": $$$$$$57,
"deco-sites/maconequiio/sections/Product/SimilarsProducts.tsx": $$$$$$58,
"deco-sites/maconequiio/sections/Product/Wishlist.tsx": $$$$$$59,
"deco-sites/maconequiio/sections/Social/InstagramPosts.tsx": $$$$$$60,
"deco-sites/maconequiio/sections/Social/WhatsApp.tsx": $$$$$$61,
"deco-sites/maconequiio/sections/Theme/Theme.tsx": $$$$$$62,
$$$$$$49,
"deco-sites/maconequiio/sections/Product/ImageGallerySlider.tsx": $$$$$$50,
"deco-sites/maconequiio/sections/Product/NotFound.tsx": $$$$$$51,
"deco-sites/maconequiio/sections/Product/NotFoundChallenge.tsx": $$$$$$52,
"deco-sites/maconequiio/sections/Product/ProductDescription.tsx": $$$$$$53,
"deco-sites/maconequiio/sections/Product/ProductInfo.tsx": $$$$$$54,
"deco-sites/maconequiio/sections/Product/ProductShelf.tsx": $$$$$$55,
"deco-sites/maconequiio/sections/Product/ProductShelfTabbed.tsx": $$$$$$56,
"deco-sites/maconequiio/sections/Product/SearchResult.tsx": $$$$$$57,
"deco-sites/maconequiio/sections/Product/ShelfWithImage.tsx": $$$$$$58,
"deco-sites/maconequiio/sections/Product/SimilarsProducts.tsx": $$$$$$59,
"deco-sites/maconequiio/sections/Product/Wishlist.tsx": $$$$$$60,
"deco-sites/maconequiio/sections/Social/InstagramPosts.tsx": $$$$$$61,
"deco-sites/maconequiio/sections/Social/WhatsApp.tsx": $$$$$$62,
"deco-sites/maconequiio/sections/Theme/Theme.tsx": $$$$$$63,
},
"apps": {
"deco-sites/maconequiio/apps/decohub.ts": $$$$$$$$$$$0,
Expand Down
1 change: 1 addition & 0 deletions sections/Content/ProductCategories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "$store/components/ui/ProductCategories.tsx";
6 changes: 5 additions & 1 deletion sections/Product/ShelfWithImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ export interface Props {
}

export default function ShelfWithImage({ section, image }: Props) {
if (!section) return null;

const { Component, props } = section;

return (
<div class="container">
<div class="grid md:grid-cols-2 grid-cols-1 bg-neutral-content">
<div class="md:max-w-xs mx-auto flex items-center">
<section.Component {...section.props} />
<Component {...props} />
</div>
<a href={image.href}>
<Image
Expand Down

0 comments on commit 568469e

Please sign in to comment.