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

Blockquote component #2885

Merged
merged 9 commits into from
Nov 2, 2023
Merged

Blockquote component #2885

merged 9 commits into from
Nov 2, 2023

Conversation

ikesau
Copy link
Member

@ikesau ikesau commented Nov 1, 2023

Adds a blockquote component for linear topic pages. Previously we were (mistakenly) converting these to pullquote components which are enormous serif text blocks intended for extreme emphasis.

Archie

{.blockquote}
citation: – Bastian Herre
[.+text]
Measuring the state of democracy across the world helps us understand the extent to which people have political rights and freedoms.
[]
{}

or

{.blockquote}
citation: https://ourworldindata.org/democracies-measurement
[.+text]
Measuring the state of democracy across the world helps us understand the extent to which people have political rights and freedoms.
[]
{}

@ikesau ikesau requested a review from marcelgerber November 1, 2023 22:12
@ikesau ikesau requested review from sophiamersmann and removed request for marcelgerber November 1, 2023 22:13
Copy link
Member

@sophiamersmann sophiamersmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

I'm a little confused about the citation - not sure if it's supposed to be optional or not.

A more general note: Maybe it's just an example, but if we want the citation to always start with a "-" like "- Bastian Herre", then it might be better to automatically insert it rather than requiring the author to type it?

export type EnrichedBlockBlockquote = {
type: "blockquote"
text: EnrichedBlockText[]
citation?: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it right that citation is marked as optional here?

Comment on lines 610 to 614
{isCitationAUrl ? null : (
<footer>
<cite>{block.citation}</cite>
</footer>
)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If citation is truly optional, this might produce an empty <footer><cite></cite></footer> (although it doesn't at the moment because it errors out if no citation is given)

p {
font-style: italic;
&:last-of-type {
margin-bottom: 4px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we only need this margin if the footer/cite block is present, it might be better to make it the footer's responsibility to apply this margin?

@ikesau ikesau merged commit fd9cff6 into master Nov 2, 2023
13 checks passed
@ikesau ikesau deleted the blockquote-component branch November 2, 2023 20:09
@ikesau
Copy link
Member Author

ikesau commented Nov 2, 2023

Thanks @sophiamersmann - that's what I get for rushing out the door before testing each state properly. I fixed the code and added a comment in ArticleBlock to properly explain the logic 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants