-
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2993 from owid/citation-tweaks
🎉 Tweak citations, add them to the sources overlay
- Loading branch information
Showing
8 changed files
with
218 additions
and
93 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
packages/@ourworldindata/components/src/DataCitation/DataCitation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from "react" | ||
import { CodeSnippet } from "../CodeSnippet/CodeSnippet.js" | ||
|
||
export const DataCitation = (props: { | ||
citationShort: string | ||
citationLong: string | ||
}) => { | ||
return ( | ||
<> | ||
{props.citationShort && ( | ||
<> | ||
<p className="citation__paragraph"> | ||
<span className="citation__type">In-line citation</span> | ||
<br /> | ||
If you have limited space (e.g. in data visualizations), | ||
you can use this abbreviated in-line citation: | ||
</p> | ||
<CodeSnippet | ||
code={props.citationShort} | ||
theme="light" | ||
useMarkdown={true} | ||
/> | ||
</> | ||
)} | ||
{props.citationLong && ( | ||
<> | ||
<p className="citation__paragraph"> | ||
<span className="citation__type">Full citation</span> | ||
</p> | ||
<CodeSnippet | ||
code={props.citationLong} | ||
theme="light" | ||
useMarkdown={true} | ||
/> | ||
</> | ||
)} | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.