Skip to content

Commit

Permalink
enhance(sources-modal): restrict maximum width
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann authored and danyx23 committed Nov 17, 2023
1 parent 0088082 commit f137ad8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f137ad8

Please sign in to comment.