Skip to content

Commit

Permalink
feat: adjusting styles and header component
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaseta committed Dec 20, 2024
1 parent 7425b3f commit 7543bcd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
10 changes: 5 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={false}
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,8 @@ 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' : ''}`}
onClick={onClickSideNavExpand}
>
<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
7 changes: 6 additions & 1 deletion 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 Down

0 comments on commit 7543bcd

Please sign in to comment.