From ba5ed10afbde4ebedb12599227c3cc154f658a94 Mon Sep 17 00:00:00 2001 From: "Malin J." Date: Wed, 25 Sep 2024 09:43:22 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Add=20check=20for=20singlepromot?= =?UTF-8?q?ion=20#2420=20(#2424)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛 Add check for singlepromotion #2420 * 🔇 Remove console.log #2420 * 🐛 Adding noInvert prop for card with coloredbackground #2420 --- .../components/EventPromotion/EventPromotionPreview.tsx | 1 - web/pageComponents/shared/portableText/Blocks.tsx | 8 +++++++- web/pageComponents/topicPages/Promotion.tsx | 2 +- web/sections/cards/Card/Card.tsx | 2 +- web/sections/cards/Card/CardContent.tsx | 1 - web/sections/cards/Card/CardHeader.tsx | 1 + web/sections/cards/PromotionCard/PromotionCard.tsx | 1 + 7 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sanityv3/schemas/components/EventPromotion/EventPromotionPreview.tsx b/sanityv3/schemas/components/EventPromotion/EventPromotionPreview.tsx index 0a454c39f..94bb0ded0 100644 --- a/sanityv3/schemas/components/EventPromotion/EventPromotionPreview.tsx +++ b/sanityv3/schemas/components/EventPromotion/EventPromotionPreview.tsx @@ -39,7 +39,6 @@ export const EventPromotionPreview = (props: EventPromotionPreviewProps) => { return setTitle(`Showing ${number} ${time} ${promoteSingleUpcomingEvent ? 'event' : 'events'} ${withTags}`) }, [manuallySelectEvents, promotedEvents, useTags, tags, pastEventsCount, promoteSingleUpcomingEvent]) - console.log('title', title) return ( diff --git a/web/pageComponents/shared/portableText/Blocks.tsx b/web/pageComponents/shared/portableText/Blocks.tsx index 9053b8623..810d52b1e 100644 --- a/web/pageComponents/shared/portableText/Blocks.tsx +++ b/web/pageComponents/shared/portableText/Blocks.tsx @@ -124,6 +124,7 @@ export type BlockProps = { /** Use to clamp lines on number */ clampLines?: number includeFootnotes?: boolean + noInvert?: boolean } & PortableTextProps const inlineBlockTypes = ['block', 'positionedInlineImage', 'pullQuote', 'basicIframe'] @@ -139,6 +140,7 @@ export default function Blocks({ id, clampLines, includeFootnotes = false, + noInvert = false, }: BlockProps) { let div: PortableTextBlock[] = [] return ( @@ -158,7 +160,11 @@ export default function Blocks({ div = [] return ( -
+
)} - {promotions?.length === 1 ? ( + {promotions?.length === 1 || promoteSingleUpcomingEvent ? ( ) : ( (function Card( text-slate-80 focus:outline-none focus-visible:envis-outline - dark:text-white-100 + dark:text-slate-80 dark:focus-visible:envis-outline-invert `, className, diff --git a/web/sections/cards/Card/CardContent.tsx b/web/sections/cards/Card/CardContent.tsx index 7885b1ec0..7bcd63ff5 100644 --- a/web/sections/cards/Card/CardContent.tsx +++ b/web/sections/cards/Card/CardContent.tsx @@ -44,7 +44,6 @@ export const CardContent = forwardRef(function ` size-arrow-right text-energy-red-100 - dark:text-white-100 mr-2 group-hover/card:translate-x-2 transition-all diff --git a/web/sections/cards/Card/CardHeader.tsx b/web/sections/cards/Card/CardHeader.tsx index 5ae61a94f..bf1a027d1 100644 --- a/web/sections/cards/Card/CardHeader.tsx +++ b/web/sections/cards/Card/CardHeader.tsx @@ -61,6 +61,7 @@ export const CardHeader = forwardRef(function C ${variantTitle[variant]} max-w-prose text-pretty + dark:text-slate-80 `, titleClassName, ) diff --git a/web/sections/cards/PromotionCard/PromotionCard.tsx b/web/sections/cards/PromotionCard/PromotionCard.tsx index a0acb0c0a..a72137205 100644 --- a/web/sections/cards/PromotionCard/PromotionCard.tsx +++ b/web/sections/cards/PromotionCard/PromotionCard.tsx @@ -50,6 +50,7 @@ const PromotionCard = forwardRef(function /> {ingress && (