Skip to content

Commit

Permalink
✨ (sources-modal) hide source information of Continent variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Nov 24, 2023
1 parent 4c1988d commit 8b10c8c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,14 @@ export class Source extends React.Component<{
return "The data of this indicator is based on the following sources:"
}

@computed private get hideSourcesForDisplay(): boolean {
// the indictaor with id = 123 is the "Continent" variable curated by OWID.
// it's used in many charts but doesn't come with useful source information.
// that's why we hide the sources section for this indicator for now,
// but we might decide to show it in the future
return this.def.owidVariableId === 123
}

protected renderTitle(): JSX.Element {
return (
<h2>
Expand Down Expand Up @@ -394,7 +402,8 @@ export class Source extends React.Component<{
isEmbeddedInADataPage={this.props.isEmbeddedInADataPage}
/>
)}
{this.sourcesForDisplay &&
{!this.hideSourcesForDisplay &&
this.sourcesForDisplay &&
this.sourcesForDisplay.length > 0 && (
<>
<h3 className="heading">
Expand Down

0 comments on commit 8b10c8c

Please sign in to comment.