Skip to content

Commit

Permalink
Fix animation (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-moreno authored Oct 14, 2024
1 parent 8f38549 commit 695f823
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/experimental/Navigation/Sidebar/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,16 @@ const CategoryItem = ({ category }: { category: MenuCategory }) => {
<AnimatePresence initial={false}>
{isOpen && (
<motion.div
initial={{ opacity: 0, height: 0 }}
animate={{ opacity: 1, height: "auto" }}
exit={{ opacity: 0, height: 0 }}
transition={{ duration: 0.15, ease: "easeInOut" }}
className="flex flex-col gap-1 pb-3"
initial={{ height: 0, opacity: 0 }}
animate={{ height: "auto", opacity: 1 }}
exit={{ height: 0, opacity: 0 }}
transition={{ duration: 0.15, ease: [0.165, 0.84, 0.44, 1] }}
>
{category.items.map((item, index) => (
<MenuItem key={index} item={item} />
))}
<div className="flex flex-col gap-1 pb-3">
{category.items.map((item, index) => (
<MenuItem key={index} item={item} />
))}
</div>
</motion.div>
)}
</AnimatePresence>
Expand Down

0 comments on commit 695f823

Please sign in to comment.