Skip to content

Commit

Permalink
style: remove animations
Browse files Browse the repository at this point in the history
  • Loading branch information
remvze committed Jun 16, 2024
1 parent 787a9b6 commit 28abc16
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 52 deletions.
53 changes: 22 additions & 31 deletions src/components/modals/presets/list/list.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { FaPlay, FaRegTrashAlt } from 'react-icons/fa/index';
import { motion, AnimatePresence } from 'framer-motion';

import styles from './list.module.css';

Expand Down Expand Up @@ -27,37 +26,29 @@ export function List({ close }: ListProps) {
<p className={styles.empty}>You don&apos;t have any presets yet.</p>
)}

<AnimatePresence>
{presets.map(preset => (
<motion.div
animate={{ opacity: 1 }}
className={styles.preset}
exit={{ opacity: 0 }}
initial={{ opacity: 0 }}
key={preset.id}
{presets.map(preset => (
<div className={styles.preset} key={preset.id}>
<input
placeholder="Untitled"
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();
}}
>
<input
placeholder="Untitled"
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>
<FaPlay />
</button>
</div>
))}
</div>
);
}
17 changes: 2 additions & 15 deletions src/components/toolbox/countdown-timer/timers/timer/timer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
IoRefresh,
IoTrashOutline,
} from 'react-icons/io5/index';
import { motion } from 'framer-motion';

import { ReverseTimer } from './reverse-timer';

Expand Down Expand Up @@ -139,20 +138,8 @@ export function Timer({ id }: TimerProps) {
};
}, [isRunning, tick, id, spent, total, left]);

const variants = {
enter: { opacity: 1 },
exit: { opacity: 0 },
initial: { opacity: 0 },
};

return (
<motion.div
animate="enter"
className={styles.timer}
exit="exit"
initial="initial"
variants={variants}
>
<div className={styles.timer}>
<header className={styles.header}>
<div className={styles.bar}>
<div
Expand Down Expand Up @@ -211,6 +198,6 @@ export function Timer({ id }: TimerProps) {
<IoTrashOutline />
</button>
</footer>
</motion.div>
</div>
);
}
9 changes: 3 additions & 6 deletions src/components/toolbox/countdown-timer/timers/timers.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useMemo } from 'react';
import { AnimatePresence } from 'framer-motion';

import { Timer } from './timer';
import { Notice } from './notice';
Expand Down Expand Up @@ -31,11 +30,9 @@ export function Timers() {
)}
</header>

<AnimatePresence>
{timers.map(timer => (
<Timer id={timer.id} key={timer.id} />
))}
</AnimatePresence>
{timers.map(timer => (
<Timer id={timer.id} key={timer.id} />
))}

<Notice />
</div>
Expand Down

0 comments on commit 28abc16

Please sign in to comment.