diff --git a/src/components/customerCases/customerCase/CustomerCase.tsx b/src/components/customerCases/customerCase/CustomerCase.tsx index 5799db3dd..6ae651dee 100644 --- a/src/components/customerCases/customerCase/CustomerCase.tsx +++ b/src/components/customerCases/customerCase/CustomerCase.tsx @@ -48,7 +48,11 @@ export default async function CustomerCase({
{customerCase.sections.map((section) => ( - + ))}
{consultantsResult?.ok && ( diff --git a/src/components/customerCases/customerCase/sections/CustomerCaseSection.tsx b/src/components/customerCases/customerCase/sections/CustomerCaseSection.tsx index 28deaa63a..e9203e706 100644 --- a/src/components/customerCases/customerCase/sections/CustomerCaseSection.tsx +++ b/src/components/customerCases/customerCase/sections/CustomerCaseSection.tsx @@ -1,4 +1,7 @@ -import { CustomerCaseSection as CustomerCaseSectionObject } from "studioShared/lib/interfaces/customerCases"; +import { + CustomerCaseClientColors, + CustomerCaseSection as CustomerCaseSectionObject, +} from "studioShared/lib/interfaces/customerCases"; import ImageSection from "./image/ImageSection"; import ListBlock from "./list/ListBlock"; @@ -7,8 +10,10 @@ import SplitSection from "./splitSection/SplitSection"; export function CustomerCaseSection({ section, + clientColors, }: { section: CustomerCaseSectionObject; + clientColors: CustomerCaseClientColors; }) { switch (section._type) { case "splitSection": @@ -16,7 +21,7 @@ export function CustomerCaseSection({ case "imageBlock": return ; case "resultsBlock": - return ; + return ; case "listBlock": return ; } diff --git a/src/components/customerCases/customerCase/sections/results/ResultsBlock.tsx b/src/components/customerCases/customerCase/sections/results/ResultsBlock.tsx index d3fd50c71..120a752a7 100644 --- a/src/components/customerCases/customerCase/sections/results/ResultsBlock.tsx +++ b/src/components/customerCases/customerCase/sections/results/ResultsBlock.tsx @@ -5,23 +5,34 @@ import styles from "./resultsBlock.module.css"; export interface ResultsBlockProps { section: ResultsBlockObject; + blockColor?: string; } -export default function ResultsBlock({ section }: ResultsBlockProps) { +export default function ResultsBlock({ + section, + blockColor, +}: ResultsBlockProps) { return ( section.resultsBlockTitle && (
- +
) ); } -function StackedHighlights({ section }: ResultsBlockProps) { +function StackedHighlights({ section, blockColor }: ResultsBlockProps) { + const style = { + "--block-color": blockColor ?? "var(--surface-yellow)", + } as React.CSSProperties; + return ( -
+
{section.resultsBlockTitle} diff --git a/src/components/customerCases/customerCase/sections/results/resultsBlock.module.css b/src/components/customerCases/customerCase/sections/results/resultsBlock.module.css index 648d799e4..cfd660569 100644 --- a/src/components/customerCases/customerCase/sections/results/resultsBlock.module.css +++ b/src/components/customerCases/customerCase/sections/results/resultsBlock.module.css @@ -5,9 +5,9 @@ } .highlightCard { - border: 3px solid var(--surface-yellow); + border: 3px solid var(--block-color); border-radius: 0.25rem; - background-color: var(--surface-yellow); + background-color: var(--block-color); } .highlightCard .innerContent { @@ -29,7 +29,7 @@ } .highlightOutside { - background-color: var(--surface-yellow); + background-color: var(--block-color); color: var(--text-primary); display: inline-block; padding: 0.25rem 1.25rem; @@ -77,6 +77,7 @@ margin-top: calc(3px * -1); border-top-left-radius: 0; height: auto; + width: 100%; } .highlightRow .highlightCard:not(:last-child) { @@ -93,6 +94,28 @@ border-top-left-radius: 0; } -.highlightRow .highlightCard { - width: 100%; +@media (max-width: 640px) { + div:has(> .highlightWrapper) { + width: 100%; + } + + .highlightOutside { + margin-bottom: 0; + } + + .highlightRow { + flex-direction: column; + } + + .highlightRow .highlightCard:first-child { + border-top-right-radius: 0.25rem; + } + + .highlightRow .highlightCard:last-child { + border-bottom-left-radius: 0.25rem; + } + + .highlightRow .highlightCard:not(:first-child) { + border-left: 3px solid var(--block-color); + } }