mirror of
https://github.com/remvze/moodist.git
synced 2025-12-18 09:24:14 +00:00
style: add animation to presets
This commit is contained in:
parent
73a5c21be9
commit
787a9b60b5
1 changed files with 31 additions and 22 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import { FaPlay, FaRegTrashAlt } from 'react-icons/fa/index';
|
import { FaPlay, FaRegTrashAlt } from 'react-icons/fa/index';
|
||||||
|
import { motion, AnimatePresence } from 'framer-motion';
|
||||||
|
|
||||||
import styles from './list.module.css';
|
import styles from './list.module.css';
|
||||||
|
|
||||||
|
|
@ -26,29 +27,37 @@ export function List({ close }: ListProps) {
|
||||||
<p className={styles.empty}>You don't have any presets yet.</p>
|
<p className={styles.empty}>You don't have any presets yet.</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{presets.map(preset => (
|
<AnimatePresence>
|
||||||
<div className={styles.preset} key={preset.id}>
|
{presets.map(preset => (
|
||||||
<input
|
<motion.div
|
||||||
placeholder="Untitled"
|
animate={{ opacity: 1 }}
|
||||||
type="text"
|
className={styles.preset}
|
||||||
value={preset.label}
|
exit={{ opacity: 0 }}
|
||||||
onChange={e => changeName(preset.id, e.target.value)}
|
initial={{ opacity: 0 }}
|
||||||
/>
|
key={preset.id}
|
||||||
<button onClick={() => deletePreset(preset.id)}>
|
|
||||||
<FaRegTrashAlt />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
className={styles.primary}
|
|
||||||
onClick={() => {
|
|
||||||
override(preset.sounds);
|
|
||||||
play();
|
|
||||||
close();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<FaPlay />
|
<input
|
||||||
</button>
|
placeholder="Untitled"
|
||||||
</div>
|
type="text"
|
||||||
))}
|
value={preset.label}
|
||||||
|
onChange={e => changeName(preset.id, e.target.value)}
|
||||||
|
/>
|
||||||
|
<button onClick={() => deletePreset(preset.id)}>
|
||||||
|
<FaRegTrashAlt />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className={styles.primary}
|
||||||
|
onClick={() => {
|
||||||
|
override(preset.sounds);
|
||||||
|
play();
|
||||||
|
close();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<FaPlay />
|
||||||
|
</button>
|
||||||
|
</motion.div>
|
||||||
|
))}
|
||||||
|
</AnimatePresence>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue