From a511c95c7ff896b99c8cb8fcf7ff08f249161eb1 Mon Sep 17 00:00:00 2001 From: Mike Surowiec Date: Thu, 29 Jul 2021 13:27:20 -0400 Subject: [PATCH] SCSS and Component cleanup (pt 1) (#20572) * turn article.scss into a module + componentized * Update Survey to use only component styles, add cancel button * Update GenericError + 404 page to use only standard classes * update LearningTrack to not use markdown-body * remove / consolidate stylesheets * cleanup Graphiql explorer page and scss * Componentize Breadcrumb styles * Componentize DeprecationBanner styles * scope h2 a link style to markdown-body * cleanup nav, organize page-header and page-footer components * remove unused scroll-button.scss * organize LanguagePicker and ProductPicker * add declarations file * remove featured-links.scss, update tests * update list utility and toc test * fix bad merge resolution * update breadcrumbs test --- Dockerfile | 1 + components/Breadcrumbs.tsx | 44 +++---- components/DefaultLayout.tsx | 8 +- components/DeprecationBanner.tsx | 38 ------ components/GenericError.tsx | 4 +- components/article/ArticleContent.tsx | 12 ++ .../article/ArticleGridLayout.module.scss | 15 +-- components/article/ArticleGridLayout.tsx | 28 +++++ components/article/ArticlePage.tsx | 103 +++++++--------- components/article/ArticleTopper.tsx | 18 +++ components/article/LearningTrackNav.tsx | 2 +- components/context/LanguagesContext.tsx | 8 -- components/context/TocLandingContext.tsx | 7 +- components/declarations.d.ts | 4 + components/landing/TableOfContents.tsx | 49 ++++---- components/landing/TocLanding.tsx | 112 +++++++----------- components/{ => page-footer}/Contribution.tsx | 0 components/{ => page-footer}/SmallFooter.tsx | 0 components/{ => page-footer}/Support.tsx | 0 .../{ => page-footer}/SupportSection.tsx | 8 +- components/{ => page-footer}/Survey.tsx | 32 ++++- components/page-header/DeprecationBanner.tsx | 40 +++++++ components/{ => page-header}/Header.tsx | 6 +- .../HeaderNotifications.module.scss | 4 + .../{ => page-header}/HeaderNotifications.tsx | 20 ++-- .../{ => page-header}/LanguagePicker.tsx | 2 +- .../{ => page-header}/ProductPicker.tsx | 0 components/sublanding/LearningTracks.tsx | 10 +- pages/404.tsx | 4 +- .../[versionId]/graphql/overview/explorer.tsx | 42 ++++--- pages/_app.tsx | 22 ++-- pages/index.tsx | 2 +- stylesheets/breadcrumbs.scss | 17 --- stylesheets/deprecation-banner.scss | 24 ---- stylesheets/dev-toc.scss | 14 --- stylesheets/explorer.scss | 8 -- stylesheets/featured-links.scss | 16 --- stylesheets/headings.scss | 14 +-- stylesheets/index.scss | 12 -- stylesheets/lists.scss | 4 - stylesheets/nav.scss | 98 --------------- stylesheets/opacity.scss | 12 -- stylesheets/print.scss | 8 -- stylesheets/scroll-button.scss | 20 ---- stylesheets/survey.scss | 8 -- stylesheets/underline-dashed.scss | 13 -- stylesheets/utilities.scss | 47 ++++++++ tests/content/featured-links.js | 4 +- tests/rendering/breadcrumbs.js | 28 ++--- tests/rendering/header.js | 40 +++---- tests/rendering/server.js | 2 +- .../routing/deprecated-enterprise-versions.js | 8 +- 52 files changed, 441 insertions(+), 601 deletions(-) delete mode 100644 components/DeprecationBanner.tsx create mode 100644 components/article/ArticleContent.tsx rename stylesheets/article.scss => components/article/ArticleGridLayout.module.scss (73%) create mode 100644 components/article/ArticleGridLayout.tsx create mode 100644 components/article/ArticleTopper.tsx create mode 100644 components/declarations.d.ts rename components/{ => page-footer}/Contribution.tsx (100%) rename components/{ => page-footer}/SmallFooter.tsx (100%) rename components/{ => page-footer}/Support.tsx (100%) rename components/{ => page-footer}/SupportSection.tsx (78%) rename components/{ => page-footer}/Survey.tsx (81%) create mode 100644 components/page-header/DeprecationBanner.tsx rename components/{ => page-header}/Header.tsx (95%) create mode 100644 components/page-header/HeaderNotifications.module.scss rename components/{ => page-header}/HeaderNotifications.tsx (83%) rename components/{ => page-header}/LanguagePicker.tsx (97%) rename components/{ => page-header}/ProductPicker.tsx (100%) delete mode 100644 stylesheets/breadcrumbs.scss delete mode 100644 stylesheets/deprecation-banner.scss delete mode 100644 stylesheets/dev-toc.scss delete mode 100644 stylesheets/explorer.scss delete mode 100644 stylesheets/featured-links.scss delete mode 100644 stylesheets/nav.scss delete mode 100644 stylesheets/opacity.scss delete mode 100644 stylesheets/print.scss delete mode 100644 stylesheets/scroll-button.scss delete mode 100644 stylesheets/survey.scss delete mode 100644 stylesheets/underline-dashed.scss diff --git a/Dockerfile b/Dockerfile index b320d4c8ae4b..1580f03fa863 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,7 @@ COPY content/index.md ./content/index.md COPY next.config.js ./next.config.js COPY tsconfig.json ./tsconfig.json +COPY next-env.d.ts ./next-env.d.ts RUN npx tsc --noEmit diff --git a/components/Breadcrumbs.tsx b/components/Breadcrumbs.tsx index 5535675b0d95..b110311b3394 100644 --- a/components/Breadcrumbs.tsx +++ b/components/Breadcrumbs.tsx @@ -18,31 +18,35 @@ export const Breadcrumbs = ({ variant = 'default' }: Props) => { const { breadcrumbs } = useMainContext() return ( -