Skip to content

Commit

Permalink
style: fix eslint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber committed Aug 9, 2024
1 parent 62388c1 commit c6cf2ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion adminSiteServer/mockSiteRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions baker/siteRenderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) =>
`<!doctype html>${ReactDOMServer.renderToStaticMarkup(element)}`
Expand Down
15 changes: 2 additions & 13 deletions site/multiDim/MultiDimDataPageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(value: T) {
const ref = useRef<T>()
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 <Image />
const DatapageResearchThumbnail = ({
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -339,8 +330,6 @@ export const MultiDimDataPageContent = ({
)
}, [datapageDataFromVar?.faqs, faqEntries])

console.log(faqEntriesForView)

return (
<div className="DataPageContent MultiDimDataPageContent">
<div className="bg-blue-10">
Expand Down

0 comments on commit c6cf2ca

Please sign in to comment.