mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-02 14:22:55 +00:00
[website] Highlight active docs section (#26460)
* Add functionality to have left navbar section open on page load * highlight active section * color change --------- Co-authored-by: Corwin Smith <cssmittys@gmail.com>
This commit is contained in:
parent
dee8a630d3
commit
49e65e6407
1 changed files with 3 additions and 2 deletions
|
|
@ -52,7 +52,7 @@ export const DocsLinks: FC<Props> = ({ navLinks, toggleMobileAccordion }) => {
|
||||||
const split = to?.split('/');
|
const split = to?.split('/');
|
||||||
const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1];
|
const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1];
|
||||||
const index = openSections[id] ? 0 : -1;
|
const index = openSections[id] ? 0 : -1;
|
||||||
|
const isSectionActive = !!openSections[id];
|
||||||
return (
|
return (
|
||||||
<Accordion key={id} index={index} allowToggle mt='0 !important'>
|
<Accordion key={id} index={index} allowToggle mt='0 !important'>
|
||||||
<AccordionItem border='none'>
|
<AccordionItem border='none'>
|
||||||
|
|
@ -73,7 +73,8 @@ export const DocsLinks: FC<Props> = ({ navLinks, toggleMobileAccordion }) => {
|
||||||
borderRight={items ? '2px' : 'none'}
|
borderRight={items ? '2px' : 'none'}
|
||||||
borderColor='primary'
|
borderColor='primary'
|
||||||
w='100%'
|
w='100%'
|
||||||
bg='bg'
|
bg={isSectionActive ? 'secondary' : 'bg'}
|
||||||
|
color={isSectionActive ? 'body' : 'primary'}
|
||||||
_groupHover={{ background: 'primary', color: 'bg', textDecoration: 'none' }}
|
_groupHover={{ background: 'primary', color: 'bg', textDecoration: 'none' }}
|
||||||
>
|
>
|
||||||
{to ? (
|
{to ? (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue