diff --git a/adminShared/search.tsx b/adminShared/search.tsx index 1b03dd543a8..6eba551ab93 100644 --- a/adminShared/search.tsx +++ b/adminShared/search.tsx @@ -1,5 +1,5 @@ import { drop, escapeRegExp, sortBy } from "@ourworldindata/utils" -import React from "react" +import * as React from "react" export interface SearchWord { regex: RegExp diff --git a/adminSiteClient/Admin.tsx b/adminSiteClient/Admin.tsx index 80ec3802c94..307513c79ed 100644 --- a/adminSiteClient/Admin.tsx +++ b/adminSiteClient/Admin.tsx @@ -1,4 +1,3 @@ -import React from "react" import ReactDOM from "react-dom" import * as lodash from "lodash" import { observable, computed, action } from "mobx" diff --git a/adminSiteClient/AdminApp.tsx b/adminSiteClient/AdminApp.tsx index 04adf0d3878..72560499ae0 100644 --- a/adminSiteClient/AdminApp.tsx +++ b/adminSiteClient/AdminApp.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Admin } from "./Admin.js" import { ChartEditorPage } from "./ChartEditorPage.js" import { action } from "mobx" diff --git a/adminSiteClient/AdminAppContext.ts b/adminSiteClient/AdminAppContext.ts index 902d8cb85c8..63ec79bb073 100644 --- a/adminSiteClient/AdminAppContext.ts +++ b/adminSiteClient/AdminAppContext.ts @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Admin } from "./Admin.js" export interface AdminAppContextType { diff --git a/adminSiteClient/AdminLayout.tsx b/adminSiteClient/AdminLayout.tsx index 6b6eaadde5f..b7c02067a3b 100644 --- a/adminSiteClient/AdminLayout.tsx +++ b/adminSiteClient/AdminLayout.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observable, action, computed } from "mobx" import { observer } from "mobx-react" diff --git a/adminSiteClient/AdminSidebar.tsx b/adminSiteClient/AdminSidebar.tsx index cb5e5eecf53..3b7ad4c2d0c 100644 --- a/adminSiteClient/AdminSidebar.tsx +++ b/adminSiteClient/AdminSidebar.tsx @@ -1,5 +1,5 @@ import { Link } from "./Link.js" -import React from "react" +import * as React from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faChartBar, diff --git a/adminSiteClient/BulkDownloadPage.tsx b/adminSiteClient/BulkDownloadPage.tsx index 128837fc319..78e83e1bfc6 100644 --- a/adminSiteClient/BulkDownloadPage.tsx +++ b/adminSiteClient/BulkDownloadPage.tsx @@ -1,10 +1,10 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { AdminLayout } from "./AdminLayout.js" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" @observer -export class BulkDownloadPage extends React.Component { +export class BulkDownloadPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType @@ -20,7 +20,7 @@ export class BulkDownloadPage extends React.Component { } } -export class DownloadChartsSection extends React.Component { +export class DownloadChartsSection extends Component { render() { return (
diff --git a/adminSiteClient/BulkGrapherConfigEditor.tsx b/adminSiteClient/BulkGrapherConfigEditor.tsx index 378d00998cf..ff5214a52cd 100644 --- a/adminSiteClient/BulkGrapherConfigEditor.tsx +++ b/adminSiteClient/BulkGrapherConfigEditor.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { chartBulkUpdateAllowedColumnNamesAndTypes, WHITELISTED_SQL_COLUMN_NAMES, @@ -130,7 +130,7 @@ const config: GrapherConfigGridEditorConfig = { finalVariableLayerModificationFn: () => ({}), } -export class BulkGrapherConfigEditorPage extends React.Component { +export class BulkGrapherConfigEditorPage extends Component { render() { return ( diff --git a/adminSiteClient/ChartEditorView.tsx b/adminSiteClient/ChartEditorView.tsx index 2cd3005e101..3c6fb4312ac 100644 --- a/adminSiteClient/ChartEditorView.tsx +++ b/adminSiteClient/ChartEditorView.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { observable, diff --git a/adminSiteClient/ChartIndexPage.tsx b/adminSiteClient/ChartIndexPage.tsx index eb2eb4722c2..7018047982b 100644 --- a/adminSiteClient/ChartIndexPage.tsx +++ b/adminSiteClient/ChartIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, computed, action, runInAction } from "mobx" @@ -15,7 +15,7 @@ import { import { sortNumeric, SortOrder } from "@ourworldindata/utils" @observer -export class ChartIndexPage extends React.Component { +export class ChartIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/ChartList.tsx b/adminSiteClient/ChartList.tsx index 8236bdbc74c..6c51c0fc56d 100644 --- a/adminSiteClient/ChartList.tsx +++ b/adminSiteClient/ChartList.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { runInAction, observable } from "mobx" import { bind } from "decko" diff --git a/adminSiteClient/ChartRow.tsx b/adminSiteClient/ChartRow.tsx index 18677f5563c..f9564fd62d5 100644 --- a/adminSiteClient/ChartRow.tsx +++ b/adminSiteClient/ChartRow.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { action, runInAction } from "mobx" import * as lodash from "lodash" diff --git a/adminSiteClient/ChartViewIndexPage.tsx b/adminSiteClient/ChartViewIndexPage.tsx index fca45f0728d..4211ba1d15b 100644 --- a/adminSiteClient/ChartViewIndexPage.tsx +++ b/adminSiteClient/ChartViewIndexPage.tsx @@ -1,4 +1,5 @@ -import React, { useContext, useEffect, useMemo, useState } from "react" +import { useContext, useEffect, useMemo, useState } from "react" +import * as React from "react" import { Button, Flex, Input, Space, Table } from "antd" import { AdminLayout } from "./AdminLayout.js" diff --git a/adminSiteClient/ColorSchemeDropdown.tsx b/adminSiteClient/ColorSchemeDropdown.tsx index b4f0b0df570..5b0ecf238ef 100644 --- a/adminSiteClient/ColorSchemeDropdown.tsx +++ b/adminSiteClient/ColorSchemeDropdown.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { computed, action } from "mobx" import Select from "react-select" import { GrapherChartOrMapType } from "@ourworldindata/types" @@ -27,7 +27,7 @@ interface ColorSchemeDropdownProps { } @observer -export class ColorSchemeDropdown extends React.Component { +export class ColorSchemeDropdown extends Component { static defaultProps = { additionalOptions: [], gradientColorCount: 6, diff --git a/adminSiteClient/Colorpicker.tsx b/adminSiteClient/Colorpicker.tsx index c14536d145d..0f4cc772c4b 100644 --- a/adminSiteClient/Colorpicker.tsx +++ b/adminSiteClient/Colorpicker.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component, Fragment } from "react" import { action } from "mobx" import { observer } from "mobx-react" import { SketchPicker } from "react-color" @@ -16,7 +16,7 @@ interface ColorpickerProps { } @observer -export class Colorpicker extends React.Component { +export class Colorpicker extends Component { @action.bound onColor(color: string) { if (color === "") { this.props.onColor(undefined) @@ -39,7 +39,7 @@ export class Colorpicker extends React.Component { } return ( - + ({ @@ -49,7 +49,7 @@ export class Colorpicker extends React.Component { color={this.props.color} onChange={(color) => this.onColor(color.hex)} /> - + ) } } diff --git a/adminSiteClient/DatasetEditPage.tsx b/adminSiteClient/DatasetEditPage.tsx index ca076d32719..45811fd639a 100644 --- a/adminSiteClient/DatasetEditPage.tsx +++ b/adminSiteClient/DatasetEditPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, computed, runInAction, action } from "mobx" import * as lodash from "lodash" @@ -79,7 +79,7 @@ class DatasetEditable { } @observer -class DatasetTagEditor extends React.Component<{ +class DatasetTagEditor extends Component<{ newDataset: DatasetEditable availableTags: { id: number; name: string; parentName: string }[] }> { @@ -104,7 +104,7 @@ class DatasetTagEditor extends React.Component<{ } @observer -class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> { +class DatasetEditor extends Component<{ dataset: DatasetPageData }> { static contextType = AdminAppContext context!: AdminAppContextType @observable newDataset!: DatasetEditable @@ -405,7 +405,7 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> { } @observer -export class DatasetEditPage extends React.Component<{ datasetId: number }> { +export class DatasetEditPage extends Component<{ datasetId: number }> { static contextType = AdminAppContext context!: AdminAppContextType @observable dataset?: DatasetPageData diff --git a/adminSiteClient/DatasetList.tsx b/adminSiteClient/DatasetList.tsx index f05b59040bc..67c073d480e 100644 --- a/adminSiteClient/DatasetList.tsx +++ b/adminSiteClient/DatasetList.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observable, action } from "mobx" import { observer } from "mobx-react" import * as lodash from "lodash" diff --git a/adminSiteClient/DatasetsIndexPage.tsx b/adminSiteClient/DatasetsIndexPage.tsx index dcc8fcad4f0..f99feac1670 100644 --- a/adminSiteClient/DatasetsIndexPage.tsx +++ b/adminSiteClient/DatasetsIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, computed, action, runInAction } from "mobx" import * as lodash from "lodash" @@ -15,7 +15,7 @@ import { } from "../adminShared/search.js" @observer -export class DatasetsIndexPage extends React.Component { +export class DatasetsIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/DeployStatusPage.tsx b/adminSiteClient/DeployStatusPage.tsx index 9bbb1070113..d9541f2ca1c 100644 --- a/adminSiteClient/DeployStatusPage.tsx +++ b/adminSiteClient/DeployStatusPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { action, observable, runInAction } from "mobx" @@ -16,7 +16,7 @@ const statusLabel: Record = { } @observer -export class DeployStatusPage extends React.Component { +export class DeployStatusPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/DimensionCard.tsx b/adminSiteClient/DimensionCard.tsx index 4053be981d3..db3d094a02c 100644 --- a/adminSiteClient/DimensionCard.tsx +++ b/adminSiteClient/DimensionCard.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component, Fragment } from "react" import { observable, computed, action } from "mobx" import { observer } from "mobx-react" import { ChartDimension } from "@ourworldindata/grapher" @@ -27,7 +27,7 @@ import { AbstractChartEditor } from "./AbstractChartEditor.js" @observer export class DimensionCard< Editor extends AbstractChartEditor, -> extends React.Component<{ +> extends Component<{ dimension: ChartDimension editor: Editor isDndEnabled?: boolean @@ -70,7 +70,7 @@ export class DimensionCard< private get tableDisplaySettings() { const { tableDisplay = {} } = this.props.dimension.display return ( - +
Table:
-
+ ) } diff --git a/adminSiteClient/EditTags.tsx b/adminSiteClient/EditTags.tsx index 11ebfd074d0..e0310902898 100644 --- a/adminSiteClient/EditTags.tsx +++ b/adminSiteClient/EditTags.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { createRef, Component } from "react" import { action } from "mobx" import { observer } from "mobx-react" import { DbChartTagJoin } from "@ourworldindata/utils" @@ -9,7 +9,7 @@ import { } from "react-tag-autocomplete" @observer -export class EditTags extends React.Component<{ +export class EditTags extends Component<{ tags: DbChartTagJoin[] suggestions: DbChartTagJoin[] onDelete: (index: number) => void @@ -17,7 +17,7 @@ export class EditTags extends React.Component<{ onSave: () => void }> { dismissable: boolean = true - reactTagsApi = React.createRef() + reactTagsApi = createRef() @action.bound onClickSomewhere() { if (this.dismissable) this.props.onSave() diff --git a/adminSiteClient/EditableTags.tsx b/adminSiteClient/EditableTags.tsx index 1d3fab38a31..a9194f3ac76 100644 --- a/adminSiteClient/EditableTags.tsx +++ b/adminSiteClient/EditableTags.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import * as lodash from "lodash" import { observable, action } from "mobx" import { observer } from "mobx-react" diff --git a/adminSiteClient/EditorBasicTab.tsx b/adminSiteClient/EditorBasicTab.tsx index f3ebebb0ee6..9b89b12bbfc 100644 --- a/adminSiteClient/EditorBasicTab.tsx +++ b/adminSiteClient/EditorBasicTab.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observable, action, diff --git a/adminSiteClient/EditorColorScaleSection.tsx b/adminSiteClient/EditorColorScaleSection.tsx index fe6753d1276..bfd1511f16f 100644 --- a/adminSiteClient/EditorColorScaleSection.tsx +++ b/adminSiteClient/EditorColorScaleSection.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component, Fragment } from "react" import { action, computed, runInAction } from "mobx" import { observer } from "mobx-react" import Select from "react-select" @@ -41,7 +41,7 @@ interface EditorColorScaleSectionFeatures { } @observer -export class EditorColorScaleSection extends React.Component<{ +export class EditorColorScaleSection extends Component<{ scale: ColorScale chartType: GrapherChartOrMapType features: EditorColorScaleSectionFeatures @@ -50,7 +50,7 @@ export class EditorColorScaleSection extends React.Component<{ }> { render() { return ( - + - + ) } } @observer -class ColorLegendSection extends React.Component<{ +class ColorLegendSection extends Component<{ scale: ColorScale features: EditorColorScaleSectionFeatures onChange?: () => void @@ -130,7 +130,7 @@ class ColorLegendSection extends React.Component<{ } @observer -class ColorsSection extends React.Component<{ +class ColorsSection extends Component<{ scale: ColorScale chartType: GrapherChartOrMapType showLineChartColors: boolean @@ -275,7 +275,7 @@ class ColorsSection extends React.Component<{ } @observer -class ColorSchemeEditor extends React.Component<{ +class ColorSchemeEditor extends Component<{ scale: ColorScale showLineChartColors: boolean onChange?: () => void @@ -319,7 +319,7 @@ class ColorSchemeEditor extends React.Component<{ } @observer -class BinLabelView extends React.Component<{ +class BinLabelView extends Component<{ scale: ColorScale bin: ColorScaleBin index: number @@ -385,7 +385,7 @@ function populateManualBinValuesIfAutomatic(scale: ColorScale) { } @observer -class NumericBinView extends React.Component<{ +class NumericBinView extends Component<{ scale: ColorScale bin: NumericBin index: number @@ -492,7 +492,7 @@ class NumericBinView extends React.Component<{ } @observer -class CategoricalBinView extends React.Component<{ +class CategoricalBinView extends Component<{ scale: ColorScale bin: CategoricalBin showLineChartColors: boolean diff --git a/adminSiteClient/EditorCustomizeTab.tsx b/adminSiteClient/EditorCustomizeTab.tsx index 7f92dd1fb09..9a72f56549b 100644 --- a/adminSiteClient/EditorCustomizeTab.tsx +++ b/adminSiteClient/EditorCustomizeTab.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observable, computed, action } from "mobx" import { observer } from "mobx-react" import { diff --git a/adminSiteClient/EditorDataTab.tsx b/adminSiteClient/EditorDataTab.tsx index 84c15f868b6..82ba1dc8021 100644 --- a/adminSiteClient/EditorDataTab.tsx +++ b/adminSiteClient/EditorDataTab.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { differenceOfSets, moveArrayItemToIndex, diff --git a/adminSiteClient/EditorDebugTab.tsx b/adminSiteClient/EditorDebugTab.tsx index 566f5087de6..ba5ffbc2dde 100644 --- a/adminSiteClient/EditorDebugTab.tsx +++ b/adminSiteClient/EditorDebugTab.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { Section, Toggle } from "./Forms.js" import { ChartEditor, isChartEditorInstance } from "./ChartEditor.js" @@ -26,7 +26,7 @@ import { stringify } from "safe-stable-stringify" @observer export class EditorDebugTab< Editor extends AbstractChartEditor, -> extends React.Component<{ +> extends Component<{ editor: Editor }> { render() { @@ -42,7 +42,7 @@ export class EditorDebugTab< } @observer -class EditorDebugTabForChart extends React.Component<{ +class EditorDebugTabForChart extends Component<{ editor: ChartEditor }> { @action.bound copyYamlToClipboard() { @@ -200,7 +200,7 @@ class EditorDebugTabForChart extends React.Component<{ } @observer -class EditorDebugTabForChartView extends React.Component<{ +class EditorDebugTabForChartView extends Component<{ editor: ChartViewEditor }> { @action.bound copyYamlToClipboard() { @@ -340,7 +340,7 @@ class EditorDebugTabForChartView extends React.Component<{ } @observer -class EditorDebugTabForIndicatorChart extends React.Component<{ +class EditorDebugTabForIndicatorChart extends Component<{ editor: IndicatorChartEditor }> { render() { diff --git a/adminSiteClient/EditorExportTab.tsx b/adminSiteClient/EditorExportTab.tsx index 84fa7bac40a..ccbd59d7f3e 100644 --- a/adminSiteClient/EditorExportTab.tsx +++ b/adminSiteClient/EditorExportTab.tsx @@ -1,6 +1,6 @@ import { IReactionDisposer, action, autorun, computed, observable } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component } from "react" import { Section, Toggle } from "./Forms.js" import { Grapher } from "@ourworldindata/grapher" import { @@ -59,7 +59,7 @@ interface EditorExportTabProps { @observer export class EditorExportTab< Editor extends AbstractChartEditor, -> extends React.Component> { +> extends Component> { @observable private settings = DEFAULT_SETTINGS private originalSettings: Partial = DEFAULT_SETTINGS private originalGrapher: OriginalGrapher diff --git a/adminSiteClient/EditorFAQ.tsx b/adminSiteClient/EditorFAQ.tsx index 7b3b2e660ce..7abee1f4d66 100644 --- a/adminSiteClient/EditorFAQ.tsx +++ b/adminSiteClient/EditorFAQ.tsx @@ -1,9 +1,9 @@ -import React from "react" +import { Component } from "react" import { Modal } from "./Forms.js" import { faLink, faUnlink } from "@fortawesome/free-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" -export class EditorFAQ extends React.Component<{ onClose: () => void }> { +export class EditorFAQ extends Component<{ onClose: () => void }> { render() { return ( diff --git a/adminSiteClient/EditorHistoryTab.tsx b/adminSiteClient/EditorHistoryTab.tsx index 99c3cbf00c7..8eed5f62d4d 100644 --- a/adminSiteClient/EditorHistoryTab.tsx +++ b/adminSiteClient/EditorHistoryTab.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { ChartEditor, Log } from "./ChartEditor.js" import { Timeago } from "./Forms.js" @@ -51,7 +51,7 @@ function LogCompareModal({ } @observer -class LogRenderer extends React.Component<{ +class LogRenderer extends Component<{ log: Log previousLog: Log | undefined }> { @@ -102,7 +102,7 @@ class LogRenderer extends React.Component<{ } @observer -export class EditorHistoryTab extends React.Component<{ editor: ChartEditor }> { +export class EditorHistoryTab extends Component<{ editor: ChartEditor }> { @computed get logs() { return this.props.editor.logs || [] } diff --git a/adminSiteClient/EditorMapTab.tsx b/adminSiteClient/EditorMapTab.tsx index 51d5b2b689f..a5a7a462bfa 100644 --- a/adminSiteClient/EditorMapTab.tsx +++ b/adminSiteClient/EditorMapTab.tsx @@ -12,13 +12,13 @@ import { import { ColumnSlug, isEmpty, ToleranceStrategy } from "@ourworldindata/utils" import { action, computed } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component, Fragment } from "react" import { EditorColorScaleSection } from "./EditorColorScaleSection.js" import { NumberField, Section, SelectField, Toggle } from "./Forms.js" import { AbstractChartEditor } from "./AbstractChartEditor.js" @observer -class VariableSection extends React.Component<{ +class VariableSection extends Component<{ mapConfig: MapConfig filledDimensions: ChartDimension[] parentConfig?: GrapherInterface @@ -77,7 +77,7 @@ class VariableSection extends React.Component<{ } @observer -class TimelineSection extends React.Component<{ mapConfig: MapConfig }> { +class TimelineSection extends Component<{ mapConfig: MapConfig }> { @action.bound onToggleHideTimeline(value: boolean) { this.props.mapConfig.hideTimeline = value || undefined } @@ -150,7 +150,7 @@ class TimelineSection extends React.Component<{ mapConfig: MapConfig }> { } @observer -class TooltipSection extends React.Component<{ mapConfig: MapConfig }> { +class TooltipSection extends Component<{ mapConfig: MapConfig }> { @action.bound onTooltipUseCustomLabels(tooltipUseCustomLabels: boolean) { this.props.mapConfig.tooltipUseCustomLabels = tooltipUseCustomLabels ? true @@ -176,7 +176,7 @@ class TooltipSection extends React.Component<{ mapConfig: MapConfig }> { @observer export class EditorMapTab< Editor extends AbstractChartEditor, -> extends React.Component<{ editor: Editor }> { +> extends Component<{ editor: Editor }> { @computed get grapher() { return this.props.editor.grapher } @@ -198,7 +198,7 @@ export class EditorMapTab< parentConfig={this.props.editor.activeParentConfig} /> {isReady && ( - + - + )} ) diff --git a/adminSiteClient/EditorMarimekkoTab.tsx b/adminSiteClient/EditorMarimekkoTab.tsx index bc816a149e3..2e1ffd7c300 100644 --- a/adminSiteClient/EditorMarimekkoTab.tsx +++ b/adminSiteClient/EditorMarimekkoTab.tsx @@ -6,11 +6,11 @@ import { excludeUndefined } from "@ourworldindata/utils" import lodash from "lodash" import { action, computed, IReactionDisposer, observable, reaction } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component } from "react" import { NumberField, Section, SelectField, Toggle } from "./Forms.js" @observer -export class EditorMarimekkoTab extends React.Component<{ grapher: Grapher }> { +export class EditorMarimekkoTab extends Component<{ grapher: Grapher }> { @observable xOverrideTimeInputField: number | undefined constructor(props: { grapher: Grapher }) { super(props) diff --git a/adminSiteClient/EditorReferencesTab.tsx b/adminSiteClient/EditorReferencesTab.tsx index 3fc2d0b6d24..5e91f173003 100644 --- a/adminSiteClient/EditorReferencesTab.tsx +++ b/adminSiteClient/EditorReferencesTab.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component, Fragment } from "react" import { observer } from "mobx-react" import { ChartEditor, @@ -28,7 +28,7 @@ const BASE_URL = BAKED_GRAPHER_URL.replace(/^https?:\/\//, "") @observer export class EditorReferencesTab< Editor extends AbstractChartEditor, -> extends React.Component<{ +> extends Component<{ editor: Editor }> { render() { @@ -163,7 +163,7 @@ export const ReferencesSection = (props: { } @observer -export class EditorReferencesTabForChart extends React.Component<{ +export class EditorReferencesTabForChart extends Component<{ editor: ChartEditor }> { @computed get isPersisted() { @@ -232,7 +232,7 @@ export class EditorReferencesTabForChart extends React.Component<{
Alternative URLs for this chart
{this.redirects.length ? ( - +

The following URLs redirect to this chart:

    {this.redirects.map((redirect) => ( @@ -254,7 +254,7 @@ export class EditorReferencesTabForChart extends React.Component<{ ))}

-
+ ) : null} {this.isPersisted && ( extends React.Component<{ +class AddRedirectForm extends Component<{ editor: Editor onSuccess: (redirect: ChartRedirect) => void }> { @@ -356,7 +354,7 @@ class AddRedirectForm< } @observer -export class EditorReferencesTabForIndicator extends React.Component<{ +export class EditorReferencesTabForIndicator extends Component<{ editor: IndicatorChartEditor }> { render() { diff --git a/adminSiteClient/EditorScatterTab.tsx b/adminSiteClient/EditorScatterTab.tsx index 9692b6cd6d8..582f4489d19 100644 --- a/adminSiteClient/EditorScatterTab.tsx +++ b/adminSiteClient/EditorScatterTab.tsx @@ -9,11 +9,11 @@ import { Grapher } from "@ourworldindata/grapher" import { debounce, excludeUndefined } from "@ourworldindata/utils" import { action, computed, observable } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component } from "react" import { NumberField, Section, SelectField, Toggle } from "./Forms.js" @observer -export class EditorScatterTab extends React.Component<{ grapher: Grapher }> { +export class EditorScatterTab extends Component<{ grapher: Grapher }> { @observable comparisonLine: ComparisonLineConfig = { yEquals: undefined } constructor(props: { grapher: Grapher }) { diff --git a/adminSiteClient/EditorTextTab.tsx b/adminSiteClient/EditorTextTab.tsx index da032de3bdf..b259827bdd7 100644 --- a/adminSiteClient/EditorTextTab.tsx +++ b/adminSiteClient/EditorTextTab.tsx @@ -5,7 +5,7 @@ import { getErrorMessageRelatedQuestionUrl } from "@ourworldindata/grapher" import { slugify } from "@ourworldindata/utils" import { action, computed } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component } from "react" import { isChartEditorInstance } from "./ChartEditor.js" import { AutoTextField, @@ -23,7 +23,7 @@ import { ErrorMessages } from "./ChartEditorTypes.js" @observer export class EditorTextTab< Editor extends AbstractChartEditor, -> extends React.Component<{ editor: Editor; errorMessages: ErrorMessages }> { +> extends Component<{ editor: Editor; errorMessages: ErrorMessages }> { @action.bound onSlug(slug: string) { this.props.editor.grapher.slug = slugify(slug) } diff --git a/adminSiteClient/ExplorerTagsPage.tsx b/adminSiteClient/ExplorerTagsPage.tsx index ea25262789a..6390bae3f86 100644 --- a/adminSiteClient/ExplorerTagsPage.tsx +++ b/adminSiteClient/ExplorerTagsPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { action, computed, observable, runInAction } from "mobx" @@ -19,7 +19,7 @@ type ExplorerWithTags = { } @observer -export class ExplorerTagsPage extends React.Component { +export class ExplorerTagsPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType @observable explorersWithTags: ExplorerWithTags[] = [] diff --git a/adminSiteClient/Forms.tsx b/adminSiteClient/Forms.tsx index 5db987cd779..5dcd325c582 100644 --- a/adminSiteClient/Forms.tsx +++ b/adminSiteClient/Forms.tsx @@ -4,7 +4,7 @@ * Reusable React components to keep admin UI succint and consistent */ -import React from "react" +import * as React from "react" import { bind } from "decko" import { action } from "mobx" import { observer } from "mobx-react" diff --git a/adminSiteClient/GdocsAdd.tsx b/adminSiteClient/GdocsAdd.tsx index 6a01770cef8..503820b745d 100644 --- a/adminSiteClient/GdocsAdd.tsx +++ b/adminSiteClient/GdocsAdd.tsx @@ -1,5 +1,5 @@ import { GDOCS_URL_PLACEHOLDER, gdocUrlRegex } from "@ourworldindata/utils" -import React from "react" +import * as React from "react" import { GDOCS_BASIC_ARTICLE_TEMPLATE_URL, GDOCS_CLIENT_EMAIL, diff --git a/adminSiteClient/GdocsBreadcrumbsInput.tsx b/adminSiteClient/GdocsBreadcrumbsInput.tsx index bed28d02554..094e7188cba 100644 --- a/adminSiteClient/GdocsBreadcrumbsInput.tsx +++ b/adminSiteClient/GdocsBreadcrumbsInput.tsx @@ -6,7 +6,6 @@ import { OwidGdocPostInterface, } from "@ourworldindata/utils" import { Button, Col, Input, Row } from "antd" -import React from "react" import { getPropertyMostCriticalError } from "./gdocsValidation.js" import { GdocsErrorHelp } from "./GdocsErrorHelp.js" diff --git a/adminSiteClient/GdocsDateline.tsx b/adminSiteClient/GdocsDateline.tsx index 3c38fb94b57..67bbb192a85 100644 --- a/adminSiteClient/GdocsDateline.tsx +++ b/adminSiteClient/GdocsDateline.tsx @@ -1,7 +1,6 @@ import { Col, DatePicker } from "antd" import { Dayjs } from "dayjs" import { dayjs, OwidGdocErrorMessage, OwidGdoc } from "@ourworldindata/utils" -import React from "react" import { PUBLISHED_AT_FORMAT } from "../settings/clientSettings" import { getPropertyMostCriticalError } from "./gdocsValidation.js" import { GdocsErrorHelp } from "./GdocsErrorHelp.js" diff --git a/adminSiteClient/GdocsDiff.tsx b/adminSiteClient/GdocsDiff.tsx index b056d34229f..15c2048ac93 100644 --- a/adminSiteClient/GdocsDiff.tsx +++ b/adminSiteClient/GdocsDiff.tsx @@ -1,4 +1,3 @@ -import React from "react" import ReactDiffViewer, { DiffMethod } from "react-diff-viewer-continued" import { stringify } from "safe-stable-stringify" import { omit, OwidGdoc } from "@ourworldindata/utils" diff --git a/adminSiteClient/GdocsDiffButton.tsx b/adminSiteClient/GdocsDiffButton.tsx index 26c934a31b3..5805e6b10e3 100644 --- a/adminSiteClient/GdocsDiffButton.tsx +++ b/adminSiteClient/GdocsDiffButton.tsx @@ -1,5 +1,4 @@ import { Badge, Button } from "antd" -import React from "react" export const GdocsDiffButton = ({ hasChanges, diff --git a/adminSiteClient/GdocsEditLink.tsx b/adminSiteClient/GdocsEditLink.tsx index a1562625c4c..37c3e4499ce 100644 --- a/adminSiteClient/GdocsEditLink.tsx +++ b/adminSiteClient/GdocsEditLink.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { faEdit } from "@fortawesome/free-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/adminSiteClient/GdocsErrorHelp.tsx b/adminSiteClient/GdocsErrorHelp.tsx index e9e3045cbcd..1e6775046cb 100644 --- a/adminSiteClient/GdocsErrorHelp.tsx +++ b/adminSiteClient/GdocsErrorHelp.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Help } from "./Forms.js" import { OwidGdocErrorMessage } from "@ourworldindata/utils" diff --git a/adminSiteClient/GdocsIndexPage.tsx b/adminSiteClient/GdocsIndexPage.tsx index b6dfce756e1..77046b3c589 100644 --- a/adminSiteClient/GdocsIndexPage.tsx +++ b/adminSiteClient/GdocsIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import cx from "classnames" import { AdminLayout } from "./AdminLayout.js" import { Modal, SearchField } from "./Forms.js" diff --git a/adminSiteClient/GdocsMoreMenu.tsx b/adminSiteClient/GdocsMoreMenu.tsx index 2c203f8222c..0cf48939a86 100644 --- a/adminSiteClient/GdocsMoreMenu.tsx +++ b/adminSiteClient/GdocsMoreMenu.tsx @@ -1,4 +1,3 @@ -import * as React from "react" import { useState } from "react" import { Dropdown, Button, Modal, Form, Checkbox, Input } from "antd" import { diff --git a/adminSiteClient/GdocsPreviewPage.tsx b/adminSiteClient/GdocsPreviewPage.tsx index 62f1fac5dff..49844dd7baf 100644 --- a/adminSiteClient/GdocsPreviewPage.tsx +++ b/adminSiteClient/GdocsPreviewPage.tsx @@ -1,10 +1,5 @@ -import React, { - useCallback, - useContext, - useEffect, - useRef, - useState, -} from "react" +import { useCallback, useContext, useEffect, useRef, useState } from "react" +import * as React from "react" import { AdminLayout } from "./AdminLayout.js" import { GdocsMatchProps } from "./GdocsIndexPage.js" import { diff --git a/adminSiteClient/GdocsPublicationContext.tsx b/adminSiteClient/GdocsPublicationContext.tsx index b217e22307b..d9af1afb958 100644 --- a/adminSiteClient/GdocsPublicationContext.tsx +++ b/adminSiteClient/GdocsPublicationContext.tsx @@ -3,7 +3,6 @@ import { OwidGdocPublicationContext, OwidGdocPostInterface, } from "@ourworldindata/utils" -import React from "react" import { GdocsErrorHelp } from "./GdocsErrorHelp.js" export const GdocsPublicationContext = ({ diff --git a/adminSiteClient/GdocsSaveButtons.tsx b/adminSiteClient/GdocsSaveButtons.tsx index 204307d63e1..663845f1c58 100644 --- a/adminSiteClient/GdocsSaveButtons.tsx +++ b/adminSiteClient/GdocsSaveButtons.tsx @@ -1,5 +1,4 @@ import { Badge, Button, Modal, Space } from "antd" -import React from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faExclamationTriangle, diff --git a/adminSiteClient/GdocsSettingsContentField.tsx b/adminSiteClient/GdocsSettingsContentField.tsx index b9954d7a881..1352e78c632 100644 --- a/adminSiteClient/GdocsSettingsContentField.tsx +++ b/adminSiteClient/GdocsSettingsContentField.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Input, InputProps } from "antd" import { OwidGdocPostInterface, diff --git a/adminSiteClient/GdocsSettingsForms.tsx b/adminSiteClient/GdocsSettingsForms.tsx index abe21772f04..a1911068063 100644 --- a/adminSiteClient/GdocsSettingsForms.tsx +++ b/adminSiteClient/GdocsSettingsForms.tsx @@ -1,4 +1,3 @@ -import React from "react" import { OwidGdocPostInterface, OwidGdocErrorMessage, diff --git a/adminSiteClient/GdocsSlug.tsx b/adminSiteClient/GdocsSlug.tsx index f5231be281d..4e79f111f89 100644 --- a/adminSiteClient/GdocsSlug.tsx +++ b/adminSiteClient/GdocsSlug.tsx @@ -1,5 +1,5 @@ import { Col, Input, Row, Space, Switch } from "antd" -import React, { useEffect, useState } from "react" +import { useEffect, useState } from "react" import { slugify, OwidGdocErrorMessage, OwidGdoc } from "@ourworldindata/utils" import { Help } from "./Forms.js" import { getPropertyMostCriticalError } from "./gdocsValidation.js" diff --git a/adminSiteClient/GdocsStore.tsx b/adminSiteClient/GdocsStore.tsx index 1a7b11c387f..996b1e6e7bf 100644 --- a/adminSiteClient/GdocsStore.tsx +++ b/adminSiteClient/GdocsStore.tsx @@ -1,4 +1,5 @@ -import React, { useContext, createContext, useState } from "react" +import { useContext, createContext, useState } from "react" +import * as React from "react" import { action, observable } from "mobx" import { getOwidGdocFromJSON, diff --git a/adminSiteClient/GrapherConfigGridEditor.tsx b/adminSiteClient/GrapherConfigGridEditor.tsx index 4c7ae6f7cfa..d4539d9b765 100644 --- a/adminSiteClient/GrapherConfigGridEditor.tsx +++ b/adminSiteClient/GrapherConfigGridEditor.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Bounds, stringifyUnknownError, diff --git a/adminSiteClient/GrapherConfigGridEditorTypesAndUtils.tsx b/adminSiteClient/GrapherConfigGridEditorTypesAndUtils.tsx index 7b64b395875..3de0bbc4288 100644 --- a/adminSiteClient/GrapherConfigGridEditorTypesAndUtils.tsx +++ b/adminSiteClient/GrapherConfigGridEditorTypesAndUtils.tsx @@ -36,7 +36,6 @@ import { EditorOption, FieldDescription, } from "../adminShared/schemaProcessing.js" -import React from "react" import { IconDefinition } from "@fortawesome/fontawesome-common-types" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/adminSiteClient/IconBadge.tsx b/adminSiteClient/IconBadge.tsx index 1fac97ae4a6..4c084474b1d 100644 --- a/adminSiteClient/IconBadge.tsx +++ b/adminSiteClient/IconBadge.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faExclamationTriangle, diff --git a/adminSiteClient/ImagesIndexPage.tsx b/adminSiteClient/ImagesIndexPage.tsx index ecd8a452f91..1de6114e21b 100644 --- a/adminSiteClient/ImagesIndexPage.tsx +++ b/adminSiteClient/ImagesIndexPage.tsx @@ -1,4 +1,5 @@ -import React, { +import { + createContext, useCallback, useContext, useEffect, @@ -503,7 +504,7 @@ function PutImageButton({ ) } -const NotificationContext = React.createContext(null) +const NotificationContext = createContext(null) export function ImageIndexPage() { const { admin } = useContext(AdminAppContext) diff --git a/adminSiteClient/Link.tsx b/adminSiteClient/Link.tsx index e6baf1260ba..d9648e74d6e 100644 --- a/adminSiteClient/Link.tsx +++ b/adminSiteClient/Link.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { NavLink } from "react-router-dom" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" diff --git a/adminSiteClient/NotFoundPage.tsx b/adminSiteClient/NotFoundPage.tsx index 99ebc68f5ca..eefc12af9a3 100644 --- a/adminSiteClient/NotFoundPage.tsx +++ b/adminSiteClient/NotFoundPage.tsx @@ -1,9 +1,9 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { AdminLayout } from "./AdminLayout.js" @observer -export class NotFoundPage extends React.Component { +export class NotFoundPage extends Component { render() { return ( diff --git a/adminSiteClient/OriginList.tsx b/adminSiteClient/OriginList.tsx index 19e8ec28e49..ffb36c46f35 100644 --- a/adminSiteClient/OriginList.tsx +++ b/adminSiteClient/OriginList.tsx @@ -1,11 +1,11 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" import { OwidOrigin } from "@ourworldindata/utils" import { BindString, FieldsRow } from "./Forms.js" @observer -export class OriginList extends React.Component<{ +export class OriginList extends Component<{ origins: OwidOrigin[] }> { static contextType = AdminAppContext diff --git a/adminSiteClient/PostEditorPage.tsx b/adminSiteClient/PostEditorPage.tsx index b7e13e752dd..c1c03f60918 100644 --- a/adminSiteClient/PostEditorPage.tsx +++ b/adminSiteClient/PostEditorPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, runInAction } from "mobx" @@ -15,7 +15,7 @@ interface Post { content: string } -class PostEditor extends React.Component<{ post: Post }> { +class PostEditor extends Component<{ post: Post }> { render() { const { post } = this.props return ( @@ -29,7 +29,7 @@ class PostEditor extends React.Component<{ post: Post }> { } @observer -export class PostEditorPage extends React.Component<{ postId?: number }> { +export class PostEditorPage extends Component<{ postId?: number }> { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/PostsIndexPage.tsx b/adminSiteClient/PostsIndexPage.tsx index 6393a19efb6..e06771ceb6b 100644 --- a/adminSiteClient/PostsIndexPage.tsx +++ b/adminSiteClient/PostsIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, computed, action, runInAction } from "mobx" @@ -54,7 +54,7 @@ interface PostRowProps { } @observer -class PostRow extends React.Component { +class PostRow extends Component { static contextType = AdminAppContext context!: AdminAppContextType @@ -240,7 +240,7 @@ class PostRow extends React.Component { } @observer -export class PostsIndexPage extends React.Component { +export class PostsIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/RedirectsIndexPage.tsx b/adminSiteClient/RedirectsIndexPage.tsx index 57b000ead87..0f5a0a2a7cd 100644 --- a/adminSiteClient/RedirectsIndexPage.tsx +++ b/adminSiteClient/RedirectsIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, action, runInAction } from "mobx" import { AdminLayout } from "./AdminLayout.js" @@ -14,7 +14,7 @@ interface RedirectListItem { } @observer -class RedirectRow extends React.Component<{ +class RedirectRow extends Component<{ redirect: RedirectListItem onDelete: (redirect: RedirectListItem) => void }> { @@ -46,7 +46,7 @@ class RedirectRow extends React.Component<{ } @observer -export class RedirectsIndexPage extends React.Component { +export class RedirectsIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/SaveButtons.tsx b/adminSiteClient/SaveButtons.tsx index dbb9ed71714..ce63127a917 100644 --- a/adminSiteClient/SaveButtons.tsx +++ b/adminSiteClient/SaveButtons.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { ChartEditor, isChartEditorInstance } from "./ChartEditor.js" import { action, computed } from "mobx" import { observer } from "mobx-react" @@ -19,9 +19,7 @@ import { } from "./ChartViewEditor.js" @observer -export class SaveButtons< - Editor extends AbstractChartEditor, -> extends React.Component<{ +export class SaveButtons extends Component<{ editor: Editor errorMessages: ErrorMessages errorMessagesForDimensions: ErrorMessagesForDimensions @@ -50,7 +48,7 @@ export class SaveButtons< } @observer -class SaveButtonsForChart extends React.Component<{ +class SaveButtonsForChart extends Component<{ editor: ChartEditor errorMessages: ErrorMessages errorMessagesForDimensions: ErrorMessagesForDimensions @@ -140,7 +138,7 @@ class SaveButtonsForChart extends React.Component<{ } @observer -class SaveButtonsForIndicatorChart extends React.Component<{ +class SaveButtonsForIndicatorChart extends Component<{ editor: IndicatorChartEditor errorMessages: ErrorMessages errorMessagesForDimensions: ErrorMessagesForDimensions @@ -189,7 +187,7 @@ class SaveButtonsForIndicatorChart extends React.Component<{ } @observer -class SaveButtonsForChartView extends React.Component<{ +class SaveButtonsForChartView extends Component<{ editor: ChartViewEditor errorMessages: ErrorMessages errorMessagesForDimensions: ErrorMessagesForDimensions diff --git a/adminSiteClient/SiteRedirectsIndexPage.tsx b/adminSiteClient/SiteRedirectsIndexPage.tsx index 30fdc567fb5..1fea807c0c7 100644 --- a/adminSiteClient/SiteRedirectsIndexPage.tsx +++ b/adminSiteClient/SiteRedirectsIndexPage.tsx @@ -1,5 +1,5 @@ import cx from "classnames" -import React, { useContext, useEffect, useState } from "react" +import { useContext, useEffect, useState } from "react" import { useForm } from "react-hook-form" import { BAKED_BASE_URL } from "../settings/clientSettings.js" diff --git a/adminSiteClient/SourceEditPage.tsx b/adminSiteClient/SourceEditPage.tsx index 62b1424ee16..98fd43f282f 100644 --- a/adminSiteClient/SourceEditPage.tsx +++ b/adminSiteClient/SourceEditPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, computed, runInAction } from "mobx" import { Prompt } from "react-router-dom" @@ -43,7 +43,7 @@ class SourceEditable { } @observer -class SourceEditor extends React.Component<{ source: SourcePageData }> { +class SourceEditor extends Component<{ source: SourcePageData }> { @observable newSource!: SourceEditable @observable isDeleted: boolean = false @@ -162,7 +162,7 @@ class SourceEditor extends React.Component<{ source: SourcePageData }> { } @observer -export class SourceEditPage extends React.Component<{ sourceId: number }> { +export class SourceEditPage extends Component<{ sourceId: number }> { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/SourceList.tsx b/adminSiteClient/SourceList.tsx index b304b23cfc0..a5e9a23ef62 100644 --- a/adminSiteClient/SourceList.tsx +++ b/adminSiteClient/SourceList.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" import { OwidSource } from "@ourworldindata/utils" @@ -7,7 +7,7 @@ import { BindString } from "./Forms.js" const MAX_SOURCES = 10 @observer -export class SourceList extends React.Component<{ +export class SourceList extends Component<{ sources: OwidSource[] }> { static contextType = AdminAppContext diff --git a/adminSiteClient/TagBadge.tsx b/adminSiteClient/TagBadge.tsx index c55d7427f55..5b2842d2d34 100644 --- a/adminSiteClient/TagBadge.tsx +++ b/adminSiteClient/TagBadge.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { KeyChartLevel, DbChartTagJoin } from "@ourworldindata/utils" diff --git a/adminSiteClient/TagBucketSortingIcon.tsx b/adminSiteClient/TagBucketSortingIcon.tsx index cc62391ce2e..d91302402c3 100644 --- a/adminSiteClient/TagBucketSortingIcon.tsx +++ b/adminSiteClient/TagBucketSortingIcon.tsx @@ -1,4 +1,3 @@ -import React from "react" import { KeyChartLevel } from "@ourworldindata/utils" export const TagBucketSortingIcon = ({ level }: { level?: number }) => { diff --git a/adminSiteClient/TagEditPage.tsx b/adminSiteClient/TagEditPage.tsx index 374bab4a4d2..cfb8faff084 100644 --- a/adminSiteClient/TagEditPage.tsx +++ b/adminSiteClient/TagEditPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, computed, runInAction } from "mobx" import { Prompt, Redirect } from "react-router-dom" @@ -33,7 +33,7 @@ class TagEditable { } @observer -class TagEditor extends React.Component<{ tag: TagPageData }> { +class TagEditor extends Component<{ tag: TagPageData }> { static contextType = AdminAppContext context!: AdminAppContextType @@ -177,7 +177,7 @@ class TagEditor extends React.Component<{ tag: TagPageData }> { } @observer -export class TagEditPage extends React.Component<{ tagId: number }> { +export class TagEditPage extends Component<{ tagId: number }> { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/TagGraphPage.tsx b/adminSiteClient/TagGraphPage.tsx index a1cef3caf5f..de645718441 100644 --- a/adminSiteClient/TagGraphPage.tsx +++ b/adminSiteClient/TagGraphPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { observable, action, runInAction, toJS, computed } from "mobx" import * as lodash from "lodash" diff --git a/adminSiteClient/TagsIndexPage.tsx b/adminSiteClient/TagsIndexPage.tsx index 1c6412de2b3..1dcd5078a79 100644 --- a/adminSiteClient/TagsIndexPage.tsx +++ b/adminSiteClient/TagsIndexPage.tsx @@ -1,5 +1,5 @@ import { observer } from "mobx-react" -import React from "react" +import { Component } from "react" import { AdminLayout } from "./AdminLayout.js" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" import { observable, runInAction } from "mobx" @@ -9,7 +9,7 @@ import { Link } from "react-router-dom" import { Button, Modal } from "antd" @observer -export class TagsIndexPage extends React.Component { +export class TagsIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/TestIndexPage.tsx b/adminSiteClient/TestIndexPage.tsx index 69753bd433d..1810d3c8a6c 100644 --- a/adminSiteClient/TestIndexPage.tsx +++ b/adminSiteClient/TestIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { AdminLayout } from "./AdminLayout.js" @@ -6,7 +6,7 @@ import { Link } from "./Link.js" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" @observer -export class TestIndexPage extends React.Component { +export class TestIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/UserEditPage.tsx b/adminSiteClient/UserEditPage.tsx index dee6b698751..30f209d2346 100644 --- a/adminSiteClient/UserEditPage.tsx +++ b/adminSiteClient/UserEditPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, runInAction } from "mobx" import { BindString, Toggle } from "./Forms.js" @@ -8,7 +8,7 @@ import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" import { UserIndexMeta } from "./UserMeta.js" @observer -export class UserEditPage extends React.Component<{ userId: number }> { +export class UserEditPage extends Component<{ userId: number }> { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/UsersIndexPage.tsx b/adminSiteClient/UsersIndexPage.tsx index 09291cf3ccb..88a47492d22 100644 --- a/adminSiteClient/UsersIndexPage.tsx +++ b/adminSiteClient/UsersIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { observable, action, runInAction } from "mobx" diff --git a/adminSiteClient/VariableEditPage.tsx b/adminSiteClient/VariableEditPage.tsx index c819d0d9730..d2fc372c44e 100644 --- a/adminSiteClient/VariableEditPage.tsx +++ b/adminSiteClient/VariableEditPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, @@ -125,7 +125,7 @@ class VariableEditable // XXX refactor with DatasetEditPage @observer -class VariableEditor extends React.Component<{ +class VariableEditor extends Component<{ variable: VariablePageData }> { @observable newVariable!: VariableEditable @@ -726,7 +726,7 @@ class VariableEditor extends React.Component<{ } @observer -export class VariableEditPage extends React.Component<{ variableId: number }> { +export class VariableEditPage extends Component<{ variableId: number }> { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/VariableList.tsx b/adminSiteClient/VariableList.tsx index 8ac334ee2c8..994280f9259 100644 --- a/adminSiteClient/VariableList.tsx +++ b/adminSiteClient/VariableList.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { Link } from "./Link.js" diff --git a/adminSiteClient/VariableSelector.tsx b/adminSiteClient/VariableSelector.tsx index 6d8b8858246..5b35f0eb260 100644 --- a/adminSiteClient/VariableSelector.tsx +++ b/adminSiteClient/VariableSelector.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import * as lodash from "lodash" import { groupBy, diff --git a/adminSiteClient/VariablesAnnotationPage.tsx b/adminSiteClient/VariablesAnnotationPage.tsx index e7c8a5fc3ac..fb28929173c 100644 --- a/adminSiteClient/VariablesAnnotationPage.tsx +++ b/adminSiteClient/VariablesAnnotationPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { DimensionProperty } from "@ourworldindata/utils" import { AdminLayout } from "./AdminLayout.js" import { GrapherConfigGridEditor } from "./GrapherConfigGridEditor.js" @@ -148,7 +148,7 @@ const config: GrapherConfigGridEditorConfig = { }), } -export class VariablesAnnotationPage extends React.Component { +export class VariablesAnnotationPage extends Component { render() { return ( diff --git a/adminSiteClient/VariablesIndexPage.tsx b/adminSiteClient/VariablesIndexPage.tsx index 5009a42bf40..2d688d2aff9 100644 --- a/adminSiteClient/VariablesIndexPage.tsx +++ b/adminSiteClient/VariablesIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, @@ -16,7 +16,7 @@ import { VariableList, VariableListItem } from "./VariableList.js" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" @observer -export class VariablesIndexPage extends React.Component { +export class VariablesIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/VisionDeficiencies.tsx b/adminSiteClient/VisionDeficiencies.tsx index d2b4fbea2f2..5c236a6f373 100644 --- a/adminSiteClient/VisionDeficiencies.tsx +++ b/adminSiteClient/VisionDeficiencies.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import Select, { GroupBase, components, OptionProps } from "react-select" import classNames from "classnames" import { observer } from "mobx-react" @@ -119,7 +119,7 @@ const VisionDeficiencyOption = ( ) @observer -export class VisionDeficiencyDropdown extends React.Component { +export class VisionDeficiencyDropdown extends Component { noDeficiencyOption = { label: "No deficiencies", value: "none", diff --git a/adminSiteClient/gdocsNotifications.tsx b/adminSiteClient/gdocsNotifications.tsx index 0ce8b97c3e7..6d415bfa377 100644 --- a/adminSiteClient/gdocsNotifications.tsx +++ b/adminSiteClient/gdocsNotifications.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { notification } from "antd" import { OwidGdocErrorMessageType } from "@ourworldindata/utils" import { match } from "ts-pattern" diff --git a/adminSiteServer/IndexPage.tsx b/adminSiteServer/IndexPage.tsx index 2cded503463..5a58509e04c 100644 --- a/adminSiteServer/IndexPage.tsx +++ b/adminSiteServer/IndexPage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { ENV, GITHUB_USERNAME, diff --git a/adminSiteServer/LoginPage.tsx b/adminSiteServer/LoginPage.tsx index d95292b740d..def4d2d1a26 100644 --- a/adminSiteServer/LoginPage.tsx +++ b/adminSiteServer/LoginPage.tsx @@ -1,5 +1,3 @@ -import React from "react" - export const LoginPage = (props: { next?: string; errorMessage?: string }) => { const style = ` html, body { diff --git a/adminSiteServer/adminRouter.tsx b/adminSiteServer/adminRouter.tsx index 4ec2039fb62..f239b00ea5f 100644 --- a/adminSiteServer/adminRouter.tsx +++ b/adminSiteServer/adminRouter.tsx @@ -2,7 +2,7 @@ import express, { Request, Response, Router } from "express" import rateLimit from "express-rate-limit" import filenamify from "filenamify" -import React from "react" +import * as React from "react" import { Writable } from "stream" import { expectInt, renderToHtmlPage } from "../serverUtils/serverUtil.js" import { logInWithCredentials, logOut } from "./authentication.js" diff --git a/adminSiteServer/appClass.tsx b/adminSiteServer/appClass.tsx index c2467c13c4f..1ef3cc0546b 100644 --- a/adminSiteServer/appClass.tsx +++ b/adminSiteServer/appClass.tsx @@ -1,4 +1,3 @@ -import React from "react" import { simpleGit } from "simple-git" import express, { NextFunction } from "express" // eslint-disable-next-line @typescript-eslint/no-require-imports diff --git a/adminSiteServer/testPageRouter.tsx b/adminSiteServer/testPageRouter.tsx index 2ac528a2fcc..93199b4c70a 100644 --- a/adminSiteServer/testPageRouter.tsx +++ b/adminSiteServer/testPageRouter.tsx @@ -1,7 +1,6 @@ // Testing pages for comparing local charts against live versions import { Router } from "express" -import React from "react" import { renderToHtmlPage, expectInt } from "../serverUtils/serverUtil.js" import { diff --git a/baker/GrapherBaker.tsx b/baker/GrapherBaker.tsx index 313b45c7ee7..2f65b46899d 100644 --- a/baker/GrapherBaker.tsx +++ b/baker/GrapherBaker.tsx @@ -1,4 +1,3 @@ -import React from "react" import { GrapherPage } from "../site/GrapherPage.js" import { DataPageV2 } from "../site/DataPageV2.js" import { renderToHtmlPage } from "../baker/siteRenderers.js" diff --git a/baker/MultiDimBaker.tsx b/baker/MultiDimBaker.tsx index 9ceb90e81a1..db04ecdb3c7 100644 --- a/baker/MultiDimBaker.tsx +++ b/baker/MultiDimBaker.tsx @@ -16,7 +16,6 @@ import { import * as db from "../db/db.js" import { renderToHtmlPage } from "./siteRenderers.js" import { MultiDimDataPage } from "../site/multiDim/MultiDimDataPage.js" -import React from "react" import { BAKED_BASE_URL, BAKED_GRAPHER_URL, diff --git a/baker/algolia/utils/pages.ts b/baker/algolia/utils/pages.ts index 10451000000..f9b16b1ce6b 100644 --- a/baker/algolia/utils/pages.ts +++ b/baker/algolia/utils/pages.ts @@ -27,7 +27,7 @@ import { } from "../../../site/search/searchTypes.js" import { getAnalyticsPageviewsByUrlObj } from "../../../db/model/Pageview.js" import { ArticleBlocks } from "../../../site/gdocs/components/ArticleBlocks.js" -import React from "react" +import { createElement } from "react" import { getFullPost, getPostTags, @@ -224,10 +224,10 @@ function generateGdocRecords( if (!gdoc.content.body) continue // Only rendering the blocks - not the page nav, title, byline, etc const renderedPostContent = ReactDOMServer.renderToStaticMarkup( - React.createElement( + createElement( "div", null, - React.createElement(ArticleBlocks, { + createElement(ArticleBlocks, { blocks: gdoc.content.body, }) ) diff --git a/baker/countryProfiles.tsx b/baker/countryProfiles.tsx index 358b762606a..946d9699fb3 100644 --- a/baker/countryProfiles.tsx +++ b/baker/countryProfiles.tsx @@ -1,4 +1,3 @@ -import React from "react" import * as db from "../db/db.js" import { CountriesIndexPage } from "../site/CountriesIndexPage.js" import { diff --git a/baker/formatWordpressPost.tsx b/baker/formatWordpressPost.tsx index de045d7cf56..40b6621e395 100644 --- a/baker/formatWordpressPost.tsx +++ b/baker/formatWordpressPost.tsx @@ -1,6 +1,5 @@ import cheerio from "cheerio" import urlSlug from "url-slug" -import React from "react" import ReactDOMServer from "react-dom/server.js" import { HTTPS_ONLY } from "../settings/serverSettings.js" import { GrapherExports } from "../baker/GrapherBakingUtils.js" diff --git a/baker/siteRenderers.tsx b/baker/siteRenderers.tsx index de8bd8deaa4..f2df79ef183 100644 --- a/baker/siteRenderers.tsx +++ b/baker/siteRenderers.tsx @@ -10,7 +10,6 @@ import { ExplorerIndexPage } from "../site/ExplorerIndexPage.js" import { ThankYouPage } from "../site/ThankYouPage.js" import TombstonePage from "../site/TombstonePage.js" import OwidGdocPage from "../site/gdocs/OwidGdocPage.js" -import React from "react" import ReactDOMServer from "react-dom/server.js" import * as lodash from "lodash" import { formatCountryProfile, isCanonicalInternalUrl } from "./formatting.js" diff --git a/explorerAdminClient/ExplorerCreatePage.jsdom.test.tsx b/explorerAdminClient/ExplorerCreatePage.jsdom.test.tsx index 686a9c91bac..21fdb3cbb56 100755 --- a/explorerAdminClient/ExplorerCreatePage.jsdom.test.tsx +++ b/explorerAdminClient/ExplorerCreatePage.jsdom.test.tsx @@ -1,7 +1,4 @@ -#! /usr/bin/env jest - -import React from "react" -import { ExplorerCreatePage } from "./ExplorerCreatePage.js" +#! /usr/bin/env jestimport { ExplorerCreatePage } from "./ExplorerCreatePage.js" import Enzyme from "enzyme" import Adapter from "@wojtekmaj/enzyme-adapter-react-17" diff --git a/explorerAdminClient/ExplorerCreatePage.tsx b/explorerAdminClient/ExplorerCreatePage.tsx index 96ff261a1a2..73fb57da875 100644 --- a/explorerAdminClient/ExplorerCreatePage.tsx +++ b/explorerAdminClient/ExplorerCreatePage.tsx @@ -11,7 +11,7 @@ import Handsontable from "handsontable" import { registerAllModules } from "handsontable/registry" import { action, computed, observable } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component, createRef } from "react" import { Prompt } from "react-router-dom" import { DefaultNewExplorerSlug, @@ -39,7 +39,7 @@ const RESERVED_NAMES = [DefaultNewExplorerSlug, "index", "new", "create"] // don registerAllModules() @observer -export class ExplorerCreatePage extends React.Component<{ +export class ExplorerCreatePage extends Component<{ slug: string gitCmsBranchName: string manager?: AdminManager @@ -325,12 +325,12 @@ export class ExplorerCreatePage extends React.Component<{ } } -class HotEditor extends React.Component<{ +class HotEditor extends Component<{ onChange: (code: string) => void program: ExplorerProgram programOnDisk: ExplorerProgram }> { - private hotTableComponent = React.createRef() + private hotTableComponent = createRef() @computed private get program() { return this.props.program @@ -467,7 +467,7 @@ class HotEditor extends React.Component<{ } } -class PictureInPicture extends React.Component<{ +class PictureInPicture extends Component<{ previewLink: string }> { render() { @@ -480,7 +480,7 @@ class PictureInPicture extends React.Component<{ } } -class TemplatesComponent extends React.Component<{ +class TemplatesComponent extends Component<{ isNewFile: boolean onChange: (code: string) => void }> { diff --git a/explorerAdminClient/ExplorersListPage.tsx b/explorerAdminClient/ExplorersListPage.tsx index 225995eb941..d4e1b079c6f 100644 --- a/explorerAdminClient/ExplorersListPage.tsx +++ b/explorerAdminClient/ExplorersListPage.tsx @@ -14,7 +14,7 @@ import { runInAction, } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component } from "react" import { DefaultNewExplorerSlug, ExplorersRouteResponse, @@ -35,7 +35,7 @@ import { BAKED_BASE_URL } from "../settings/clientSettings.js" import { AdminManager } from "./AdminManager.js" @observer -class ExplorerRow extends React.Component<{ +class ExplorerRow extends Component<{ explorer: ExplorerProgram indexPage: ExplorersIndexPage gitCmsBranchName: string @@ -148,7 +148,7 @@ class ExplorerRow extends React.Component<{ } @observer -class ExplorerList extends React.Component<{ +class ExplorerList extends Component<{ explorers: ExplorerProgram[] searchHighlight?: (text: string) => any indexPage: ExplorersIndexPage @@ -185,7 +185,7 @@ class ExplorerList extends React.Component<{ } @observer -export class ExplorersIndexPage extends React.Component<{ +export class ExplorersIndexPage extends Component<{ manager?: AdminManager }> { @observable explorers: ExplorerProgram[] = [] diff --git a/packages/@ourworldindata/components/src/Button/Button.tsx b/packages/@ourworldindata/components/src/Button/Button.tsx index ee31c825453..aaf42134833 100644 --- a/packages/@ourworldindata/components/src/Button/Button.tsx +++ b/packages/@ourworldindata/components/src/Button/Button.tsx @@ -1,4 +1,3 @@ -import React from "react" import cx from "classnames" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { IconDefinition, faArrowRight } from "@fortawesome/free-solid-svg-icons" diff --git a/packages/@ourworldindata/components/src/Checkbox.tsx b/packages/@ourworldindata/components/src/Checkbox.tsx index d3af557fded..787fd8b4a8d 100644 --- a/packages/@ourworldindata/components/src/Checkbox.tsx +++ b/packages/@ourworldindata/components/src/Checkbox.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faCheck } from "@fortawesome/free-solid-svg-icons" diff --git a/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.stories.tsx b/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.stories.tsx index 68275f415ba..79b74cb16b0 100644 --- a/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.stories.tsx +++ b/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { CodeSnippet } from "./CodeSnippet.js" export default { diff --git a/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.tsx b/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.tsx index 50a97ff17ec..bbd26e0c251 100644 --- a/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.tsx +++ b/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react" +import { useEffect, useState } from "react" import ReactDOM from "react-dom" import ReactDOMServer from "react-dom/server.js" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/packages/@ourworldindata/components/src/DataCitation/DataCitation.tsx b/packages/@ourworldindata/components/src/DataCitation/DataCitation.tsx index 055f7015ad1..5931346197c 100644 --- a/packages/@ourworldindata/components/src/DataCitation/DataCitation.tsx +++ b/packages/@ourworldindata/components/src/DataCitation/DataCitation.tsx @@ -1,4 +1,3 @@ -import React from "react" import { CodeSnippet } from "../CodeSnippet/CodeSnippet.js" export const DataCitation = (props: { diff --git a/packages/@ourworldindata/components/src/ExpandableToggle/ExpandableToggle.tsx b/packages/@ourworldindata/components/src/ExpandableToggle/ExpandableToggle.tsx index fde1c3bc1cb..f6d63fabf5a 100644 --- a/packages/@ourworldindata/components/src/ExpandableToggle/ExpandableToggle.tsx +++ b/packages/@ourworldindata/components/src/ExpandableToggle/ExpandableToggle.tsx @@ -1,6 +1,7 @@ import { faMinus, faPlus } from "@fortawesome/free-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" -import React, { useState } from "react" +import { useState } from "react" +import * as React from "react" import cx from "classnames" export const ExpandableToggle = ({ diff --git a/packages/@ourworldindata/components/src/Halo/Halo.tsx b/packages/@ourworldindata/components/src/Halo/Halo.tsx index 6732a911d03..92a42cf73c6 100644 --- a/packages/@ourworldindata/components/src/Halo/Halo.tsx +++ b/packages/@ourworldindata/components/src/Halo/Halo.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Color } from "@ourworldindata/types" const defaultHaloStyle: React.CSSProperties = { diff --git a/packages/@ourworldindata/components/src/IndicatorKeyData/IndicatorKeyData.tsx b/packages/@ourworldindata/components/src/IndicatorKeyData/IndicatorKeyData.tsx index a04d4d86043..9f308e195af 100644 --- a/packages/@ourworldindata/components/src/IndicatorKeyData/IndicatorKeyData.tsx +++ b/packages/@ourworldindata/components/src/IndicatorKeyData/IndicatorKeyData.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { OwidProcessingLevel, getPhraseForProcessingLevel, diff --git a/packages/@ourworldindata/components/src/IndicatorProcessing/IndicatorProcessing.tsx b/packages/@ourworldindata/components/src/IndicatorProcessing/IndicatorProcessing.tsx index 7ddf380185e..e110148ced8 100644 --- a/packages/@ourworldindata/components/src/IndicatorProcessing/IndicatorProcessing.tsx +++ b/packages/@ourworldindata/components/src/IndicatorProcessing/IndicatorProcessing.tsx @@ -1,4 +1,3 @@ -import React from "react" import { SimpleMarkdownText } from "../SimpleMarkdownText.js" import { faArrowDown } from "@fortawesome/free-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/packages/@ourworldindata/components/src/IndicatorSources/IndicatorSources.tsx b/packages/@ourworldindata/components/src/IndicatorSources/IndicatorSources.tsx index c632cf301de..2df7948de9a 100644 --- a/packages/@ourworldindata/components/src/IndicatorSources/IndicatorSources.tsx +++ b/packages/@ourworldindata/components/src/IndicatorSources/IndicatorSources.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import cx from "classnames" import { ExpandableToggle } from "../ExpandableToggle/ExpandableToggle.js" import { DisplaySource, uniqBy, formatSourceDate } from "@ourworldindata/utils" diff --git a/packages/@ourworldindata/components/src/LabeledSwitch/LabeledSwitch.tsx b/packages/@ourworldindata/components/src/LabeledSwitch/LabeledSwitch.tsx index 4a65531fe73..bad6ed0ef78 100644 --- a/packages/@ourworldindata/components/src/LabeledSwitch/LabeledSwitch.tsx +++ b/packages/@ourworldindata/components/src/LabeledSwitch/LabeledSwitch.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faInfoCircle } from "@fortawesome/free-solid-svg-icons" diff --git a/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.stories.tsx b/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.stories.tsx index 5f9755c56fb..de160e284eb 100644 --- a/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.stories.tsx +++ b/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.stories.tsx @@ -1,4 +1,5 @@ -import React, { createRef } from "react" +import { createRef } from "react" +import * as React from "react" import { action, computed, observable } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.tsx b/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.tsx index 1baff419ea8..494e67e4a0d 100644 --- a/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.tsx +++ b/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.tsx @@ -1,4 +1,5 @@ -import React, { CSSProperties } from "react" +import { CSSProperties } from "react" +import * as React from "react" import { computed } from "mobx" import { excludeUndefined, diff --git a/packages/@ourworldindata/components/src/OverlayHeader.tsx b/packages/@ourworldindata/components/src/OverlayHeader.tsx index 2a9ec837502..f81fc15c409 100644 --- a/packages/@ourworldindata/components/src/OverlayHeader.tsx +++ b/packages/@ourworldindata/components/src/OverlayHeader.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import cx from "classnames" import { CloseButton } from "./closeButton/CloseButton.js" diff --git a/packages/@ourworldindata/components/src/RadioButton.tsx b/packages/@ourworldindata/components/src/RadioButton.tsx index 638559ae470..94e1dc934a0 100644 --- a/packages/@ourworldindata/components/src/RadioButton.tsx +++ b/packages/@ourworldindata/components/src/RadioButton.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" export class RadioButton extends React.Component<{ checked: boolean diff --git a/packages/@ourworldindata/components/src/SimpleMarkdownText.tsx b/packages/@ourworldindata/components/src/SimpleMarkdownText.tsx index b36a879b917..8c92eb0b78d 100644 --- a/packages/@ourworldindata/components/src/SimpleMarkdownText.tsx +++ b/packages/@ourworldindata/components/src/SimpleMarkdownText.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { Remark, useRemarkSync, UseRemarkSyncOptions } from "react-remark" import { remarkPlainLinks } from "./markdown/remarkPlainLinks.js" diff --git a/packages/@ourworldindata/components/src/TextWrap/TextWrap.stories.tsx b/packages/@ourworldindata/components/src/TextWrap/TextWrap.stories.tsx index 369959ec646..33ec4269849 100644 --- a/packages/@ourworldindata/components/src/TextWrap/TextWrap.stories.tsx +++ b/packages/@ourworldindata/components/src/TextWrap/TextWrap.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { TextWrap } from "./TextWrap" diff --git a/packages/@ourworldindata/components/src/TextWrap/TextWrap.tsx b/packages/@ourworldindata/components/src/TextWrap/TextWrap.tsx index 87ba9eddfec..7912d62accc 100644 --- a/packages/@ourworldindata/components/src/TextWrap/TextWrap.tsx +++ b/packages/@ourworldindata/components/src/TextWrap/TextWrap.tsx @@ -1,6 +1,6 @@ import { max, stripHTML, Bounds, FontFamily, last } from "@ourworldindata/utils" import { computed } from "mobx" -import React from "react" +import * as React from "react" import { Fragment, joinFragments, splitIntoFragments } from "./TextWrapUtils" declare type FontSize = number diff --git a/packages/@ourworldindata/components/src/TextWrap/TextWrapGroup.tsx b/packages/@ourworldindata/components/src/TextWrap/TextWrapGroup.tsx index 05a4f16eda4..d540132ed70 100644 --- a/packages/@ourworldindata/components/src/TextWrap/TextWrapGroup.tsx +++ b/packages/@ourworldindata/components/src/TextWrap/TextWrapGroup.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { TextWrap } from "./TextWrap" import { splitIntoFragments } from "./TextWrapUtils" diff --git a/packages/@ourworldindata/components/src/closeButton/CloseButton.tsx b/packages/@ourworldindata/components/src/closeButton/CloseButton.tsx index d8be4ca885d..45a18946970 100644 --- a/packages/@ourworldindata/components/src/closeButton/CloseButton.tsx +++ b/packages/@ourworldindata/components/src/closeButton/CloseButton.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import cx from "classnames" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faXmark } from "@fortawesome/free-solid-svg-icons" diff --git a/packages/@ourworldindata/explorer/src/Explorer.sample.tsx b/packages/@ourworldindata/explorer/src/Explorer.sample.tsx index 53cb8bff93e..7c900920167 100644 --- a/packages/@ourworldindata/explorer/src/Explorer.sample.tsx +++ b/packages/@ourworldindata/explorer/src/Explorer.sample.tsx @@ -1,4 +1,3 @@ -import React from "react" import { DimensionProperty } from "@ourworldindata/utils" import { GRAPHER_TAB_OPTIONS } from "@ourworldindata/types" import { GrapherProgrammaticInterface } from "@ourworldindata/grapher" diff --git a/packages/@ourworldindata/explorer/src/ExplorerControls.jsdom.test.tsx b/packages/@ourworldindata/explorer/src/ExplorerControls.jsdom.test.tsx index 8be4b11d131..19bfa65ae23 100755 --- a/packages/@ourworldindata/explorer/src/ExplorerControls.jsdom.test.tsx +++ b/packages/@ourworldindata/explorer/src/ExplorerControls.jsdom.test.tsx @@ -1,7 +1,4 @@ -#! /usr/bin/env jest - -import React from "react" -import { ExplorerControlType } from "./ExplorerConstants.js" +#! /usr/bin/env jestimport { ExplorerControlType } from "./ExplorerConstants.js" import { ExplorerControlPanel } from "./ExplorerControls.js" import Enzyme from "enzyme" diff --git a/packages/@ourworldindata/explorer/src/ExplorerControls.tsx b/packages/@ourworldindata/explorer/src/ExplorerControls.tsx index f1d8b5016a7..1e76b270cd3 100644 --- a/packages/@ourworldindata/explorer/src/ExplorerControls.tsx +++ b/packages/@ourworldindata/explorer/src/ExplorerControls.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { action, computed } from "mobx" import Select, { components, SingleValueProps } from "react-select" @@ -17,7 +17,7 @@ const SELECTED_OPTION_CLASS = "SelectedOption" const EXPLORER_DROPDOWN_CLASS = "ExplorerDropdown" const HIDDEN_CONTROL_HEADER_CLASS = "HiddenControlHeader" -export class ExplorerControlBar extends React.Component<{ +export class ExplorerControlBar extends Component<{ isMobile?: boolean showControls?: boolean closeControls?: () => void @@ -105,7 +105,7 @@ const ExplorerDropdown = (props: { } @observer -export class ExplorerControlPanel extends React.Component<{ +export class ExplorerControlPanel extends Component<{ choice: ExplorerChoice explorerSlug?: string onChange?: (value: string) => void diff --git a/packages/@ourworldindata/grapher/src/axis/AxisViews.jsdom.test.tsx b/packages/@ourworldindata/grapher/src/axis/AxisViews.jsdom.test.tsx index a6eda45a4b6..bb6ac66a29f 100755 --- a/packages/@ourworldindata/grapher/src/axis/AxisViews.jsdom.test.tsx +++ b/packages/@ourworldindata/grapher/src/axis/AxisViews.jsdom.test.tsx @@ -1,8 +1,5 @@ -#! /usr/bin/env jest - -import { AxisConfig } from "./AxisConfig" +#! /usr/bin/env jestimport { AxisConfig } from "./AxisConfig" import { DualAxisComponent, HorizontalAxisGridLines } from "./AxisViews" -import React from "react" import { ScaleType } from "@ourworldindata/types" import { DualAxis } from "./Axis" diff --git a/packages/@ourworldindata/grapher/src/axis/AxisViews.tsx b/packages/@ourworldindata/grapher/src/axis/AxisViews.tsx index bd4c533dc97..362cd2153c2 100644 --- a/packages/@ourworldindata/grapher/src/axis/AxisViews.tsx +++ b/packages/@ourworldindata/grapher/src/axis/AxisViews.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.stories.tsx b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.stories.tsx index 577196e3874..5ba2e1b35cd 100644 --- a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { DiscreteBarChart } from "./DiscreteBarChart" import { SampleColumnSlugs, diff --git a/packages/@ourworldindata/grapher/src/bodyDiv/BodyDiv.tsx b/packages/@ourworldindata/grapher/src/bodyDiv/BodyDiv.tsx index f7445d9844f..b2101e0afd9 100644 --- a/packages/@ourworldindata/grapher/src/bodyDiv/BodyDiv.tsx +++ b/packages/@ourworldindata/grapher/src/bodyDiv/BodyDiv.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import ReactDOM from "react-dom" interface BodyDivProps { diff --git a/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.stories.tsx b/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.stories.tsx index 830ed484691..1cc2db9e3f1 100644 --- a/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.stories.tsx @@ -6,7 +6,7 @@ import { SeriesStrategy, } from "@ourworldindata/types" import { DEFAULT_BOUNDS } from "@ourworldindata/utils" -import React from "react" +import * as React from "react" import { CaptionedChart, CaptionedChartManager, diff --git a/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.tsx b/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.tsx index babbce9753e..b7fc5140dd1 100644 --- a/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.tsx +++ b/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/grapher/src/captionedChart/Logos.tsx b/packages/@ourworldindata/grapher/src/captionedChart/Logos.tsx index 2d5273fc4df..ff8c3acc644 100644 --- a/packages/@ourworldindata/grapher/src/captionedChart/Logos.tsx +++ b/packages/@ourworldindata/grapher/src/captionedChart/Logos.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { OWID_LOGO_SVG, diff --git a/packages/@ourworldindata/grapher/src/chart/ChartManager.ts b/packages/@ourworldindata/grapher/src/chart/ChartManager.ts index 630db5820ed..3173fc20b6e 100644 --- a/packages/@ourworldindata/grapher/src/chart/ChartManager.ts +++ b/packages/@ourworldindata/grapher/src/chart/ChartManager.ts @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { EntitySelectionMode, FacetStrategy, diff --git a/packages/@ourworldindata/grapher/src/chart/ChartTypeSwitcher.tsx b/packages/@ourworldindata/grapher/src/chart/ChartTypeSwitcher.tsx index 0e1886d7a8b..7ba3da16b3b 100644 --- a/packages/@ourworldindata/grapher/src/chart/ChartTypeSwitcher.tsx +++ b/packages/@ourworldindata/grapher/src/chart/ChartTypeSwitcher.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { ALL_GRAPHER_CHART_TYPES, GrapherChartType, diff --git a/packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx b/packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx index 08810daa587..36357a0c806 100644 --- a/packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx +++ b/packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { areSetsEqual, Box, getCountryByName } from "@ourworldindata/utils" import { SeriesStrategy, diff --git a/packages/@ourworldindata/grapher/src/controls/ActionButtons.tsx b/packages/@ourworldindata/grapher/src/controls/ActionButtons.tsx index 4b81087e96c..dadc693d304 100644 --- a/packages/@ourworldindata/grapher/src/controls/ActionButtons.tsx +++ b/packages/@ourworldindata/grapher/src/controls/ActionButtons.tsx @@ -1,4 +1,5 @@ -import React, { useState } from "react" +import { useState } from "react" +import * as React from "react" import { computed, action } from "mobx" import { observer } from "mobx-react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/packages/@ourworldindata/grapher/src/controls/ChartIcons.tsx b/packages/@ourworldindata/grapher/src/controls/ChartIcons.tsx index 6ca49c648f9..aa653dd9538 100644 --- a/packages/@ourworldindata/grapher/src/controls/ChartIcons.tsx +++ b/packages/@ourworldindata/grapher/src/controls/ChartIcons.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faChartBar, diff --git a/packages/@ourworldindata/grapher/src/controls/CommandPalette.stories.tsx b/packages/@ourworldindata/grapher/src/controls/CommandPalette.stories.tsx index 7a5dfbb6957..59b4698b014 100644 --- a/packages/@ourworldindata/grapher/src/controls/CommandPalette.stories.tsx +++ b/packages/@ourworldindata/grapher/src/controls/CommandPalette.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { CommandPalette, Command } from "../controls/CommandPalette" export default { diff --git a/packages/@ourworldindata/grapher/src/controls/CommandPalette.tsx b/packages/@ourworldindata/grapher/src/controls/CommandPalette.tsx index f2c39b12181..8bf3363178b 100644 --- a/packages/@ourworldindata/grapher/src/controls/CommandPalette.tsx +++ b/packages/@ourworldindata/grapher/src/controls/CommandPalette.tsx @@ -1,7 +1,7 @@ import { BodyDiv } from "../bodyDiv/BodyDiv" import { sortBy } from "@ourworldindata/utils" import { observer } from "mobx-react" -import React from "react" +import * as React from "react" declare type keyboardCombo = string diff --git a/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx b/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx index 848f4340514..78ed5aa34a0 100644 --- a/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx +++ b/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action, computed } from "mobx" import { observer } from "mobx-react" import classnames from "classnames" diff --git a/packages/@ourworldindata/grapher/src/controls/Dropdown.tsx b/packages/@ourworldindata/grapher/src/controls/Dropdown.tsx index 445e1b237f0..3ec4867cd56 100644 --- a/packages/@ourworldindata/grapher/src/controls/Dropdown.tsx +++ b/packages/@ourworldindata/grapher/src/controls/Dropdown.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import Select, { Props } from "react-select" import cx from "classnames" diff --git a/packages/@ourworldindata/grapher/src/controls/EntitySelectionToggle.tsx b/packages/@ourworldindata/grapher/src/controls/EntitySelectionToggle.tsx index efff60da4ed..23d80f5d59b 100644 --- a/packages/@ourworldindata/grapher/src/controls/EntitySelectionToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/EntitySelectionToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/packages/@ourworldindata/grapher/src/controls/MapProjectionMenu.tsx b/packages/@ourworldindata/grapher/src/controls/MapProjectionMenu.tsx index 5b7621e73d9..eabe02d0d7f 100644 --- a/packages/@ourworldindata/grapher/src/controls/MapProjectionMenu.tsx +++ b/packages/@ourworldindata/grapher/src/controls/MapProjectionMenu.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, action } from "mobx" import { observer } from "mobx-react" import { MapConfig } from "../mapCharts/MapConfig" diff --git a/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx b/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx index 961863e4d64..b1d5dca3429 100644 --- a/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx +++ b/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, action, observable } from "mobx" import { observer } from "mobx-react" import classnames from "classnames" diff --git a/packages/@ourworldindata/grapher/src/controls/ShareMenu.tsx b/packages/@ourworldindata/grapher/src/controls/ShareMenu.tsx index 46cf518d4a2..c99e0a6e2e3 100644 --- a/packages/@ourworldindata/grapher/src/controls/ShareMenu.tsx +++ b/packages/@ourworldindata/grapher/src/controls/ShareMenu.tsx @@ -1,5 +1,5 @@ import { observer } from "mobx-react" -import React from "react" +import * as React from "react" import { computed, action } from "mobx" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faXTwitter, faFacebook } from "@fortawesome/free-brands-svg-icons" diff --git a/packages/@ourworldindata/grapher/src/controls/SortIcon.tsx b/packages/@ourworldindata/grapher/src/controls/SortIcon.tsx index c17d1d2ae4a..e08865f9877 100644 --- a/packages/@ourworldindata/grapher/src/controls/SortIcon.tsx +++ b/packages/@ourworldindata/grapher/src/controls/SortIcon.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import classnames from "classnames" import { IconDefinition } from "@fortawesome/fontawesome-svg-core/index" import { diff --git a/packages/@ourworldindata/grapher/src/controls/VerticalScrollContainer.tsx b/packages/@ourworldindata/grapher/src/controls/VerticalScrollContainer.tsx index 4b3c05f3904..d561aa86a36 100644 --- a/packages/@ourworldindata/grapher/src/controls/VerticalScrollContainer.tsx +++ b/packages/@ourworldindata/grapher/src/controls/VerticalScrollContainer.tsx @@ -1,5 +1,7 @@ /* eslint-disable react/prop-types */ -import React, { useEffect, useState } from "react" +import { useEffect, useState } from "react" + +import * as React from "react" import classnames from "classnames" type VerticalScrollContainerProps = React.DetailedHTMLProps< diff --git a/packages/@ourworldindata/grapher/src/controls/controlsRow/ControlsRow.tsx b/packages/@ourworldindata/grapher/src/controls/controlsRow/ControlsRow.tsx index 740acec567e..f621c4a9415 100644 --- a/packages/@ourworldindata/grapher/src/controls/controlsRow/ControlsRow.tsx +++ b/packages/@ourworldindata/grapher/src/controls/controlsRow/ControlsRow.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { computed } from "mobx" import { observer } from "mobx-react" @@ -29,7 +29,7 @@ export interface ControlsRowManager } @observer -export class ControlsRow extends React.Component<{ +export class ControlsRow extends Component<{ manager: ControlsRowManager maxWidth?: number settingsMenuTop?: number diff --git a/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPicker.tsx b/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPicker.tsx index 754584323a4..328558579ab 100644 --- a/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPicker.tsx +++ b/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPicker.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action, computed, observable, runInAction, reaction } from "mobx" import { observer } from "mobx-react" import { Flipper, Flipped } from "react-flip-toolkit" diff --git a/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.jsdom.test.tsx b/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.jsdom.test.tsx index 76c2e22b52b..bdadf0d6e0f 100644 --- a/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.jsdom.test.tsx +++ b/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.jsdom.test.tsx @@ -1,8 +1,4 @@ -#! /usr/bin/env jest - -import React from "react" - -import Enzyme from "enzyme" +#! /usr/bin/env jestimport Enzyme from "enzyme" import Adapter from "@wojtekmaj/enzyme-adapter-react-17" import { GlobalEntitySelector } from "./GlobalEntitySelector" import { SelectionArray } from "../../selection/SelectionArray" diff --git a/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.stories.tsx b/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.stories.tsx index b658ec4c110..face91d2ee1 100644 --- a/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.stories.tsx +++ b/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { SelectionArray } from "../../selection/SelectionArray" import { GlobalEntitySelector } from "./GlobalEntitySelector" diff --git a/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.tsx b/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.tsx index 9075c55762b..cf8a28c7b6e 100644 --- a/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.tsx +++ b/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import ReactDOM from "react-dom" import { action, observable, IReactionDisposer, reaction, computed } from "mobx" import { observer } from "mobx-react" diff --git a/packages/@ourworldindata/grapher/src/controls/settings/AbsRelToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/AbsRelToggle.tsx index d24ce59e359..55ad25476d2 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/AbsRelToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/AbsRelToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, action } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/grapher/src/controls/settings/AxisScaleToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/AxisScaleToggle.tsx index 08219601630..8afe6e23790 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/AxisScaleToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/AxisScaleToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action } from "mobx" import { observer } from "mobx-react" import { ScaleType } from "@ourworldindata/types" diff --git a/packages/@ourworldindata/grapher/src/controls/settings/FacetStrategySelector.tsx b/packages/@ourworldindata/grapher/src/controls/settings/FacetStrategySelector.tsx index a96e11782ef..a6d9c979734 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/FacetStrategySelector.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/FacetStrategySelector.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import { DEFAULT_GRAPHER_ENTITY_TYPE } from "../../core/GrapherConstants" diff --git a/packages/@ourworldindata/grapher/src/controls/settings/FacetYDomainToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/FacetYDomainToggle.tsx index 359fb224b28..d8cc3ef872e 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/FacetYDomainToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/FacetYDomainToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, action } from "mobx" import { observer } from "mobx-react" import { FacetAxisDomain, FacetStrategy } from "@ourworldindata/types" diff --git a/packages/@ourworldindata/grapher/src/controls/settings/NoDataAreaToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/NoDataAreaToggle.tsx index 2c0af0baba7..0b58e8e0cac 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/NoDataAreaToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/NoDataAreaToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, action } from "mobx" import { observer } from "mobx-react" import { LabeledSwitch } from "@ourworldindata/components" diff --git a/packages/@ourworldindata/grapher/src/controls/settings/TableFilterToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/TableFilterToggle.tsx index d0aefe432f1..c3c96c11364 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/TableFilterToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/TableFilterToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action, computed } from "mobx" import { observer } from "mobx-react" import { DEFAULT_GRAPHER_ENTITY_TYPE_PLURAL } from "../../core/GrapherConstants" diff --git a/packages/@ourworldindata/grapher/src/controls/settings/ZoomToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/ZoomToggle.tsx index cbbaf5871b3..0c0d40bdd6f 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/ZoomToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/ZoomToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action } from "mobx" import { observer } from "mobx-react" import { LabeledSwitch } from "@ourworldindata/components" diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.stories.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.stories.tsx index e7b31d2b84b..88836052b21 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.stories.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Grapher, GrapherProgrammaticInterface } from "./Grapher" import { SampleColumnSlugs, diff --git a/packages/@ourworldindata/grapher/src/dataTable/DataTable.jsdom.test.tsx b/packages/@ourworldindata/grapher/src/dataTable/DataTable.jsdom.test.tsx index de5bcd27e37..322192eb7b3 100755 --- a/packages/@ourworldindata/grapher/src/dataTable/DataTable.jsdom.test.tsx +++ b/packages/@ourworldindata/grapher/src/dataTable/DataTable.jsdom.test.tsx @@ -1,8 +1,4 @@ -#! /usr/bin/env jest - -import React from "react" - -import { DataTable } from "./DataTable" +#! /usr/bin/env jestimport { DataTable } from "./DataTable" import { GRAPHER_CHART_TYPES, GRAPHER_TAB_OPTIONS } from "@ourworldindata/types" import { childMortalityGrapher, diff --git a/packages/@ourworldindata/grapher/src/dataTable/DataTable.stories.tsx b/packages/@ourworldindata/grapher/src/dataTable/DataTable.stories.tsx index 495e3140c58..5ad59d88286 100644 --- a/packages/@ourworldindata/grapher/src/dataTable/DataTable.stories.tsx +++ b/packages/@ourworldindata/grapher/src/dataTable/DataTable.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { DataTable, DataTableManager } from "./DataTable" import { SynthesizeGDPTable } from "@ourworldindata/core-table" import { GRAPHER_CHART_TYPES, GRAPHER_TAB_OPTIONS } from "@ourworldindata/types" diff --git a/packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx b/packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx index 3e1af114609..f7113ced87a 100644 --- a/packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx +++ b/packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, observable, action } from "mobx" import { observer } from "mobx-react" import classnames from "classnames" diff --git a/packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx b/packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx index 3d547020bbc..6aa48751231 100644 --- a/packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx +++ b/packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { computed, action, reaction } from "mobx" import cx from "classnames" diff --git a/packages/@ourworldindata/grapher/src/facetChart/FacetChart.stories.tsx b/packages/@ourworldindata/grapher/src/facetChart/FacetChart.stories.tsx index 1bc6a3243b7..b5e883f4996 100644 --- a/packages/@ourworldindata/grapher/src/facetChart/FacetChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/facetChart/FacetChart.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { FacetChart } from "./FacetChart" import { SampleColumnSlugs, diff --git a/packages/@ourworldindata/grapher/src/footer/Footer.stories.tsx b/packages/@ourworldindata/grapher/src/footer/Footer.stories.tsx index 2fc97a9d331..db0aefc5659 100644 --- a/packages/@ourworldindata/grapher/src/footer/Footer.stories.tsx +++ b/packages/@ourworldindata/grapher/src/footer/Footer.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Footer } from "../footer/Footer" import { FooterManager } from "./FooterManager" diff --git a/packages/@ourworldindata/grapher/src/footer/Footer.tsx b/packages/@ourworldindata/grapher/src/footer/Footer.tsx index b1a9807e2e9..d2132d46b08 100644 --- a/packages/@ourworldindata/grapher/src/footer/Footer.tsx +++ b/packages/@ourworldindata/grapher/src/footer/Footer.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observable, computed, action } from "mobx" import { observer } from "mobx-react" import parseUrl from "url-parse" diff --git a/packages/@ourworldindata/grapher/src/fullScreen/FullScreen.tsx b/packages/@ourworldindata/grapher/src/fullScreen/FullScreen.tsx index 341d94474df..8acd8a6507a 100644 --- a/packages/@ourworldindata/grapher/src/fullScreen/FullScreen.tsx +++ b/packages/@ourworldindata/grapher/src/fullScreen/FullScreen.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action } from "mobx" import { observer } from "mobx-react" import { BodyDiv } from "../bodyDiv/BodyDiv" diff --git a/packages/@ourworldindata/grapher/src/header/Header.stories.tsx b/packages/@ourworldindata/grapher/src/header/Header.stories.tsx index 12e0c9b4a90..c9594f5781c 100644 --- a/packages/@ourworldindata/grapher/src/header/Header.stories.tsx +++ b/packages/@ourworldindata/grapher/src/header/Header.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Header } from "./Header" import { HeaderManager } from "./HeaderManager" diff --git a/packages/@ourworldindata/grapher/src/header/Header.tsx b/packages/@ourworldindata/grapher/src/header/Header.tsx index 286198bc7a5..f961a6d1b03 100644 --- a/packages/@ourworldindata/grapher/src/header/Header.tsx +++ b/packages/@ourworldindata/grapher/src/header/Header.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { DEFAULT_BOUNDS, range, diff --git a/packages/@ourworldindata/grapher/src/horizontalColorLegend/HorizontalColorLegends.tsx b/packages/@ourworldindata/grapher/src/horizontalColorLegend/HorizontalColorLegends.tsx index 37ed0325865..31ad4e8050a 100644 --- a/packages/@ourworldindata/grapher/src/horizontalColorLegend/HorizontalColorLegends.tsx +++ b/packages/@ourworldindata/grapher/src/horizontalColorLegend/HorizontalColorLegends.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action, computed } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.stories.tsx b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.stories.tsx index 9ad72efc4fb..f46badff800 100644 --- a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { LineChart } from "../lineCharts/LineChart" import { OwidTableSlugs, ScaleType } from "@ourworldindata/types" import { diff --git a/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.stories.tsx b/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.stories.tsx index f0d8628269b..3b947697b69 100644 --- a/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.stories.tsx +++ b/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.stories.tsx @@ -1,6 +1,6 @@ import { DualAxis } from "../axis/Axis" import { AxisConfig } from "../axis/AxisConfig" -import React from "react" +import * as React from "react" import { LineLegend, LineLegendManager } from "./LineLegend" export default { diff --git a/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.tsx b/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.tsx index f36393b9e96..ed14c1c17d2 100644 --- a/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.tsx +++ b/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.tsx @@ -1,5 +1,5 @@ // This implements the line labels that appear to the right of the lines/polygons in LineCharts/StackedAreas. -import React from "react" +import * as React from "react" import { Bounds, noop, diff --git a/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.stories.tsx b/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.stories.tsx index 3ba8766b4b0..7b81590e5fb 100644 --- a/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.stories.tsx +++ b/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { LoadingIndicator } from "./LoadingIndicator" export default { diff --git a/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.tsx b/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.tsx index 527ae3274c8..6fb69ff6655 100644 --- a/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.tsx +++ b/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Bounds } from "@ourworldindata/utils" const DEFAULT_COLOR = "#333" diff --git a/packages/@ourworldindata/grapher/src/mapCharts/MapChart.stories.tsx b/packages/@ourworldindata/grapher/src/mapCharts/MapChart.stories.tsx index c5c24bc1599..c91a3b06e37 100644 --- a/packages/@ourworldindata/grapher/src/mapCharts/MapChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/mapCharts/MapChart.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { MapChart } from "./MapChart" import { SynthesizeGDPTable } from "@ourworldindata/core-table" diff --git a/packages/@ourworldindata/grapher/src/mapCharts/MapSparkline.tsx b/packages/@ourworldindata/grapher/src/mapCharts/MapSparkline.tsx index 72977920cdb..bab838ac45a 100644 --- a/packages/@ourworldindata/grapher/src/mapCharts/MapSparkline.tsx +++ b/packages/@ourworldindata/grapher/src/mapCharts/MapSparkline.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.jsdom.test.tsx b/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.jsdom.test.tsx index 2344e68090f..9b4dcfc244c 100755 --- a/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.jsdom.test.tsx +++ b/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.jsdom.test.tsx @@ -1,7 +1,4 @@ -#! /usr/bin/env jest - -import React from "react" -import { Grapher } from "../core/Grapher" +#! /usr/bin/env jestimport { Grapher } from "../core/Grapher" import { legacyMapGrapher } from "./MapChart.sample" import Enzyme from "enzyme" diff --git a/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.stories.tsx b/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.stories.tsx index d8307c808c0..d0090c21748 100644 --- a/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.stories.tsx +++ b/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { MapTooltip } from "./MapTooltip" import { Grapher } from "../core/Grapher" import { legacyMapGrapher } from "./MapChart.sample" diff --git a/packages/@ourworldindata/grapher/src/modal/DownloadIcons.tsx b/packages/@ourworldindata/grapher/src/modal/DownloadIcons.tsx index 85ce38ac4f9..44d456c02fd 100644 --- a/packages/@ourworldindata/grapher/src/modal/DownloadIcons.tsx +++ b/packages/@ourworldindata/grapher/src/modal/DownloadIcons.tsx @@ -1,5 +1,3 @@ -import React from "react" - export const DownloadIconFullDataset = () => ( { )} {rows.map(([first, second]) => ( - +
{
)} - + ))} ) diff --git a/packages/@ourworldindata/grapher/src/modal/SourcesModal.stories.tsx b/packages/@ourworldindata/grapher/src/modal/SourcesModal.stories.tsx index 237c93f04d6..9df4c26fa34 100644 --- a/packages/@ourworldindata/grapher/src/modal/SourcesModal.stories.tsx +++ b/packages/@ourworldindata/grapher/src/modal/SourcesModal.stories.tsx @@ -1,5 +1,5 @@ import { SynthesizeGDPTable } from "@ourworldindata/core-table" -import React from "react" +import * as React from "react" import { SourcesModal } from "./SourcesModal" export default { diff --git a/packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx b/packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx index 049449ea53a..d3f2d1aeda6 100644 --- a/packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx +++ b/packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx @@ -25,7 +25,7 @@ import { CLOSE_BUTTON_WIDTH, CloseButton, } from "@ourworldindata/components" -import React from "react" +import * as React from "react" import cx from "classnames" import { action, computed } from "mobx" import { observer } from "mobx-react" diff --git a/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.stories.tsx b/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.stories.tsx index 2da58755259..d4ab0913db1 100644 --- a/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.stories.tsx +++ b/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { NoDataModal } from "./NoDataModal" export default { diff --git a/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.tsx b/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.tsx index 2aa2811e0be..675d72a9dbe 100644 --- a/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.tsx +++ b/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import a from "indefinite" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ComparisonLine.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ComparisonLine.tsx index d1e6156d99d..456b09f1068 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ComparisonLine.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ComparisonLine.tsx @@ -5,7 +5,7 @@ import { PointVector, makeIdForHumanConsumption, } from "@ourworldindata/utils" -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import { DualAxis } from "../axis/Axis" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ConnectedScatterLegend.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ConnectedScatterLegend.tsx index 1705a965cc7..fc3e9726e37 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ConnectedScatterLegend.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ConnectedScatterLegend.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { Triangle } from "./Triangle" import { TextWrap } from "@ourworldindata/components" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/MultiColorPolyline.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/MultiColorPolyline.tsx index d44a1e3ec97..26757962cf2 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/MultiColorPolyline.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/MultiColorPolyline.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx index 9041e4ee8f6..da0b23e7f67 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Bounds, HorizontalAlign } from "@ourworldindata/utils" import { GRAPHER_FONT_SCALE_11, diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.stories.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.stories.tsx index 1d79d92b0d3..ba0787d1205 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.stories.tsx @@ -5,7 +5,7 @@ import { } from "@ourworldindata/core-table" import { ScaleType } from "@ourworldindata/types" import { DEFAULT_BOUNDS } from "@ourworldindata/utils" -import React from "react" +import * as React from "react" import { ScatterPlotChart } from "./ScatterPlotChart" import { ScatterPlotManager } from "./ScatterPlotChartConstants" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPoints.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPoints.tsx index e6a49210470..e580b4ffcaa 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPoints.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPoints.tsx @@ -5,7 +5,7 @@ import { makeIdForHumanConsumption, } from "@ourworldindata/utils" import { observer } from "mobx-react" -import React from "react" +import * as React from "react" import { MultiColorPolyline } from "./MultiColorPolyline" import { ScatterRenderSeries, diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPointsWithLabels.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPointsWithLabels.tsx index fd8d306752b..92dc8bc639a 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPointsWithLabels.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPointsWithLabels.tsx @@ -17,7 +17,7 @@ import { } from "@ourworldindata/utils" import { computed, action, observable } from "mobx" import { observer } from "mobx-react" -import React from "react" +import * as React from "react" import { Halo } from "@ourworldindata/components" import { MultiColorPolyline } from "./MultiColorPolyline" import { diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterSizeLegend.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterSizeLegend.tsx index 8dded0dd241..ff7c4a887ac 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterSizeLegend.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterSizeLegend.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { scaleLinear, ScaleLinear } from "d3-scale" import { TextWrap, Halo } from "@ourworldindata/components" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/Triangle.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/Triangle.tsx index 2f4065da9aa..612b1ca35e7 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/Triangle.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/Triangle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" type TriangleProps = Readonly<{ diff --git a/packages/@ourworldindata/grapher/src/sidePanel/SidePanel.tsx b/packages/@ourworldindata/grapher/src/sidePanel/SidePanel.tsx index 2aec229465e..31ff205d88f 100644 --- a/packages/@ourworldindata/grapher/src/sidePanel/SidePanel.tsx +++ b/packages/@ourworldindata/grapher/src/sidePanel/SidePanel.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { computed } from "mobx" import { Bounds } from "@ourworldindata/utils" diff --git a/packages/@ourworldindata/grapher/src/slideInDrawer/SlideInDrawer.tsx b/packages/@ourworldindata/grapher/src/slideInDrawer/SlideInDrawer.tsx index c620a9b14b6..5db02242440 100644 --- a/packages/@ourworldindata/grapher/src/slideInDrawer/SlideInDrawer.tsx +++ b/packages/@ourworldindata/grapher/src/slideInDrawer/SlideInDrawer.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import cx from "classnames" import { computed, action, observable } from "mobx" import { observer } from "mobx-react" diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.stories.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.stories.tsx index 2db3a068281..de0ac6a2e87 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.stories.tsx @@ -1,4 +1,3 @@ -import React from "react" import { SlopeChart } from "./SlopeChart" import { SampleColumnSlugs, diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.stories.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.stories.tsx index 9b0be6ab0e9..2a019f9b5ef 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.stories.tsx @@ -4,7 +4,7 @@ import { SynthesizeFruitTable, SynthesizeGDPTable, } from "@ourworldindata/core-table" -import React from "react" +import * as React from "react" import { StackedAreaChart } from "./StackedAreaChart" export default { diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx index a45e91b3c5a..538f16d3687 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { extend, reverse, diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.stories.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.stories.tsx index f00cedebd1e..68bd5f9a2d1 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { StackedBarChart } from "./StackedBarChart" import { SampleColumnSlugs, diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx index 6dcbab4f96c..c950aa58acc 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, action, observable } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.stories.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.stories.tsx index e04db971e5f..041115562c8 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { StackedDiscreteBarChart } from "./StackedDiscreteBarChart" import { SynthesizeFruitTable } from "@ourworldindata/core-table" diff --git a/packages/@ourworldindata/grapher/src/tabs/ExpandableTabs.tsx b/packages/@ourworldindata/grapher/src/tabs/ExpandableTabs.tsx index bd7a4a795df..c60655b5f07 100644 --- a/packages/@ourworldindata/grapher/src/tabs/ExpandableTabs.tsx +++ b/packages/@ourworldindata/grapher/src/tabs/ExpandableTabs.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react" +import { useState } from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faPlus, faMinus } from "@fortawesome/free-solid-svg-icons" import cx from "classnames" diff --git a/packages/@ourworldindata/grapher/src/tabs/Tabs.tsx b/packages/@ourworldindata/grapher/src/tabs/Tabs.tsx index b2b5f3165b4..71b5baf00fd 100644 --- a/packages/@ourworldindata/grapher/src/tabs/Tabs.tsx +++ b/packages/@ourworldindata/grapher/src/tabs/Tabs.tsx @@ -1,4 +1,5 @@ -import React, { useRef } from "react" +import { useRef } from "react" +import * as React from "react" import cx from "classnames" export interface TabLabel { diff --git a/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.stories.tsx b/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.stories.tsx index f765deff3ec..e46d670425e 100644 --- a/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.stories.tsx +++ b/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { TimelineComponent } from "./TimelineComponent" import { action, computed, observable } from "mobx" import { range } from "@ourworldindata/utils" diff --git a/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.tsx b/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.tsx index f78014f1a06..5d290561d51 100644 --- a/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.tsx +++ b/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { select } from "d3-selection" import cx from "classnames" import { diff --git a/packages/@ourworldindata/grapher/src/tooltip/Tooltip.tsx b/packages/@ourworldindata/grapher/src/tooltip/Tooltip.tsx index 01d11012823..ea928fa6a5a 100644 --- a/packages/@ourworldindata/grapher/src/tooltip/Tooltip.tsx +++ b/packages/@ourworldindata/grapher/src/tooltip/Tooltip.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import classnames from "classnames" import { observable, computed, action } from "mobx" import { observer } from "mobx-react" diff --git a/packages/@ourworldindata/grapher/src/tooltip/TooltipContents.tsx b/packages/@ourworldindata/grapher/src/tooltip/TooltipContents.tsx index a3a8b7f0f1d..18fad5e9d46 100644 --- a/packages/@ourworldindata/grapher/src/tooltip/TooltipContents.tsx +++ b/packages/@ourworldindata/grapher/src/tooltip/TooltipContents.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import classnames from "classnames" import { CoreColumn } from "@ourworldindata/core-table" import { NO_DATA_LABEL } from "../color/ColorScale.js" diff --git a/packages/@ourworldindata/grapher/src/tooltip/TooltipProps.ts b/packages/@ourworldindata/grapher/src/tooltip/TooltipProps.ts index 9fae113da6b..925f2b224a8 100644 --- a/packages/@ourworldindata/grapher/src/tooltip/TooltipProps.ts +++ b/packages/@ourworldindata/grapher/src/tooltip/TooltipProps.ts @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { CoreColumn } from "@ourworldindata/core-table" import { GrapherTooltipAnchor, diff --git a/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.stories.tsx b/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.stories.tsx index 42d9e94b5cb..c96b0172162 100644 --- a/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.stories.tsx +++ b/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { VerticalColorLegend, VerticalColorLegendManager, diff --git a/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.tsx b/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.tsx index ea659e517e2..00ce48d6aa8 100644 --- a/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.tsx +++ b/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { sum, max, makeIdForHumanConsumption } from "@ourworldindata/utils" import { TextWrap } from "@ourworldindata/components" import { computed } from "mobx" diff --git a/packages/@ourworldindata/utils/src/Tippy.tsx b/packages/@ourworldindata/utils/src/Tippy.tsx index 37f24c7f56c..41fb833da25 100644 --- a/packages/@ourworldindata/utils/src/Tippy.tsx +++ b/packages/@ourworldindata/utils/src/Tippy.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { default as OriginalTippy, TippyProps } from "@tippyjs/react" interface CustomTippyProps extends TippyProps { diff --git a/packages/@ourworldindata/utils/src/Util.ts b/packages/@ourworldindata/utils/src/Util.ts index 9908fd28753..0cc04c6a6f6 100644 --- a/packages/@ourworldindata/utils/src/Util.ts +++ b/packages/@ourworldindata/utils/src/Util.ts @@ -179,7 +179,7 @@ import { GRAPHER_CHART_TYPES, } from "@ourworldindata/types" import { PointVector } from "./PointVector.js" -import React from "react" +import * as React from "react" import { match, P } from "ts-pattern" export type NoUndefinedValues = { diff --git a/site/AboutThisData.tsx b/site/AboutThisData.tsx index 67b533b8f22..2cea09941a1 100644 --- a/site/AboutThisData.tsx +++ b/site/AboutThisData.tsx @@ -1,4 +1,3 @@ -import * as React from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { faArrowDown } from "@fortawesome/free-solid-svg-icons" import dayjs from "dayjs" diff --git a/site/AlertBanner.tsx b/site/AlertBanner.tsx index 5da3b515991..a43c7d35404 100644 --- a/site/AlertBanner.tsx +++ b/site/AlertBanner.tsx @@ -1,5 +1,3 @@ -import React from "react" - export const AlertBanner = () => { // 2023-03-23: This banner is now disabled, since we no longer want to highlight // the COVID-19 data this way. If we don't reuse this banner later for something diff --git a/site/BackToTopic.tsx b/site/BackToTopic.tsx index e522a17e27f..7480a5393f4 100644 --- a/site/BackToTopic.tsx +++ b/site/BackToTopic.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { SubNavId } from "@ourworldindata/types" import { getSubnavItem, subnavs } from "./SiteSubnavigation.js" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/site/BlogIndexPage.tsx b/site/BlogIndexPage.tsx index 72ec99d9d8a..29d224d91d8 100644 --- a/site/BlogIndexPage.tsx +++ b/site/BlogIndexPage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Head } from "./Head.js" import { SiteHeader } from "./SiteHeader.js" import { SiteFooter } from "./SiteFooter.js" diff --git a/site/Breadcrumb/Breadcrumb.tsx b/site/Breadcrumb/Breadcrumb.tsx index 07791a48301..01b84afbb50 100644 --- a/site/Breadcrumb/Breadcrumb.tsx +++ b/site/Breadcrumb/Breadcrumb.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Fragment } from "react" import { BreadcrumbItem } from "@ourworldindata/utils" import { SubNavId } from "@ourworldindata/types" import { getSubnavItem, SubnavItem, subnavs } from "../SiteSubnavigation.js" @@ -80,10 +80,10 @@ export const Breadcrumbs = ({ ) return ( - + {breadcrumb} {!isLast && } - + ) })} diff --git a/site/Byline.tsx b/site/Byline.tsx index 063b07f64bf..0042eaff219 100644 --- a/site/Byline.tsx +++ b/site/Byline.tsx @@ -1,4 +1,3 @@ -import React from "react" import { formatAuthors } from "./clientFormatting.js" export const Byline = ({ diff --git a/site/ChartListItemVariant.tsx b/site/ChartListItemVariant.tsx index 7579f02107a..d78fe12a6d1 100644 --- a/site/ChartListItemVariant.tsx +++ b/site/ChartListItemVariant.tsx @@ -1,4 +1,3 @@ -import React from "react" import { BasicChartInformation } from "@ourworldindata/utils" export const ChartListItemVariant = ({ diff --git a/site/CitationMeta.tsx b/site/CitationMeta.tsx index 584428d5fdc..c312f4db6ee 100644 --- a/site/CitationMeta.tsx +++ b/site/CitationMeta.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Fragment } from "react" import { dayjs } from "@ourworldindata/utils" export const CitationMeta = (props: { @@ -15,7 +15,7 @@ export const CitationMeta = (props: { authors = authors.concat(["Max Roser"]) return ( - + @@ -32,6 +32,6 @@ export const CitationMeta = (props: { {authors.map((author) => ( ))} - + ) } diff --git a/site/CookieNotice.tsx b/site/CookieNotice.tsx index 226548dba6f..9cc5c838f1c 100644 --- a/site/CookieNotice.tsx +++ b/site/CookieNotice.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react" +import { useEffect, useState } from "react" import classnames from "classnames" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faCheck } from "@fortawesome/free-solid-svg-icons" diff --git a/site/CookiePreferencesManager.tsx b/site/CookiePreferencesManager.tsx index 44f9552f331..605629a0b64 100644 --- a/site/CookiePreferencesManager.tsx +++ b/site/CookiePreferencesManager.tsx @@ -1,5 +1,5 @@ import ReactDOM from "react-dom" -import React, { useEffect, useMemo, useReducer } from "react" +import { useEffect, useMemo, useReducer } from "react" import Cookies from "js-cookie" import { CookiePreferences } from "../site/blocks/CookiePreferences.js" import { CookieNotice } from "../site/CookieNotice.js" diff --git a/site/CountriesIndexPage.tsx b/site/CountriesIndexPage.tsx index 80f82958687..b454f9057e2 100644 --- a/site/CountriesIndexPage.tsx +++ b/site/CountriesIndexPage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Head } from "./Head.js" import { SiteHeader } from "./SiteHeader.js" import { SiteFooter } from "./SiteFooter.js" diff --git a/site/CountryProfilePage.tsx b/site/CountryProfilePage.tsx index 9cf15071f07..78995a1f59e 100644 --- a/site/CountryProfilePage.tsx +++ b/site/CountryProfilePage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Head } from "./Head.js" import { SiteHeader } from "./SiteHeader.js" import { SiteFooter } from "./SiteFooter.js" diff --git a/site/DataCatalog/DataCatalog.tsx b/site/DataCatalog/DataCatalog.tsx index e0188c964e4..411a99738e5 100644 --- a/site/DataCatalog/DataCatalog.tsx +++ b/site/DataCatalog/DataCatalog.tsx @@ -1,4 +1,5 @@ -import React, { useEffect, useMemo, useReducer, useRef, useState } from "react" +import { useEffect, useMemo, useReducer, useRef, useState } from "react" +import * as React from "react" import ReactDOM from "react-dom" import cx from "classnames" import { diff --git a/site/DataCatalog/DataCatalogPage.tsx b/site/DataCatalog/DataCatalogPage.tsx index 0ff28a1a7c3..20a4b53cc50 100644 --- a/site/DataCatalog/DataCatalogPage.tsx +++ b/site/DataCatalog/DataCatalogPage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Head } from "../Head.js" import { SiteHeader } from "../SiteHeader.js" import { SiteFooter } from "../SiteFooter.js" diff --git a/site/DataCatalog/DataCatalogSkeletons.tsx b/site/DataCatalog/DataCatalogSkeletons.tsx index 731ab1853e1..8d116eb830f 100644 --- a/site/DataCatalog/DataCatalogSkeletons.tsx +++ b/site/DataCatalog/DataCatalogSkeletons.tsx @@ -1,4 +1,3 @@ -import React from "react" import cx from "classnames" // 💀 Beware! Spooky skeletons for the data catalog 💀 diff --git a/site/DataInsightsIndexPage.tsx b/site/DataInsightsIndexPage.tsx index 1c77a98247f..de12b2f3bbe 100644 --- a/site/DataInsightsIndexPage.tsx +++ b/site/DataInsightsIndexPage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Head } from "./Head.js" import { SiteHeader } from "./SiteHeader.js" import { SiteFooter } from "./SiteFooter.js" diff --git a/site/DataInsightsIndexPageContent.tsx b/site/DataInsightsIndexPageContent.tsx index ba39a1c16a2..622d85b04b4 100644 --- a/site/DataInsightsIndexPageContent.tsx +++ b/site/DataInsightsIndexPageContent.tsx @@ -1,4 +1,3 @@ -import React from "react" import cx from "classnames" import ReactDOM from "react-dom" import { diff --git a/site/DataInsightsNewsletterBanner.tsx b/site/DataInsightsNewsletterBanner.tsx index aebce5284e7..9bdea248a0d 100644 --- a/site/DataInsightsNewsletterBanner.tsx +++ b/site/DataInsightsNewsletterBanner.tsx @@ -1,4 +1,3 @@ -import * as React from "react" import { useState, useEffect } from "react" import Cookies from "js-cookie" import cx from "classnames" diff --git a/site/DataPageV2.tsx b/site/DataPageV2.tsx index e3c4814ca76..84af3798425 100644 --- a/site/DataPageV2.tsx +++ b/site/DataPageV2.tsx @@ -17,7 +17,6 @@ import { Url, } from "@ourworldindata/utils" import { MarkdownTextWrap } from "@ourworldindata/components" -import React from "react" import urljoin from "url-join" import { ADMIN_BASE_URL, diff --git a/site/DataPageV2Content.tsx b/site/DataPageV2Content.tsx index 8cb1c996938..5b46203187c 100644 --- a/site/DataPageV2Content.tsx +++ b/site/DataPageV2Content.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo } from "react" +import { useState, useEffect, useMemo } from "react" import { Grapher, GrapherProgrammaticInterface } from "@ourworldindata/grapher" import { REUSE_THIS_WORK_SECTION_ID, @@ -73,7 +73,7 @@ export const DataPageV2Content = ({ grapherConfig: GrapherInterface imageMetadata: Record }) => { - const [grapher, setGrapher] = React.useState(undefined) + const [grapher, setGrapher] = useState(undefined) const titleFragments = joinTitleFragments( datapageData.attributionShort, diff --git a/site/DataToken.tsx b/site/DataToken.tsx index b1fb784c061..0bf738031b4 100644 --- a/site/DataToken.tsx +++ b/site/DataToken.tsx @@ -1,4 +1,3 @@ -import React from "react" import { dictionary } from "./runDataTokens.js" export const DataToken_name = "DataToken" diff --git a/site/DonateForm.tsx b/site/DonateForm.tsx index d6e910660fe..a914fee14e8 100644 --- a/site/DonateForm.tsx +++ b/site/DonateForm.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import ReactDOM from "react-dom" import cx from "classnames" import { observable, action, computed } from "mobx" diff --git a/site/DonatePage.tsx b/site/DonatePage.tsx index b9fdb0d6ab5..972387bff10 100644 --- a/site/DonatePage.tsx +++ b/site/DonatePage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Head } from "./Head.js" import { SiteHeader } from "./SiteHeader.js" import { SiteFooter } from "./SiteFooter.js" diff --git a/site/ExplorerIndex.tsx b/site/ExplorerIndex.tsx index f71adbad07b..4e21042c8b7 100644 --- a/site/ExplorerIndex.tsx +++ b/site/ExplorerIndex.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { useState } from "react" import ReactDOM from "react-dom" import { MinimalExplorerInfo } from "@ourworldindata/types" import { EXPLORER_DYNAMIC_THUMBNAIL_URL } from "../settings/clientSettings.js" @@ -11,7 +11,7 @@ function ExplorerIndexPageCard(props: { explorer: MinimalExplorerInfo }) { const { baseUrl, explorer } = props - const [hasError, setHasError] = React.useState(false) + const [hasError, setHasError] = useState(false) return (
  • { +export class FeedbackPage extends Component<{ baseUrl: string }> { render() { const { baseUrl } = this.props return ( diff --git a/site/Footnote.tsx b/site/Footnote.tsx index 43a87f6a753..cd933ca400c 100644 --- a/site/Footnote.tsx +++ b/site/Footnote.tsx @@ -1,5 +1,4 @@ import { isNil, parseIntOrUndefined, Tippy } from "@ourworldindata/utils" -import React from "react" import ReactDOM from "react-dom" export const Footnote = ({ diff --git a/site/GrapherFigureView.tsx b/site/GrapherFigureView.tsx index 46b567e4b13..8f1d472f566 100644 --- a/site/GrapherFigureView.tsx +++ b/site/GrapherFigureView.tsx @@ -1,4 +1,4 @@ -import React, { useRef } from "react" +import { useRef } from "react" import { Grapher, GrapherProgrammaticInterface } from "@ourworldindata/grapher" import { diff --git a/site/GrapherImage.tsx b/site/GrapherImage.tsx index 8d14c518b5e..95e0d34fde3 100644 --- a/site/GrapherImage.tsx +++ b/site/GrapherImage.tsx @@ -1,5 +1,3 @@ -import React from "react" - import { DEFAULT_GRAPHER_HEIGHT, DEFAULT_GRAPHER_WIDTH, diff --git a/site/GrapherPage.jsdom.test.tsx b/site/GrapherPage.jsdom.test.tsx index 4f2a9b3f3b3..f6c16d91c1b 100755 --- a/site/GrapherPage.jsdom.test.tsx +++ b/site/GrapherPage.jsdom.test.tsx @@ -1,12 +1,9 @@ -#! /usr/bin/env jest - -import { GrapherInterface } from "@ourworldindata/types" +#! /usr/bin/env jestimport { GrapherInterface } from "@ourworldindata/types" import { DimensionProperty, KeyChartLevel, RelatedChart, } from "@ourworldindata/utils" -import React from "react" import { ChartListItemVariant } from "./ChartListItemVariant.js" import { GrapherPage } from "./GrapherPage.js" import { SiteFooter } from "./SiteFooter.js" diff --git a/site/GrapherPage.tsx b/site/GrapherPage.tsx index 22e1dceb5ac..c5c3929fc2e 100644 --- a/site/GrapherPage.tsx +++ b/site/GrapherPage.tsx @@ -14,7 +14,6 @@ import { Url, } from "@ourworldindata/utils" import { MarkdownTextWrap } from "@ourworldindata/components" -import React from "react" import urljoin from "url-join" import { ADMIN_BASE_URL, diff --git a/site/GrapherWithFallback.tsx b/site/GrapherWithFallback.tsx index 3849df575ff..fc0bc1d9c99 100644 --- a/site/GrapherWithFallback.tsx +++ b/site/GrapherWithFallback.tsx @@ -1,5 +1,4 @@ import { Grapher } from "@ourworldindata/grapher" -import React from "react" import { GrapherFigureView } from "./GrapherFigureView.js" import cx from "classnames" import { GRAPHER_PREVIEW_CLASS } from "./SiteConstants.js" diff --git a/site/Head.tsx b/site/Head.tsx index 575c57774b5..29b9683892a 100644 --- a/site/Head.tsx +++ b/site/Head.tsx @@ -1,4 +1,3 @@ -import React from "react" import { viteAssetsForSite } from "./viteUtils.js" import { GOOGLE_TAG_MANAGER_ID } from "../settings/clientSettings.js" import { NoJSDetector } from "./NoJSDetector.js" diff --git a/site/Html.tsx b/site/Html.tsx index a3373f270a9..2a31bb0fbab 100644 --- a/site/Html.tsx +++ b/site/Html.tsx @@ -1,5 +1,5 @@ import cx from "classnames" -import React, { HtmlHTMLAttributes } from "react" +import { HtmlHTMLAttributes } from "react" /** * Renders a element with the class "js-disabled" to indicate that JavaScript is disabled. diff --git a/site/IframeDetector.tsx b/site/IframeDetector.tsx index c7706fb28e3..9f695d94e34 100644 --- a/site/IframeDetector.tsx +++ b/site/IframeDetector.tsx @@ -1,5 +1,4 @@ import { GRAPHER_IS_IN_IFRAME_CLASS } from "@ourworldindata/grapher" -import React from "react" export const IFrameDetector = () => (