diff --git a/app/components/RuleCard/RuleCard.view.tsx b/app/components/RuleCard/RuleCard.view.tsx index 2b92295..ce7689b 100644 --- a/app/components/RuleCard/RuleCard.view.tsx +++ b/app/components/RuleCard/RuleCard.view.tsx @@ -21,17 +21,21 @@ export function RuleCardView({ communityInitials, }: RuleCardViewProps) { const t = useTranslation("ruleCard"); - const ariaLabel = t("ariaLabel").replace("{title}", title); + const ariaLabel = t("ariaLabel")?.replace("{title}", title) || title; // Size-based styling const isLarge = size === "L"; - // Card dimensions - make width flexible for grid layouts, but can be overridden via className - // For standalone/preview use, add fixed width via className + // Card dimensions - fixed width for expanded states (568px for L, 398px for M per Figma) const cardPadding = isLarge ? "p-[24px]" : "p-[16px]"; const cardGap = expanded ? "gap-[16px]" : isLarge ? "gap-[10px]" : "gap-[12px]"; + const cardWidth = expanded + ? isLarge + ? "w-[568px]" + : "w-[398px]" + : ""; // Logo/Icon dimensions const logoSize = isLarge ? 103 : 56; @@ -49,12 +53,6 @@ export function RuleCardView({ ? "font-inter font-medium text-[18px] leading-[24px]" : "font-inter font-medium text-[14px] leading-[16px]"; - // Category label typography - const categoryLabelClass = "font-inter font-normal text-[14px] leading-[20px]"; - - // Pill typography - const pillTextClass = "font-inter font-medium text-[12px] leading-[14px]"; - // Render logo/icon const renderLogo = () => { if (logoUrl) { @@ -100,7 +98,7 @@ export function RuleCardView({ if (communityInitials) { return (
- + {communityInitials}
@@ -113,7 +111,7 @@ export function RuleCardView({ return (
- {/* Header Container */} -
- {/* Logo/Icon Container */} + {/* Outermost container with bottom border - taller to match Figma */} +
+ {/* Logo/Icon - fixed width/height, vertically centered, does not touch bottom */} {renderLogo() && ( -
+
{renderLogo()}
)} - {/* Title Container */} + {/* 16px spacing */} +
+ {/* Container with no padding and left border - extends full height to touch bottom */} {title && ( -
-

- {title} -

+
+ {/* Inner container for header text with padding */} +
+

+ {title} +

+
)}
@@ -173,8 +176,8 @@ export function RuleCardView({ )} {/* Footer: Description */} {description && ( -
-

+

+

{description}

@@ -184,7 +187,7 @@ export function RuleCardView({ /* Collapsed State: Description */ description && (
-

+

{description}