From e47e68b96036cd1fab5b358fb2f10c7ff619413d Mon Sep 17 00:00:00 2001 From: Boban Date: Fri, 11 Oct 2024 10:42:04 -0400 Subject: [PATCH] Fix accordion interaction in eCR Viewer summary (#2748) * move top to nav-wrapper * remove sticky-nav class and add sticky to nav-wrapper * remove extra div around side nav * remove excess styles --- .../src/app/tests/components/SideNav.test.tsx | 2 +- .../__snapshots__/SideNav.test.tsx.snap | 176 +++++++++--------- .../src/app/view-data/components/SideNav.tsx | 20 +- .../ecr-viewer/src/styles/custom-styles.scss | 15 +- 4 files changed, 99 insertions(+), 114 deletions(-) diff --git a/containers/ecr-viewer/src/app/tests/components/SideNav.test.tsx b/containers/ecr-viewer/src/app/tests/components/SideNav.test.tsx index 551d8721c8..69a7a23c5a 100644 --- a/containers/ecr-viewer/src/app/tests/components/SideNav.test.tsx +++ b/containers/ecr-viewer/src/app/tests/components/SideNav.test.tsx @@ -113,7 +113,7 @@ describe("SectionConfig", () => { expect(screen.getByRole("navigation")).toHaveClass("top-550"); }); it("should have top0 when integrated viewer", () => { - delete process.env.NEXT_PUBLIC_NON_INTEGRATED_VIEWER; + process.env.NEXT_PUBLIC_NON_INTEGRATED_VIEWER = "false"; render(); expect(screen.getByRole("navigation")).toHaveClass("top-0"); }); diff --git a/containers/ecr-viewer/src/app/tests/components/__snapshots__/SideNav.test.tsx.snap b/containers/ecr-viewer/src/app/tests/components/__snapshots__/SideNav.test.tsx.snap index 81f5e871b2..cc9416e1e7 100644 --- a/containers/ecr-viewer/src/app/tests/components/__snapshots__/SideNav.test.tsx.snap +++ b/containers/ecr-viewer/src/app/tests/components/__snapshots__/SideNav.test.tsx.snap @@ -2,111 +2,107 @@ exports[`SectionConfig should match the snapshot 1`] = ` - - + + +

{ let sideNavItems = buildSideNav(sectionConfigs); return ( -
- -
+ ); }; diff --git a/containers/ecr-viewer/src/styles/custom-styles.scss b/containers/ecr-viewer/src/styles/custom-styles.scss index 8f8b2f89bd..0a71faec07 100644 --- a/containers/ecr-viewer/src/styles/custom-styles.scss +++ b/containers/ecr-viewer/src/styles/custom-styles.scss @@ -314,7 +314,7 @@ td { } .back-button { - margin-bottom:1.5rem; + margin-bottom: 1.5rem; } .content-wrapper { @@ -326,19 +326,10 @@ td { .nav-wrapper { margin-top: 1.5rem; padding-top: .63rem; - display: flex; - flex-direction: column; - align-items: flex-start; width: $nav-wrapper-width; min-width: $nav-wrapper-width; -} - -.sticky-nav { - flex-grow: 0; - flex-shrink: 0; - flex-basis: auto; position: sticky; - min-width: 100%; + height: 100vh; } .ecr-viewer-container { @@ -568,7 +559,7 @@ h3 { } } -.condition-details-accordion{ +.condition-details-accordion { .usa-accordion__heading.border-accent-cool-darker { &:not(:first-child) { margin-top: 1.12rem;