Merged in fix/SW-2817-activity-card (pull request #2160)
Fix/SW-2816: activity card span full width * fix(SW-2816): image span full width * fix(SW-2817): improve image blurriness Approved-by: Erik Tiekstra
This commit is contained in:
@@ -20,13 +20,13 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imageWrapper {
|
.imageContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imageWrapper::after {
|
.imageGradient::after {
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
180deg,
|
180deg,
|
||||||
rgba(0, 0, 0, 0) 0%,
|
rgba(0, 0, 0, 0) 0%,
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ export interface CardProps
|
|||||||
scriptedTopTitle?: string | null
|
scriptedTopTitle?: string | null
|
||||||
heading?: string | null
|
heading?: string | null
|
||||||
bodyText?: string | null
|
bodyText?: string | null
|
||||||
imageHeight?: number
|
|
||||||
imageWidth?: number
|
|
||||||
imageGradient?: boolean
|
imageGradient?: boolean
|
||||||
onPrimaryButtonClick?: () => void
|
onPrimaryButtonClick?: () => void
|
||||||
onSecondaryButtonClick?: () => void
|
onSecondaryButtonClick?: () => void
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { cx } from "class-variance-authority"
|
||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
|
|
||||||
import Image from "@/components/Image"
|
import Image from "@/components/Image"
|
||||||
@@ -27,8 +28,6 @@ export default function Card({
|
|||||||
className,
|
className,
|
||||||
theme,
|
theme,
|
||||||
backgroundImage,
|
backgroundImage,
|
||||||
imageHeight,
|
|
||||||
imageWidth,
|
|
||||||
imageGradient,
|
imageGradient,
|
||||||
onPrimaryButtonClick,
|
onPrimaryButtonClick,
|
||||||
onSecondaryButtonClick,
|
onSecondaryButtonClick,
|
||||||
@@ -39,16 +38,6 @@ export default function Card({
|
|||||||
const scriptFontColor = getScriptFontColor(theme)
|
const scriptFontColor = getScriptFontColor(theme)
|
||||||
const bodyFontColor = getBodyFontColor(theme)
|
const bodyFontColor = getBodyFontColor(theme)
|
||||||
|
|
||||||
imageHeight = imageHeight || 320
|
|
||||||
|
|
||||||
imageWidth =
|
|
||||||
imageWidth ||
|
|
||||||
(backgroundImage?.dimensions
|
|
||||||
? backgroundImage.dimensions.aspectRatio >= 1
|
|
||||||
? backgroundImage.dimensions.aspectRatio * imageHeight
|
|
||||||
: imageHeight / backgroundImage.dimensions.aspectRatio
|
|
||||||
: 420)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<article
|
<article
|
||||||
className={cardVariants({
|
className={cardVariants({
|
||||||
@@ -58,13 +47,17 @@ export default function Card({
|
|||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{backgroundImage && (
|
{backgroundImage && (
|
||||||
<div className={imageGradient ? styles.imageWrapper : ""}>
|
<div
|
||||||
|
className={cx(styles.imageContainer, {
|
||||||
|
[styles.imageGradient]: imageGradient,
|
||||||
|
})}
|
||||||
|
>
|
||||||
<Image
|
<Image
|
||||||
src={backgroundImage.url}
|
src={backgroundImage.url}
|
||||||
className={styles.image}
|
className={styles.image}
|
||||||
alt={backgroundImage.meta.alt || backgroundImage.title}
|
alt={backgroundImage.meta.alt || backgroundImage.title}
|
||||||
width={imageWidth}
|
fill
|
||||||
height={imageHeight}
|
sizes="(min-width: 1367px) 700px, 900px"
|
||||||
focalPoint={backgroundImage.focalPoint}
|
focalPoint={backgroundImage.focalPoint}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user