Skip to content

Commit

Permalink
style: some styles modified
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriassuncx committed Jul 25, 2024
1 parent 9e7a789 commit 5517dab
Show file tree
Hide file tree
Showing 4 changed files with 271 additions and 69 deletions.
130 changes: 66 additions & 64 deletions manifest.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,38 +49,39 @@ import * as $$$$$$35 from "./sections/Images/BannerWithLinks.tsx";
import * as $$$$$$36 from "./sections/Images/Carousel.tsx";
import * as $$$$$$37 from "./sections/Images/CarouselBannerWithTitle.tsx";
import * as $$$$$$38 from "./sections/Images/DoubleBanners.tsx";
import * as $$$$$$39 from "./sections/Images/ImageGallery.tsx";
import * as $$$$$$40 from "./sections/Images/MosaicBanners.tsx";
import * as $$$$$$41 from "./sections/Images/ShoppableBanner.tsx";
import * as $$$$$$42 from "./sections/Images/ThirdBanners.tsx";
import * as $$$$$$43 from "./sections/Layout/Container.tsx";
import * as $$$$$$44 from "./sections/Layout/Flex.tsx";
import * as $$$$$$45 from "./sections/Layout/Grid.tsx";
import * as $$$$$$46 from "./sections/Layout/GridItem.tsx";
import * as $$$$$$47 from "./sections/Links/LinkTree.tsx";
import * as $$$$$$48 from "./sections/Links/Shortcuts.tsx";
import * as $$$$$$49 from "./sections/Miscellaneous/CampaignTimer.tsx";
import * as $$$$$$50 from "./sections/Miscellaneous/CookieConsent.tsx";
import * as $$$$$$51 from "./sections/Miscellaneous/RegionPopup.tsx";
import * as $$$$$$52 from "./sections/Miscellaneous/Slide.tsx";
import * as $$$$$$53 from "./sections/Newsletter/Newsletter.tsx";
import * as $$$$$$54 from "./sections/Product/BuyTogether.tsx";
import * as $$$$$$55 from "./sections/Product/ImageGalleryFrontBack.tsx";
import * as $$$$$$56 from "./sections/Product/ImageGallerySlider.tsx";
import * as $$$$$$57 from "./sections/Product/NotFound.tsx";
import * as $$$$$$58 from "./sections/Product/NotFoundChallenge.tsx";
import * as $$$$$$59 from "./sections/Product/ProductDescription.tsx";
import * as $$$$$$60 from "./sections/Product/ProductInfo.tsx";
import * as $$$$$$61 from "./sections/Product/ProductShelf.tsx";
import * as $$$$$$62 from "./sections/Product/ProductShelfTabbed.tsx";
import * as $$$$$$63 from "./sections/Product/SearchDescription.tsx";
import * as $$$$$$64 from "./sections/Product/SearchResult.tsx";
import * as $$$$$$65 from "./sections/Product/ShelfWithImage.tsx";
import * as $$$$$$66 from "./sections/Product/SimilarsProducts.tsx";
import * as $$$$$$67 from "./sections/Product/Wishlist.tsx";
import * as $$$$$$68 from "./sections/Social/InstagramPosts.tsx";
import * as $$$$$$69 from "./sections/Social/WhatsApp.tsx";
import * as $$$$$$70 from "./sections/Theme/Theme.tsx";
import * as $$$$$$39 from "./sections/Images/ImageAndTextGrid.tsx";
import * as $$$$$$40 from "./sections/Images/ImageGallery.tsx";
import * as $$$$$$41 from "./sections/Images/MosaicBanners.tsx";
import * as $$$$$$42 from "./sections/Images/ShoppableBanner.tsx";
import * as $$$$$$43 from "./sections/Images/ThirdBanners.tsx";
import * as $$$$$$44 from "./sections/Layout/Container.tsx";
import * as $$$$$$45 from "./sections/Layout/Flex.tsx";
import * as $$$$$$46 from "./sections/Layout/Grid.tsx";
import * as $$$$$$47 from "./sections/Layout/GridItem.tsx";
import * as $$$$$$48 from "./sections/Links/LinkTree.tsx";
import * as $$$$$$49 from "./sections/Links/Shortcuts.tsx";
import * as $$$$$$50 from "./sections/Miscellaneous/CampaignTimer.tsx";
import * as $$$$$$51 from "./sections/Miscellaneous/CookieConsent.tsx";
import * as $$$$$$52 from "./sections/Miscellaneous/RegionPopup.tsx";
import * as $$$$$$53 from "./sections/Miscellaneous/Slide.tsx";
import * as $$$$$$54 from "./sections/Newsletter/Newsletter.tsx";
import * as $$$$$$55 from "./sections/Product/BuyTogether.tsx";
import * as $$$$$$56 from "./sections/Product/ImageGalleryFrontBack.tsx";
import * as $$$$$$57 from "./sections/Product/ImageGallerySlider.tsx";
import * as $$$$$$58 from "./sections/Product/NotFound.tsx";
import * as $$$$$$59 from "./sections/Product/NotFoundChallenge.tsx";
import * as $$$$$$60 from "./sections/Product/ProductDescription.tsx";
import * as $$$$$$61 from "./sections/Product/ProductInfo.tsx";
import * as $$$$$$62 from "./sections/Product/ProductShelf.tsx";
import * as $$$$$$63 from "./sections/Product/ProductShelfTabbed.tsx";
import * as $$$$$$64 from "./sections/Product/SearchDescription.tsx";
import * as $$$$$$65 from "./sections/Product/SearchResult.tsx";
import * as $$$$$$66 from "./sections/Product/ShelfWithImage.tsx";
import * as $$$$$$67 from "./sections/Product/SimilarsProducts.tsx";
import * as $$$$$$68 from "./sections/Product/Wishlist.tsx";
import * as $$$$$$69 from "./sections/Social/InstagramPosts.tsx";
import * as $$$$$$70 from "./sections/Social/WhatsApp.tsx";
import * as $$$$$$71 from "./sections/Theme/Theme.tsx";

const manifest = {
"loaders": {
Expand Down Expand Up @@ -134,39 +135,40 @@ const manifest = {
"deco-sites/maconequiio/sections/Images/CarouselBannerWithTitle.tsx":
$$$$$$37,
"deco-sites/maconequiio/sections/Images/DoubleBanners.tsx": $$$$$$38,
"deco-sites/maconequiio/sections/Images/ImageGallery.tsx": $$$$$$39,
"deco-sites/maconequiio/sections/Images/MosaicBanners.tsx": $$$$$$40,
"deco-sites/maconequiio/sections/Images/ShoppableBanner.tsx": $$$$$$41,
"deco-sites/maconequiio/sections/Images/ThirdBanners.tsx": $$$$$$42,
"deco-sites/maconequiio/sections/Layout/Container.tsx": $$$$$$43,
"deco-sites/maconequiio/sections/Layout/Flex.tsx": $$$$$$44,
"deco-sites/maconequiio/sections/Layout/Grid.tsx": $$$$$$45,
"deco-sites/maconequiio/sections/Layout/GridItem.tsx": $$$$$$46,
"deco-sites/maconequiio/sections/Links/LinkTree.tsx": $$$$$$47,
"deco-sites/maconequiio/sections/Links/Shortcuts.tsx": $$$$$$48,
"deco-sites/maconequiio/sections/Miscellaneous/CampaignTimer.tsx": $$$$$$49,
"deco-sites/maconequiio/sections/Miscellaneous/CookieConsent.tsx": $$$$$$50,
"deco-sites/maconequiio/sections/Miscellaneous/RegionPopup.tsx": $$$$$$51,
"deco-sites/maconequiio/sections/Miscellaneous/Slide.tsx": $$$$$$52,
"deco-sites/maconequiio/sections/Newsletter/Newsletter.tsx": $$$$$$53,
"deco-sites/maconequiio/sections/Product/BuyTogether.tsx": $$$$$$54,
"deco-sites/maconequiio/sections/Images/ImageAndTextGrid.tsx": $$$$$$39,
"deco-sites/maconequiio/sections/Images/ImageGallery.tsx": $$$$$$40,
"deco-sites/maconequiio/sections/Images/MosaicBanners.tsx": $$$$$$41,
"deco-sites/maconequiio/sections/Images/ShoppableBanner.tsx": $$$$$$42,
"deco-sites/maconequiio/sections/Images/ThirdBanners.tsx": $$$$$$43,
"deco-sites/maconequiio/sections/Layout/Container.tsx": $$$$$$44,
"deco-sites/maconequiio/sections/Layout/Flex.tsx": $$$$$$45,
"deco-sites/maconequiio/sections/Layout/Grid.tsx": $$$$$$46,
"deco-sites/maconequiio/sections/Layout/GridItem.tsx": $$$$$$47,
"deco-sites/maconequiio/sections/Links/LinkTree.tsx": $$$$$$48,
"deco-sites/maconequiio/sections/Links/Shortcuts.tsx": $$$$$$49,
"deco-sites/maconequiio/sections/Miscellaneous/CampaignTimer.tsx": $$$$$$50,
"deco-sites/maconequiio/sections/Miscellaneous/CookieConsent.tsx": $$$$$$51,
"deco-sites/maconequiio/sections/Miscellaneous/RegionPopup.tsx": $$$$$$52,
"deco-sites/maconequiio/sections/Miscellaneous/Slide.tsx": $$$$$$53,
"deco-sites/maconequiio/sections/Newsletter/Newsletter.tsx": $$$$$$54,
"deco-sites/maconequiio/sections/Product/BuyTogether.tsx": $$$$$$55,
"deco-sites/maconequiio/sections/Product/ImageGalleryFrontBack.tsx":
$$$$$$55,
"deco-sites/maconequiio/sections/Product/ImageGallerySlider.tsx": $$$$$$56,
"deco-sites/maconequiio/sections/Product/NotFound.tsx": $$$$$$57,
"deco-sites/maconequiio/sections/Product/NotFoundChallenge.tsx": $$$$$$58,
"deco-sites/maconequiio/sections/Product/ProductDescription.tsx": $$$$$$59,
"deco-sites/maconequiio/sections/Product/ProductInfo.tsx": $$$$$$60,
"deco-sites/maconequiio/sections/Product/ProductShelf.tsx": $$$$$$61,
"deco-sites/maconequiio/sections/Product/ProductShelfTabbed.tsx": $$$$$$62,
"deco-sites/maconequiio/sections/Product/SearchDescription.tsx": $$$$$$63,
"deco-sites/maconequiio/sections/Product/SearchResult.tsx": $$$$$$64,
"deco-sites/maconequiio/sections/Product/ShelfWithImage.tsx": $$$$$$65,
"deco-sites/maconequiio/sections/Product/SimilarsProducts.tsx": $$$$$$66,
"deco-sites/maconequiio/sections/Product/Wishlist.tsx": $$$$$$67,
"deco-sites/maconequiio/sections/Social/InstagramPosts.tsx": $$$$$$68,
"deco-sites/maconequiio/sections/Social/WhatsApp.tsx": $$$$$$69,
"deco-sites/maconequiio/sections/Theme/Theme.tsx": $$$$$$70,
$$$$$$56,
"deco-sites/maconequiio/sections/Product/ImageGallerySlider.tsx": $$$$$$57,
"deco-sites/maconequiio/sections/Product/NotFound.tsx": $$$$$$58,
"deco-sites/maconequiio/sections/Product/NotFoundChallenge.tsx": $$$$$$59,
"deco-sites/maconequiio/sections/Product/ProductDescription.tsx": $$$$$$60,
"deco-sites/maconequiio/sections/Product/ProductInfo.tsx": $$$$$$61,
"deco-sites/maconequiio/sections/Product/ProductShelf.tsx": $$$$$$62,
"deco-sites/maconequiio/sections/Product/ProductShelfTabbed.tsx": $$$$$$63,
"deco-sites/maconequiio/sections/Product/SearchDescription.tsx": $$$$$$64,
"deco-sites/maconequiio/sections/Product/SearchResult.tsx": $$$$$$65,
"deco-sites/maconequiio/sections/Product/ShelfWithImage.tsx": $$$$$$66,
"deco-sites/maconequiio/sections/Product/SimilarsProducts.tsx": $$$$$$67,
"deco-sites/maconequiio/sections/Product/Wishlist.tsx": $$$$$$68,
"deco-sites/maconequiio/sections/Social/InstagramPosts.tsx": $$$$$$69,
"deco-sites/maconequiio/sections/Social/WhatsApp.tsx": $$$$$$70,
"deco-sites/maconequiio/sections/Theme/Theme.tsx": $$$$$$71,
},
"apps": {
"deco-sites/maconequiio/apps/decohub.ts": $$$$$$$$$$$0,
Expand Down
5 changes: 4 additions & 1 deletion sections/Blog/BlogPostsImproved.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ export default function BlogPosts({
{calculateReadingTime(post.content.split(" ").length)}
</div>
<div class="space-y-2 flex-1">
<h3 class="text-2xl" id={`title-${post.slug}`}>
<h3
class="text-2xl h-16 line-clamp-2"
id={`title-${post.slug}`}
>
{post.title}
</h3>
<p class="text-base">{post.excerpt}</p>
Expand Down
197 changes: 197 additions & 0 deletions sections/Images/ImageAndTextGrid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
import { Color, ImageWidget, RichText } from "apps/admin/widgets.ts";
import Image from "apps/website/components/Image.tsx";

export interface ButtonProps {
text?: string;
link?: string;
backgroundColor?: Color;
/**
* @title Tamanho em porcentagem. Ex.: 100%
* @default "100%"
*/
width?: string;
/**
* @format color
*/
textColor?: string;
target: "_blank" | "_self";
isDisabled?: boolean;
}

export interface Banner {
bannerImage: {
image: ImageWidget;
description: string;
width?: number;
height?: number;
preload?: boolean;
};
/**
* @format color
*/
backgroundColor?: string;
title: RichText;
description?: RichText;
button?: ButtonProps;
mobilePosition?:
| "flex-col"
| "flex-row"
| "flex-col-reverse"
| "flex-row-reverse";
mobileAlignment?: "items-start" | "items-center" | "items-end";
desktopPosition?:
| "flex-col"
| "flex-row"
| "flex-col-reverse"
| "flex-row-reverse";
desktopAlignment?: "items-start" | "items-center" | "items-end";
titleAppearsFirst?: boolean;
hasBorderClass?: boolean;
hasContainerClass?: boolean;
maxWidth?:
| "max-w-[50%]"
| "max-w-[60%]"
| "max-w-[70%]"
| "max-w-[80%]"
| "max-w-[90%]"
| "max-w-[95%]"
| "max-w-full";
}

export interface Props {
banners?: Banner[];
itemsPerLine: {
/** @default 2 */
mobile: 1 | 2;
/** @default 4 */
desktop: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
};
hasContainerClass?: boolean;
hasSpacement?: boolean;
}

const MOBILE_COLUMNS = {
1: "grid-cols-1",
2: "grid-cols-2",
};

const DESKTOP_COLUMNS = {
1: "lg:grid-cols-1",
2: "lg:grid-cols-2",
3: "lg:grid-cols-3",
4: "lg:grid-cols-4",
5: "lg:grid-cols-5",
6: "lg:grid-cols-6",
7: "lg:grid-cols-7",
8: "lg:grid-cols-8",
};

const DESKTOP_POSITION: Record<string, string> = {
"flex-col": "lg:flex-col",
"flex-row": "lg:flex-row",
"flex-col-reverse": "lg:flex-col-reverse",
"flex-row-reverse": "lg:flex-row-reverse",
};

const DESKTOP_ALIGNMENT: Record<string, string> = {
"items-start": "lg:items-start",
"items-center": "lg:items-center",
"items-end": "lg:items-end",
};

function ImageAndText({
backgroundColor = "#fff",
title,
description,
button,
bannerImage,
mobilePosition = "flex-row",
mobileAlignment = "items-center",
desktopPosition = "flex-row",
desktopAlignment = "items-start",
titleAppearsFirst = false,
hasBorderClass = false,
hasContainerClass = false,
maxWidth = "max-w-full",
}: Banner) {
return (
<div
style={{ backgroundColor: backgroundColor }}
class="flex justify-center w-full h-full items-center py-4 px-6"
>
<div
class={`${
hasContainerClass && "container"
} flex justify-between w-full h-full items-center gap-3 ${maxWidth} ${mobilePosition} ${mobileAlignment} ${
DESKTOP_POSITION[desktopPosition]
} ${DESKTOP_ALIGNMENT[desktopAlignment]} ${
hasBorderClass && "rounded-lg"
}`}
>
{titleAppearsFirst && (
<div class="flex flex-col gap-2.5 w-full">
<div dangerouslySetInnerHTML={{ __html: title || "" }} />

{description && (
<div dangerouslySetInnerHTML={{ __html: description }} />
)}
</div>
)}

<Image
src={bannerImage.image}
alt={bannerImage.description}
width={bannerImage.width || 350}
height={bannerImage.height || 350}
preload={bannerImage.preload || false}
loading={bannerImage.preload ? "eager" : "lazy"}
/>

<div
class={`flex flex-col ${mobileAlignment} ${
DESKTOP_ALIGNMENT[desktopAlignment]
} gap-2.5 w-full`}
>
{!titleAppearsFirst && (
<div class="flex flex-col gap-2.5 w-full">
<div dangerouslySetInnerHTML={{ __html: title || "" }} />
{description && (
<div dangerouslySetInnerHTML={{ __html: description }} />
)}
</div>
)}
{button && !button.isDisabled && (
<a
href={button.link}
target={button.target || "_self"}
style={{
color: button.textColor,
backgroundColor: button.backgroundColor,
width: button.width,
}}
class="flex items-center justify-center rounded-lg p-2"
>
{button.text}
</a>
)}
</div>
</div>
</div>
);
}

export default function ImageAndTextGrid(
{ banners, itemsPerLine, hasContainerClass, hasSpacement }: Props,
) {
const { mobile, desktop } = itemsPerLine;

return (
<div
class={`${MOBILE_COLUMNS[mobile]} ${DESKTOP_COLUMNS[desktop]} ${
hasContainerClass && "container"
} ${hasSpacement && "gap-6 py-4"} grid w-full`}
>
{banners?.map((banner) => <ImageAndText {...banner} />)}
</div>
);
}
Loading

0 comments on commit 5517dab

Please sign in to comment.