Skip to content

Commit 23c79b4

Browse files
added confetti when the tour finishes
1 parent bab2d61 commit 23c79b4

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

package-lock.json

Lines changed: 17 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@wordpress/dom-ready": "^3.2.3",
1818
"@wordpress/icons": "^6.1.1",
1919
"bigpicture": "^2.5.3",
20+
"canvas-confetti": "^1.9.3",
2021
"classnames": "^2.2.6",
2122
"color-rgba": "^2.2.3",
2223
"compare-versions": "^3.6.0",

src/components/guided-modal-tour/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
guidedTourStates, // TODO: This doesn't exist yet. The state should be loaded here from localize values, this should be an object with the tour ID as the key and the state as the value.
44
} from 'stackable'
55
import classNames from 'classnames'
6+
import confetti from 'canvas-confetti'
67

78
import {
89
Modal, Flex, Button,
@@ -235,6 +236,12 @@ const ModalTour = props => {
235236
variant="primary"
236237
onClick={ () => {
237238
if ( currentStep === steps.length - 1 ) {
239+
confetti( {
240+
angle: -90,
241+
spread: 90,
242+
origin: { y: -0.3 },
243+
zIndex: 100000,
244+
} )
238245
onClose()
239246
} else {
240247
setCurrentStep( currentStep + 1 )

0 commit comments

Comments
 (0)