From 3ca728918d5390741f3ecef21b8f76408e191ad0 Mon Sep 17 00:00:00 2001 From: Marc Young Date: Tue, 7 May 2024 16:09:10 -0600 Subject: [PATCH] Adding card variant. --- src/components/paragraphs/stanford-card/card-paragraph.tsx | 5 +++-- src/lib/drupal/drupal-jsonapi.d.tsx | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/paragraphs/stanford-card/card-paragraph.tsx b/src/components/paragraphs/stanford-card/card-paragraph.tsx index 879bf95e..a238e155 100644 --- a/src/components/paragraphs/stanford-card/card-paragraph.tsx +++ b/src/components/paragraphs/stanford-card/card-paragraph.tsx @@ -21,8 +21,8 @@ const CardParagraph = ({paragraph, ...props}: Props) => { const headerTagChoice = (behaviors.su_card_styles?.heading || "h2").split(".", 2); const headerTag = headerTagChoice[0] const headerClasses = headerTagChoice[1]?.replace(".", " ").replace("su-font-splash", "text-m2 font-bold") - - const hideHeader = behaviors.su_card_styles?.hide_heading; + const cardVariant = behaviors.su_card_styles?.card_variant; + const hideHeader = behaviors.su_card_styles?.heading; return ( { imageAlt={image?.alt} videoUrl={videoUrl} isArticle={!!paragraph.suCardHeader} + className={cardVariant} > {paragraph.suCardHeader &&
diff --git a/src/lib/drupal/drupal-jsonapi.d.tsx b/src/lib/drupal/drupal-jsonapi.d.tsx index 60e42c4c..a3faed95 100644 --- a/src/lib/drupal/drupal-jsonapi.d.tsx +++ b/src/lib/drupal/drupal-jsonapi.d.tsx @@ -37,4 +37,5 @@ export type ParagraphBehaviors = { su_card_styles?: CardParagraphBehaviors hero_pattern?: BannerParagraphBehaviors stanford_teaser?: TeaserParagraphBehaviors + card_variant?: BannerParagraphBehaviors }