@@ -2,10 +2,7 @@ import React from 'react';
22import { getWindow } from 'utils/ssr' ;
33import Link from 'next/link' ;
44import { Box , BoxProps , ScreenReaderOnly , styles } from '@sparkpost/matchbox' ;
5- import {
6- KeyboardArrowDown ,
7- KeyboardArrowUp ,
8- } from '@sparkpost/matchbox-icons' ;
5+ import { KeyboardArrowDown , KeyboardArrowUp } from '@sparkpost/matchbox-icons' ;
96import styled from 'styled-components' ;
107import css from '@styled-system/css' ;
118import { tokens } from '@sparkpost/design-tokens' ;
@@ -36,22 +33,22 @@ export const StyledLink = styled.a<{ $active?: boolean; $level?: number }>`
3633 &:active {
3734 text-decoration: none;
3835 ${ ( { $active, $level } ) =>
39- css ( {
40- py : '200' ,
41- pr : '700' ,
42- pl : `calc(${ tokens . spacing_500 } + ${ tokens . spacing_200 } * ${ $level } )` ,
43- bg : $active ? 'blue.700' : 'transparent' ,
44- color : $active ? 'white' : 'gray.900' ,
45- } ) }
36+ css ( {
37+ py : '200' ,
38+ pr : '700' ,
39+ pl : `calc(${ tokens . spacing_500 } + ${ tokens . spacing_200 } * ${ $level } )` ,
40+ bg : $active ? 'blue.700' : 'transparent' ,
41+ color : $active ? 'white' : 'gray.900' ,
42+ } ) }
4643 }
4744
4845 &:hover {
4946 ${ ( { $active } ) => {
50- return css ( {
51- bg : $active ? 'blue.700' : 'gray.200' ,
52- color : $active ? 'white' : 'gray.900' ,
53- } ) ;
54- } }
47+ return css ( {
48+ bg : $active ? 'blue.700' : 'gray.200' ,
49+ color : $active ? 'white' : 'gray.900' ,
50+ } ) ;
51+ } }
5552 }
5653` ;
5754
@@ -116,15 +113,15 @@ const Chevron = (props: { expanded: boolean }): JSX.Element => {
116113 return expanded ? < KeyboardArrowUp size = { 18 } /> : < KeyboardArrowDown size = { 18 } /> ;
117114} ;
118115
119- const StyledChevronWrapper = styled ( Box ) < BoxProps & { $active ?: boolean } > `
116+ const StyledChevronWrapper = styled ( Box ) < BoxProps & { $active ?: boolean } > `
120117 ${ styles . buttonReset }
121118 cursor: pointer;
122119 &:hover {
123120 ${ ( { $active } ) => {
124- return css ( {
125- color : $active ? 'white' : 'blue.700' ,
126- } ) ;
127- } }
121+ return css ( {
122+ color : $active ? 'white' : 'blue.700' ,
123+ } ) ;
124+ } }
128125 }
129126 ${ ( { $active } ) => {
130127 return css ( {
@@ -148,7 +145,7 @@ const Item = (props: NavigationItemProps): JSX.Element => {
148145
149146 setExpanded ( isExpanded ) ;
150147 setActive ( isActive ) ;
151- } , [ link , activeUrl ] ) ;
148+ } , [ link , activeUrl , hasActiveChild ] ) ;
152149
153150 return (
154151 < Box fontSize = "200" lineHeight = "200" position = "relative" >
0 commit comments