Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 1629 collapse navigation #1796

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions frontend/src/components/BCHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,20 @@ const BCHeader = () => {

return (
<HeaderContainer
isSideNavExpanded
render={({ isSideNavExpanded, onClickSideNavExpand }: HearderContainerProps) => (
<Header
aria-label={componentTexts.completeTitle}
className="spar-header"
className={`spar-header ${!isSideNavExpanded ? 'spar-header-expanded' : ''}`}
data-testid="header"
onClick={isSideNavExpanded ? onClickSideNavExpand : null}
>
<SkipToContent />
{
!(location.pathname.endsWith('/403') || location.pathname.endsWith('/404'))
? (
<HeaderMenuButton
aria-label={componentTexts.openMenu}
isCollapsible
onClick={onClickSideNavExpand}
isActive={isSideNavExpanded}
/>
Expand Down Expand Up @@ -179,9 +180,7 @@ const BCHeader = () => {
isChildOfHeader
expanded={isSideNavExpanded}
aria-label={componentTexts.sideMenuAriaLabel}
inert={undefined}
className="spar-side-nav"
onClick={isSideNavExpanded ? onClickSideNavExpand : null}
className={`spar-side-nav ${!isSideNavExpanded ? 'spar-side-nav-expanded' : ''}`}
>
<div className="side-nav-top">
{
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/BCHeader/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
justify-content: space-between;
overflow-y: auto;

&.spar-side-nav-expanded {
inline-size: 0;
}

.side-nav-top {
padding-top: 1rem;
}
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/layout/PrivateLayout/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.main-container {
padding-top: 5.625rem;
padding-left: 16rem;
transition: padding-left 0.11s cubic-bezier(0.2, 0, 1, 0.9), transform 0.11s cubic-bezier(0.2, 0, 1, 0.9);

.dependency-notification {
max-width: none;
Expand All @@ -11,6 +11,11 @@
}
}

header.spar-header:not(.spar-header-expanded) + div.main-container {
padding-left: 16rem;
transition: padding-left 0.11s cubic-bezier(0.2, 0, 1, 0.9), transform 0.11s cubic-bezier(0.2, 0, 1, 0.9);
}

.page-content .#{vars.$bcgov-prefix}--grid {
max-width: none;
}
Expand All @@ -26,7 +31,8 @@
}

@media only screen and (max-width: 1055px) {
.main-container {
.main-container,
header.spar-header:not(.spar-header-expanded) + div.main-container {
padding-top: 5rem;
padding-left: 0;
}
Expand Down
Loading