From d1400fe52c76872a2f3cd8263d592bd38720774f Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Thu, 4 Sep 2025 22:00:55 -0600 Subject: [PATCH] Content Container fully implemented --- app/components/ContentContainer.js | 99 +++++++++++----------- app/components/ContentThumbnailTemplate.js | 4 +- 2 files changed, 52 insertions(+), 51 deletions(-) diff --git a/app/components/ContentContainer.js b/app/components/ContentContainer.js index 40867f7..7553646 100644 --- a/app/components/ContentContainer.js +++ b/app/components/ContentContainer.js @@ -2,23 +2,15 @@ import React from "react"; -const ContentContainer = ({ post, width = "200px", variant = "vertical" }) => { +const ContentContainer = ({ post, width = "200px", size = "responsive" }) => { // Get the corresponding icon based on the same logic as background images - const getIconImage = (slug, variant) => { - const verticalIcons = [ + const getIconImage = (slug) => { + const icons = [ "/assets/Content_Thumbnail/Icon_1.svg", "/assets/Content_Thumbnail/Icon_2.svg", "/assets/Content_Thumbnail/Icon_3.svg", ]; - const horizontalIcons = [ - "/assets/Content_Thumbnail/Icon_1.svg", - "/assets/Content_Thumbnail/Icon_2.svg", - "/assets/Content_Thumbnail/Icon_3.svg", - ]; - - const icons = variant === "vertical" ? verticalIcons : horizontalIcons; - if (!slug) return icons[0]; // Use the same hash logic as background images to ensure matching @@ -30,47 +22,60 @@ const ContentContainer = ({ post, width = "200px", variant = "vertical" }) => { return icons[Math.abs(hash) % icons.length]; }; - const iconImage = getIconImage(post.slug, variant); + const iconImage = getIconImage(post.slug); + + // Choose styling based on size prop + const containerClasses = + size === "xs" + ? "relative z-20 h-full flex flex-col gap-[var(--measures-spacing-012)]" + : "relative z-20 h-full flex flex-col gap-[var(--measures-spacing-012)] sm:gap-[var(--measures-spacing-016)] md:gap-[18px] lg:gap-[var(--measures-spacing-024)]"; return ( -
- {/* Content Container - 8px gap between icon and text */} -
+
+ {/* Content Container - gap between icon and text */} +
{/* Icon */} -
+
+ {/* eslint-disable-next-line @next/next/no-img-element */} {`Icon
{/* Text Container */} -
+
{/* Title */}

{post.frontmatter.title}

{/* Description */}

{post.frontmatter.description}

@@ -78,29 +83,25 @@ const ContentContainer = ({ post, width = "200px", variant = "vertical" }) => {
{/* Metadata Container - horizontal with 8px gap */} -
+
{/* Author Name */} {post.frontmatter.author} {/* Date */} {new Date(post.frontmatter.date).toLocaleDateString("en-US", { year: "numeric", diff --git a/app/components/ContentThumbnailTemplate.js b/app/components/ContentThumbnailTemplate.js index 4ad22dd..6209ebf 100644 --- a/app/components/ContentThumbnailTemplate.js +++ b/app/components/ContentThumbnailTemplate.js @@ -71,7 +71,7 @@ const ContentThumbnailTemplate = ({
{/* Content Section - positioned within the padding constraints */} - +
); @@ -105,7 +105,7 @@ const ContentThumbnailTemplate = ({
{/* Content - positioned within the padding constraints */} - +
);