diff --git a/adminSiteServer/mockSiteRouter.tsx b/adminSiteServer/mockSiteRouter.tsx index d0af0cdc9d8..eb1d6883954 100644 --- a/adminSiteServer/mockSiteRouter.tsx +++ b/adminSiteServer/mockSiteRouter.tsx @@ -42,7 +42,7 @@ import { ExplorerAdminServer } from "../explorerAdminServer/ExplorerAdminServer. import { grapherToSVG } from "../baker/GrapherImageBaker.js" import { getVariableData, getVariableMetadata } from "../db/model/Variable.js" import { MultiEmbedderTestPage } from "../site/multiembedder/MultiEmbedderTestPage.js" -import { JsonError, noop } from "@ourworldindata/utils" +import { JsonError } from "@ourworldindata/utils" import { GIT_CMS_DIR } from "../gitCms/GitCmsConstants.js" import { EXPLORERS_ROUTE_FOLDER } from "../explorer/ExplorerConstants.js" import { getExplorerRedirectForPath } from "../explorerAdminServer/ExplorerRedirects.js" diff --git a/baker/siteRenderers.tsx b/baker/siteRenderers.tsx index 063326ec055..547360a807d 100644 --- a/baker/siteRenderers.tsx +++ b/baker/siteRenderers.tsx @@ -7,7 +7,6 @@ import { SearchPage } from "../site/search/SearchPage.js" import { NotFoundPage } from "../site/NotFoundPage.js" import { DonatePage } from "../site/DonatePage.js" import { ThankYouPage } from "../site/ThankYouPage.js" -import { MultiDimDataPage } from "../site/multiDim/MultiDimDataPage.js" import OwidGdocPage from "../site/gdocs/OwidGdocPage.js" import React from "react" import ReactDOMServer from "react-dom/server.js" @@ -91,7 +90,6 @@ import { transformExplorerProgramToResolveCatalogPaths } from "./ExplorerBaker.j import { AttachmentsContext } from "../site/gdocs/OwidGdoc.js" import AtomArticleBlocks from "../site/gdocs/components/AtomArticleBlocks.js" import { GdocDataInsight } from "../db/model/Gdoc/GdocDataInsight.js" -import { MultiDimDataPageConfig } from "../site/multiDim/MultiDimDataPageConfig.js" export const renderToHtmlPage = (element: any) => `${ReactDOMServer.renderToStaticMarkup(element)}` diff --git a/site/multiDim/MultiDimDataPageContent.tsx b/site/multiDim/MultiDimDataPageContent.tsx index de708a4159b..0f43c380ce7 100644 --- a/site/multiDim/MultiDimDataPageContent.tsx +++ b/site/multiDim/MultiDimDataPageContent.tsx @@ -57,15 +57,6 @@ declare global { } export const OWID_DATAPAGE_CONTENT_ROOT_ID = "owid-datapageJson-root" -// https://blog.logrocket.com/accessing-previous-props-state-react-hooks/ -function usePrevious(value: T) { - const ref = useRef() - useEffect(() => { - ref.current = value - }, [value]) - return ref.current -} - // We still have topic pages on WordPress, whose featured images are specified as absolute URLs which this component handles // Once we've migrated all WP topic pages to gdocs, we'll be able to remove this component and just use const DatapageResearchThumbnail = ({ @@ -156,12 +147,12 @@ export const MultiDimDataPageContent = ({ // _datapageData, config, grapherConfig, - isPreviewing = false, + // isPreviewing = false, faqEntries, primaryTopic, canonicalUrl = "{URL}", // when we bake pages to their proper url this will be set correctly but on preview pages we leave this undefined tagToSlugMap, - imageMetadata, + // imageMetadata, initialQueryStr, }: DataPageV2ContentFields & { config: MultiDimDataPageConfig @@ -339,8 +330,6 @@ export const MultiDimDataPageContent = ({ ) }, [datapageDataFromVar?.faqs, faqEntries]) - console.log(faqEntriesForView) - return (