Skip to content

Commit

Permalink
Add a wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Dec 18, 2024
1 parent 9a0f2fd commit 792ac4c
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions code/addons/onboarding/src/components/Confetti/Confetti.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
import React, { type ComponentProps, useEffect } from 'react';
import { useState } from 'react';

import { styled } from 'storybook/internal/theming';

import ReactConfetti from 'react-confetti-boom';

const Wrapper = styled.div({
zIndex: 9999,
position: 'fixed',
top: 0,
left: 0,
bottom: 0,
right: 0,
});

export function Confetti({
timeToFade = 5000,
colors = ['#CA90FF', '#FC521F', '#66BF3C', '#FF4785', '#FFAE00', '#1EA7FD'],
Expand All @@ -21,13 +32,15 @@ export function Confetti({
}, [timeToFade]);

return (
<ReactConfetti
mode="fall"
colors={colors}
shapeSize={14}
particleCount={particleCount}
fadeOutHeight={10}
{...confettiProps}
/>
<Wrapper>
<ReactConfetti
mode="fall"
colors={colors}
shapeSize={14}
particleCount={particleCount}
fadeOutHeight={10}
{...confettiProps}
/>
</Wrapper>
);
}

0 comments on commit 792ac4c

Please sign in to comment.