From f137ad80f773f5772b8773369114fdeaad021f96 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 16 Nov 2023 15:34:27 +0000 Subject: [PATCH] enhance(sources-modal): restrict maximum width --- packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx b/packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx index 8aa7bd84384..355ab280b41 100644 --- a/packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx +++ b/packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx @@ -75,7 +75,9 @@ export class SourcesModal extends React.Component< @computed private get modalBounds(): Bounds { // using 15px instead of 16px to make sure the modal fully covers the OWID logo in the header - return this.tabBounds.pad(15) + const maxWidth = MAX_WIDTH + 220 + const padWidth = Math.max(15, (this.tabBounds.width - maxWidth) / 2) + return this.tabBounds.padHeight(15).padWidth(padWidth) } @computed private get editBaseUrl(): string | undefined {