style: add animation to presets

This commit is contained in:
MAZE 2024-06-16 22:14:44 +04:30
parent 73a5c21be9
commit 787a9b60b5

View file

@ -1,4 +1,5 @@
import { FaPlay, FaRegTrashAlt } from 'react-icons/fa/index';
import { motion, AnimatePresence } from 'framer-motion';
import styles from './list.module.css';
@ -26,8 +27,15 @@ export function List({ close }: ListProps) {
<p className={styles.empty}>You don&apos;t have any presets yet.</p>
)}
<AnimatePresence>
{presets.map(preset => (
<div className={styles.preset} key={preset.id}>
<motion.div
animate={{ opacity: 1 }}
className={styles.preset}
exit={{ opacity: 0 }}
initial={{ opacity: 0 }}
key={preset.id}
>
<input
placeholder="Untitled"
type="text"
@ -47,8 +55,9 @@ export function List({ close }: ListProps) {
>
<FaPlay />
</button>
</div>
</motion.div>
))}
</AnimatePresence>
</div>
);
}