Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐝 minor data page formatting fixes #2847

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ export const IndicatorBrief = (props: IndicatorBriefProps) => {
: "How does the producer of this data describe this data?"
}
content={
<SimpleMarkdownText
text={props.descriptionFromProducer}
/>
<div className="article-block__text">
<SimpleMarkdownText
text={props.descriptionFromProducer}
/>
</div>
}
isExpandedDefault={
!(props.descriptionShort || props.descriptionKey)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react"
import { ExpandableToggle } from "../ExpandableToggle/ExpandableToggle.js"
import { OwidOrigin } from "@ourworldindata/utils"
import { OwidOrigin, dayjs } from "@ourworldindata/utils"
import { SimpleMarkdownText } from "../SimpleMarkdownText.js"
import { CodeSnippet } from "../CodeSnippet/CodeSnippet.js"
import { REUSE_THIS_WORK_SECTION_ID } from "../SharedDataPageConstants.js"
Expand Down Expand Up @@ -48,6 +48,9 @@ export const IndicatorSources = (props: IndicatorSourcesProps) => {
</h3>
<div className="col-start-4 span-cols-6 col-lg-start-5 span-lg-cols-7 col-md-start-2 span-md-cols-10 col-sm-start-1 span-sm-cols-12">
{props.origins.map((source, idx: number, sources) => {
const dateAccessed = source.dateAccessed
? dayjs(source.dateAccessed).format("MMMM D, YYYY")
: undefined
return (
<div className="data-sources__source-item" key={idx}>
<ExpandableToggle
Expand All @@ -68,24 +71,21 @@ export const IndicatorSources = (props: IndicatorSourcesProps) => {
/>
</p>
)}
{(source.dateAccessed ||
source.urlMain) && (
{(dateAccessed || source.urlMain) && (
<div
className="grid source__key-data"
style={{
gridTemplateColumns:
"minmax(0,1fr) minmax(0,2fr)",
}}
>
{source.dateAccessed && (
{dateAccessed && (
<div className="key-data">
<div className="key-data__title--dark">
Retrieved on
</div>
<div>
{
source.dateAccessed
}
{dateAccessed}
</div>
</div>
)}
Expand Down
Loading