From b849b3aecd6178114b3b27a2daa014b0795ddf42 Mon Sep 17 00:00:00 2001 From: MAZE Date: Wed, 18 Oct 2023 12:46:27 +0330 Subject: [PATCH] style: add animation to more/less button --- src/components/sounds/sounds.tsx | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/components/sounds/sounds.tsx b/src/components/sounds/sounds.tsx index e4f71af..404d339 100644 --- a/src/components/sounds/sounds.tsx +++ b/src/components/sounds/sounds.tsx @@ -1,4 +1,5 @@ import { useState, useMemo, useCallback } from 'react'; +import { AnimatePresence, motion } from 'framer-motion'; import { Sound } from '@/components/sound'; import { useLocalStorage } from '@/hooks/use-local-storage'; @@ -65,15 +66,22 @@ export function Sounds({ functional, id, sounds }: SoundsProps) { {sounds.length > 6 && ( - + + setShowAll(prev => !prev)} + > + {showAll ? 'Show Less' : 'Show More'} + + )} );