From 387d443a6ee0c3d48c7b64165435d1cfad29a05d Mon Sep 17 00:00:00 2001 From: Mika Munterud Date: Fri, 19 Jan 2024 10:37:50 +0100 Subject: [PATCH 1/3] DIGG-217-beta: Updating ContainerPage structure and fixing sticky nav --- components/content/ContainerPage/index.tsx | 77 ++++++++------------ components/navigation/ContainerNav/index.tsx | 5 +- components/navigation/StickyNav/index.tsx | 35 ++++++--- 3 files changed, 58 insertions(+), 59 deletions(-) diff --git a/components/content/ContainerPage/index.tsx b/components/content/ContainerPage/index.tsx index 2dde4fac2..94739d4d5 100644 --- a/components/content/ContainerPage/index.tsx +++ b/components/content/ContainerPage/index.tsx @@ -48,7 +48,7 @@ export const highlightCodeBlock = async () => { const getLinks = () => { const menuItems: Anchorlink[] = []; const cont: HTMLElement = - document.querySelector(".content") || document.createElement("div"); + document.querySelector("#content") || document.createElement("div"); const hTags = Array.prototype.slice.call( cont.querySelectorAll("h2") || document.createElement("div"), @@ -137,54 +137,41 @@ export const ContainerPage: React.FC = ({ return ( -
+
{hasRelatedContent && ( )} - - {!image && heading && ( - - {checkLang(heading)} - - )} - - {menuItems.length > 2 && ( -
); diff --git a/components/navigation/ContainerNav/index.tsx b/components/navigation/ContainerNav/index.tsx index f290cff6e..7c6255388 100644 --- a/components/navigation/ContainerNav/index.tsx +++ b/components/navigation/ContainerNav/index.tsx @@ -33,7 +33,8 @@ export const ContainerNav: React.FC = ({ return (