Skip to content

Commit

Permalink
Implement feedback from QA
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyi committed Dec 12, 2024
1 parent 9546d6a commit a139612
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 15 deletions.
7 changes: 6 additions & 1 deletion packages/@ourworldindata/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,12 @@ export { Url, setWindowUrl, getWindowUrl } from "./urls/Url.js"

export { type UrlMigration, performUrlMigrations } from "./urls/UrlMigration.js"

export { camelCaseProperties, titleCase, toAsciiQuotes } from "./string.js"
export {
camelCaseProperties,
titleCase,
toAsciiQuotes,
removeDiacritics,
} from "./string.js"

export { serializeJSONForHTML, deserializeJSONFromHTML } from "./serializers.js"

Expand Down
5 changes: 5 additions & 0 deletions packages/@ourworldindata/utils/src/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ export const titleCase = (str: string): string => {
export function toAsciiQuotes(str: string): string {
return str.replace(/[]/g, '"').replace(/[]/g, "'")
}

// https://stackoverflow.com/a/37511463/9846837
export function removeDiacritics(str: string): string {
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "")
}
6 changes: 4 additions & 2 deletions site/gdocs/components/Donors.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import * as React from "react"
import { groupBy } from "@ourworldindata/utils"
import { groupBy, removeDiacritics } from "@ourworldindata/utils"
import { useDonors } from "../utils.js"

export default function Donors({ className }: { className?: string }) {
const donors = useDonors()
if (!donors) return null

const donorsByLetter = groupBy(donors, (donor) => donor[0])
const donorsByLetter = groupBy(donors, (donor) =>
removeDiacritics(donor[0].toUpperCase())
)
return (
<div className={className}>
<div className="col-start-2 span-cols-12">
Expand Down
6 changes: 6 additions & 0 deletions site/gdocs/components/People.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
.people {
row-gap: 16px;

.article-block__text,
.article-block__list,
.article-block__numbered-list {
font-size: 16px;
}
}

.people-cols-2 {
Expand Down
4 changes: 4 additions & 0 deletions site/gdocs/components/Person.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
}

.person-image {
picture {
display: flex; // Fix extra padding at the bottom.
}

img {
border-radius: 50%;
}
Expand Down
5 changes: 1 addition & 4 deletions site/gdocs/components/centered-article.scss
Original file line number Diff line number Diff line change
Expand Up @@ -464,14 +464,11 @@ h3.article-block__heading {
}
}

.image--has-outline + .article-block__image-caption {
margin-top: 8px;
}

.article-block__image-caption {
@include body-3-medium-italic;
color: $blue-60;
text-align: center;
margin-top: 16px;
}

.article-block__chart + .article-block__heading {
Expand Down
19 changes: 11 additions & 8 deletions site/gdocs/pages/AboutPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@
@include h1-semibold;
color: $blue-60;
margin-top: 0;

&:has(+ .article-block__side-by-side) {
margin-bottom: 8px;
}
}

h3.article-block__heading {
Expand Down Expand Up @@ -97,18 +93,19 @@
margin-bottom: 24px;
}

.article-block__chart {
margin-bottom: 24px;
}

.article-block__code-snippet {
margin-bottom: 16px;
}

.article-block__chart,
.article-block__image {
margin: 0 0 24px;
}

.article-block__people + .article-block__heading {
margin-top: 40px;
}

.article-block__prominent-link {
margin-bottom: 24px;
}
Expand All @@ -122,6 +119,12 @@
}
}

.article-block__side-by-side {
:first-child {
margin-top: 0;
}
}

.article-block__donors {
margin-top: 32px;
padding-top: 40px;
Expand Down

0 comments on commit a139612

Please sign in to comment.