fix(web/progress): nui callback on progress unmount

fixes an issue where activating 2 progress bars/circles one after another would cause a stuck progress bar.

resolves #227
This commit is contained in:
Luke
2023-02-18 20:29:24 +01:00
parent 3801faf976
commit 672b638ba7
3 changed files with 14 additions and 26 deletions

View File

@@ -1,9 +1,13 @@
import { AnimatePresence, motion } from 'framer-motion';
const ScaleFade: React.FC<{ visible: boolean; children: React.ReactNode }> = ({ visible, children }) => {
const ScaleFade: React.FC<{ visible: boolean; children: React.ReactNode; onExitComplete?: () => void }> = ({
visible,
children,
onExitComplete,
}) => {
return (
<>
<AnimatePresence>
<AnimatePresence onExitComplete={onExitComplete}>
{visible && (
<motion.div
initial={{ opacity: 0, scale: 0.95 }}