Skip to content

Commit

Permalink
Format chart and topic counts on homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyi committed Apr 29, 2024
1 parent 8949482 commit 9d13b28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions site/gdocs/components/HomepageSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ export function HomepageSearch(props: { className?: string }) {
const { homepageMetadata } = useContext(AttachmentsContext)
const chartCount = homepageMetadata?.chartCount
const topicCount = homepageMetadata?.topicCount
const formatter = new Intl.NumberFormat("en-GB")
const message =
chartCount && topicCount ? (
<>
<a href="/charts">{chartCount} charts</a> across{" "}
<a href="/charts">{formatter.format(chartCount)} charts</a>{" "}
across{" "}
<a
href="#all-topics"
className="homepage-search__all-topics-link"
>
{topicCount} topics
{formatter.format(topicCount)} topics
</a>
<span className="homepage-search__open-source-notice">
All free: open access and open source
Expand Down

0 comments on commit 9d13b28

Please sign in to comment.