From a017567f523a80e92d6e8f2a4febcef138d8e3b9 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Thu, 9 Jan 2025 16:27:53 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(grapher)=20updating=20padding=20be?= =?UTF-8?q?tween=20text=20elements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For better consistency with static charts created in Figma --- packages/@ourworldindata/grapher/src/footer/Footer.tsx | 2 -- packages/@ourworldindata/grapher/src/header/Header.tsx | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/footer/Footer.tsx b/packages/@ourworldindata/grapher/src/footer/Footer.tsx index ecaee16154..d76d12f6d9 100644 --- a/packages/@ourworldindata/grapher/src/footer/Footer.tsx +++ b/packages/@ourworldindata/grapher/src/footer/Footer.tsx @@ -633,8 +633,6 @@ interface StaticFooterProps extends FooterProps { @observer export class StaticFooter extends Footer { - verticalPadding = 2 - // eslint-disable-next-line @typescript-eslint/no-empty-function componentDidMount(): void {} // eslint-disable-next-line @typescript-eslint/no-empty-function diff --git a/packages/@ourworldindata/grapher/src/header/Header.tsx b/packages/@ourworldindata/grapher/src/header/Header.tsx index 9f8dfcfdd8..bf10a69ffc 100644 --- a/packages/@ourworldindata/grapher/src/header/Header.tsx +++ b/packages/@ourworldindata/grapher/src/header/Header.tsx @@ -32,6 +32,8 @@ interface HeaderProps { export class Header< Props extends HeaderProps = HeaderProps, > extends React.Component { + protected verticalPadding = 4 + @computed protected get manager(): HeaderManager { return this.props.manager } @@ -156,7 +158,7 @@ export class Header< } @computed get subtitleMarginTop(): number { - let padding = 4 + let padding = this.verticalPadding // make sure the subtitle doesn't overlap with the logo if ( @@ -292,6 +294,8 @@ interface StaticHeaderProps extends HeaderProps { @observer export class StaticHeader extends Header { + protected verticalPadding = 6 + @computed get titleLineHeight(): number { return this.manager.isStaticAndSmall ? 1.1 : 1.2 }