confettin refactored on lottery page

This commit is contained in:
Kakabay 2025-01-08 18:33:56 +05:00
parent f0bdc8de3e
commit d4ccaf0563
1 changed files with 6 additions and 5 deletions

View File

@ -1,14 +1,15 @@
'use client';
import { useState, useEffect } from 'react';
import ReactConfetti from 'react-confetti';
import { useWindowSize } from 'react-use';
const Confetti = ({
infinite = true,
numberOfPieces = 200,
showConfetti,
}: {
infinite?: boolean;
numberOfPieces?: number;
showConfetti: boolean;
}) => {
const { width, height } = useWindowSize();
const colors = [
@ -25,10 +26,10 @@ const Confetti = ({
<ReactConfetti
width={width}
height={height}
recycle={infinite}
recycle={showConfetti}
numberOfPieces={numberOfPieces}
tweenDuration={5000}
run={true}
tweenDuration={500}
// run={true}
colors={colors}
/>
</div>