From e377d74419e7d2877ffc2b7943e068024999520b Mon Sep 17 00:00:00 2001 From: Mike Surowiec Date: Mon, 21 Jun 2021 14:55:49 -0700 Subject: [PATCH] React: import necessary javascripts directly (#20001) * import javascript files directly * move globally required js to _app * fix: js initialization * set next env for tests --- components/DefaultLayout.tsx | 4 +- components/PrintAction.tsx | 16 +++++++ components/article/ArticleTitle.tsx | 19 +++----- components/context/MainContext.tsx | 2 - .../release-notes/GHESReleaseNotePatch.tsx | 5 +- components/sublanding/LearningTrack.tsx | 48 ++++++++++--------- javascripts/copy-code.ts | 2 +- javascripts/experiment.ts | 1 - pages/[versionId]/[productId]/index.tsx | 19 ++++++++ .../[versionId]/graphql/overview/explorer.tsx | 16 ++++--- pages/_app.tsx | 12 +++++ 11 files changed, 95 insertions(+), 49 deletions(-) create mode 100644 components/PrintAction.tsx diff --git a/components/DefaultLayout.tsx b/components/DefaultLayout.tsx index 3440cf2470e0..a88f2bd228ec 100644 --- a/components/DefaultLayout.tsx +++ b/components/DefaultLayout.tsx @@ -11,7 +11,7 @@ import { useTranslation } from './hooks/useTranslation' type Props = { children?: React.ReactNode } export const DefaultLayout = (props: Props) => { - const { builtAssets, page, error, isHomepageVersion } = useMainContext() + const { page, error, isHomepageVersion } = useMainContext() const { t } = useTranslation('errors') return (
@@ -22,8 +22,6 @@ export const DefaultLayout = (props: Props) => { {page.fullTitle} ) : null} -