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

More commas on homepage chart count, hasOutline on archie images #3619

Merged
merged 6 commits into from
May 21, 2024

Conversation

ikesau
Copy link
Member

@ikesau ikesau commented May 20, 2024

Changes

  • Allows authors to add a grey border around images if desired (See slack)

image

image
image

@ikesau ikesau requested a review from rakyi May 20, 2024 16:47
@ikesau ikesau self-assigned this May 20, 2024
Copy link
Contributor

@rakyi rakyi left a comment

Choose a reason for hiding this comment

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

LGTM, except one small comment and the build errors.

/**
* Example: 120000 -> "12,000"
*/
export function commafyNumber(value: number): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be worth to:

  • Name this formatNumber or formatQuantity to be less specific, we might decide to change the format in the future

  • Use the Intl.NumberFormat API if we are gonna keep reusing this and define the formatter at the top scope to avoid initializing it every time we call the function, see docs:

    Every time toLocaleString is called, it has to perform a search in a big database of localization strings, which is potentially inefficient. When the method is called many times with the same arguments, it is better to create a Intl.NumberFormat object and use its format() method

@owidbot
Copy link
Contributor

owidbot commented May 21, 2024

Quick links (staging server):

Site Admin Wizard

Login: ssh owid@staging-site-ui-updates

SVG tester:

Number of differences (default views): 0
Number of differences (all views): 0

Edited: 2024-05-21 15:00:49 UTC
Execution time: 1.20 seconds

@ikesau ikesau merged commit af8bc84 into master May 21, 2024
21 checks passed
@ikesau ikesau deleted the ui-updates branch May 21, 2024 20:21
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.

None yet

3 participants