Skip to content

Commit

Permalink
✨ (gdocs) show short attribution in the accordion header
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Jan 29, 2024
1 parent a06f4dd commit fda504f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions site/gdocs/components/KeyIndicatorCollection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ import {
EnrichedBlockKeyIndicatorCollection,
EnrichedBlockKeyIndicator,
} from "@ourworldindata/types"
import { urlToSlug } from "@ourworldindata/utils"
import { makeDateRange, makeSource } from "@ourworldindata/components"
import {
capitalize,
joinTitleFragments,
urlToSlug,
} from "@ourworldindata/utils"
import { makeDateRange } from "@ourworldindata/components"

import { useLinkedChart, useLinkedIndicator } from "../utils.js"
import KeyIndicator from "./KeyIndicator.js"
Expand Down Expand Up @@ -123,10 +127,12 @@ function KeyIndicatorHeader({
if (!linkedChart) return null
if (!linkedIndicator) return null

const source = makeSource({
attribution: linkedIndicator.attributionUnshortened,
hideProcessingLevel: true,
})
const source = capitalize(
joinTitleFragments(
linkedIndicator.attributionShort,
linkedIndicator.titleVariant
)
)
const dateRange = makeDateRange({
dateRange: linkedIndicator.dateRange,
})
Expand Down

0 comments on commit fda504f

Please sign in to comment.