Skip to content

Commit ae460d9

Browse files
authored
Added transitions to dropdowns (#1265)
* added transitions to dropdowns * fomratting of code * Reverted changes in filtersvg file to match that of main
1 parent ee7f95a commit ae460d9

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

components/Sidebar.tsx

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,14 @@ export const DocsNav = ({
360360
</svg>
361361
</div>
362362
<div
363-
className={classnames('ml-6', { hidden: !active.getDocs })}
363+
className={classnames(
364+
'ml-6',
365+
'transition-all duration-500 ease-in-out',
366+
{
367+
'max-h-0 opacity-0 overflow-hidden': !active.getDocs,
368+
'max-h-80 opacity-100': active.getDocs,
369+
},
370+
)}
364371
id='overview'
365372
>
366373
<DocLink
@@ -442,7 +449,14 @@ export const DocsNav = ({
442449
</svg>
443450
</div>
444451
<div
445-
className={classnames('ml-6', { hidden: !active.getStarted })}
452+
className={classnames(
453+
'ml-6',
454+
'transition-all duration-500 ease-in-out',
455+
{
456+
'max-h-0 opacity-0 overflow-hidden': !active.getStarted,
457+
'max-h-80 opacity-100': active.getStarted,
458+
},
459+
)}
446460
id='getStarted'
447461
>
448462
<DocLink uri='/learn' label='Overview' setOpen={setOpen} />
@@ -515,7 +529,14 @@ export const DocsNav = ({
515529
</svg>
516530
</div>
517531
<div
518-
className={classnames('ml-6', { hidden: !active.getReference })}
532+
className={classnames(
533+
'ml-6',
534+
'transition-all duration-500 ease-in-out',
535+
{
536+
'max-h-0 opacity-0 overflow-hidden': !active.getReference,
537+
'max-h-80 overflow-y-auto opacity-100': active.getReference,
538+
},
539+
)}
519540
id='reference'
520541
>
521542
<DocLink
@@ -710,7 +731,14 @@ export const DocsNav = ({
710731
</svg>
711732
</div>
712733
<div
713-
className={classnames('ml-6', { hidden: !active.getSpecification })}
734+
className={classnames(
735+
'ml-6',
736+
'transition-all duration-500 ease-in-out',
737+
{
738+
'max-h-0 opacity-0 overflow-hidden': !active.getSpecification,
739+
'max-h-80 opacity-100': active.getSpecification,
740+
},
741+
)}
714742
id='specification'
715743
>
716744
<DocLink uri='/specification' label='Overview' setOpen={setOpen} />

pages/tools/components/ui/DropdownMenu.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ export default function DropdownMenu({
6464
<div
6565
className={classnames(
6666
'tools-dropdown-menu',
67-
'ml-0 mt-4 overflow-x-hidden overscroll-y-auto max-h-80',
68-
{ hidden: !isDropdownOpen },
67+
'ml-0 mt-0 overflow-hidden transition-all duration-500 ease-in-out',
68+
{
69+
'max-h-0 opacity-0 invisible': !isDropdownOpen,
70+
'max-h-80 overflow-y-auto opacity-100 visible': isDropdownOpen,
71+
},
6972
)}
7073
>
7174
{children}

0 commit comments

Comments
 (0)