From 4c147780acf0c0dd355d3cbfef4e96b39a56425e Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Thu, 5 Feb 2026 10:29:58 -0700 Subject: [PATCH] Fix rule card header layout --- app/components/RuleCard/RuleCard.view.tsx | 49 ++++++++++++----------- 1 file changed, 26 insertions(+), 23 deletions(-) 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 (
+
{description}
+
{description}