Skip to content

Commit

Permalink
Adding card variant.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdyoung3 committed May 7, 2024
1 parent 5c7c1e2 commit 3ca7289
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/paragraphs/stanford-card/card-paragraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<ImageCard
Expand All @@ -32,6 +32,7 @@ const CardParagraph = ({paragraph, ...props}: Props) => {
imageAlt={image?.alt}
videoUrl={videoUrl}
isArticle={!!paragraph.suCardHeader}
className={cardVariant}
>
{paragraph.suCardHeader &&
<div id={paragraph.id} className={twMerge("order-2", hideHeader && "sr-only")}>
Expand Down
1 change: 1 addition & 0 deletions src/lib/drupal/drupal-jsonapi.d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ export type ParagraphBehaviors = {
su_card_styles?: CardParagraphBehaviors
hero_pattern?: BannerParagraphBehaviors
stanford_teaser?: TeaserParagraphBehaviors
card_variant?: BannerParagraphBehaviors
}

0 comments on commit 3ca7289

Please sign in to comment.