Skip to content

Commit

Permalink
🐛 Adding noInvert prop for card with coloredbackground #2420
Browse files Browse the repository at this point in the history
  • Loading branch information
millianapia committed Aug 19, 2024
1 parent 820876f commit a2ceb98
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion web/pageComponents/shared/portableText/Blocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -139,6 +140,7 @@ export default function Blocks({
id,
clampLines,
includeFootnotes = false,
noInvert = false,
}: BlockProps) {
let div: PortableTextBlock[] = []
return (
Expand All @@ -158,7 +160,11 @@ export default function Blocks({
div = []

return (
<div key={block._key} className={twMerge(`prose ${proseClassName} dark:prose-invert`, className)} id={id}>
<div
key={block._key}
className={twMerge(`prose ${proseClassName} ${noInvert ? '' : `dark:prose-invert`}`, className)}
id={id}
>
<PortableText
value={value}
//@ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion web/sections/cards/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const Card = forwardRef<HTMLAnchorElement, CardProps>(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,
Expand Down
1 change: 0 additions & 1 deletion web/sections/cards/Card/CardContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const CardContent = forwardRef<HTMLDivElement, CardContentProps>(function
`
size-arrow-right
text-energy-red-100
dark:text-white-100
mr-2
group-hover/card:translate-x-2
transition-all
Expand Down
1 change: 1 addition & 0 deletions web/sections/cards/Card/CardHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(function C
${variantTitle[variant]}
max-w-prose
text-pretty
dark:text-slate-80
`,
titleClassName,
)
Expand Down
1 change: 1 addition & 0 deletions web/sections/cards/PromotionCard/PromotionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const PromotionCard = forwardRef<HTMLAnchorElement, PromotionCardProps>(function
/>
{ingress && (
<Blocks
noInvert
value={ingress}
className={`break-word max-w-prose grow ${
type !== 'news' && type !== 'localNews' ? '' : 'hidden lg:block'
Expand Down

0 comments on commit a2ceb98

Please sign in to comment.