confettin refactored on lottery page
This commit is contained in:
parent
f0bdc8de3e
commit
d4ccaf0563
|
|
@ -1,14 +1,15 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
import { useState, useEffect } from 'react';
|
||||||
import ReactConfetti from 'react-confetti';
|
import ReactConfetti from 'react-confetti';
|
||||||
import { useWindowSize } from 'react-use';
|
import { useWindowSize } from 'react-use';
|
||||||
|
|
||||||
const Confetti = ({
|
const Confetti = ({
|
||||||
infinite = true,
|
|
||||||
numberOfPieces = 200,
|
numberOfPieces = 200,
|
||||||
|
showConfetti,
|
||||||
}: {
|
}: {
|
||||||
infinite?: boolean;
|
|
||||||
numberOfPieces?: number;
|
numberOfPieces?: number;
|
||||||
|
showConfetti: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
const { width, height } = useWindowSize();
|
const { width, height } = useWindowSize();
|
||||||
const colors = [
|
const colors = [
|
||||||
|
|
@ -25,10 +26,10 @@ const Confetti = ({
|
||||||
<ReactConfetti
|
<ReactConfetti
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
recycle={infinite}
|
recycle={showConfetti}
|
||||||
numberOfPieces={numberOfPieces}
|
numberOfPieces={numberOfPieces}
|
||||||
tweenDuration={5000}
|
tweenDuration={500}
|
||||||
run={true}
|
// run={true}
|
||||||
colors={colors}
|
colors={colors}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue