Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️
PHP attendize-alternativedoor-managementevent-check-inevent-managementevent-registrationevent-ticketingeventbrite-alternativeeventslaravelopen-sourcephpreactself-hostedsell-ticketssell-tickets-onlineticket-sellingticketing-systemtickettailor-alternativetito-alternative
Don't show confetti on Safari
Dave Earleyd72dd03f47cf
diff --git a/frontend/src/components/layouts/Event/Event.module.scss b/frontend/src/components/layouts/Event/Event.module.scssindex 2c9565020..79ea467fa 100644--- a/frontend/src/components/layouts/Event/Event.module.scss+++ b/frontend/src/components/layouts/Event/Event.module.scss@@ -520,9 +520,5 @@background-color: #f9fafc;@include mixins.scrollbar;-- @include mixins.respond-below(md) {- height: calc(100vh - 114px);- }}}diff --git a/frontend/src/components/routes/event/GettingStarted/index.tsx b/frontend/src/components/routes/event/GettingStarted/index.tsxindex d16bbacc3..0f4b7c687 100644--- a/frontend/src/components/routes/event/GettingStarted/index.tsx+++ b/frontend/src/components/routes/event/GettingStarted/index.tsx@@ -14,16 +14,20 @@ import {showError, showSuccess} from "../../../../utilites/notifications.tsx";import {getProductsFromEvent} from "../../../../utilites/helpers.ts";import {useEffect, useState} from 'react';import ConfettiAnimation from "./ConfettiAnimaiton";+import {Browser, useBrowser} from "../../../../hooks/useGetBrowser.ts";const GettingStarted = () => {const {eventId} = useParams();const location = useLocation();const navigate = useNavigate();const [showConfetti, setShowConfetti] = useState(false);+ const browser = useBrowser();useEffect(() => {const searchParams = new URLSearchParams(location.search);- if (searchParams.get('new_event') === 'true') {+ const isChromeOrFirefox = browser === Browser.Chrome || browser === Browser.Firefox;++ if (searchParams.get('new_event') === 'true' && isChromeOrFirefox) {setShowConfetti(true);setTimeout(() => {@@ -73,7 +77,7 @@ const GettingStarted = () => {return (<>- {showConfetti && <ConfettiAnimation duration={2000}/>}+ {showConfetti && <ConfettiAnimation duration={1000}/>}<PageBody><Card className={classes.headerCard}><div className={classes.headerContent}>diff --git a/frontend/src/hooks/useGetBrowser.ts b/frontend/src/hooks/useGetBrowser.tsnew file mode 100644index 000000000..aa758fe8f--- /dev/null+++ b/frontend/src/hooks/useGetBrowser.ts@@ -0,0 +1,42 @@+import {useMemo} from "react";++export enum Browser {+ Chrome = "Chrome",+ Firefox = "Firefox",+ Edge = "Edge",+ Brave = "Brave",+ Opera = "Opera",+ Chromium = "Chromium",+ Safari = "Safari",+ Unknown = "Unknown",+}++export const useBrowser = (): Browser => {+ return useMemo(() => {+ const ua = navigator.userAgent;++ if (/Firefox/.test(ua)) {+ return Browser.Firefox;+ }+ if (/Edg\//.test(ua)) {+ return Browser.Edge;+ }+ if (/OPR\//.test(ua)) {+ return Browser.Opera;+ }+ if (/Brave/.test(ua)) {+ return Browser.Brave;+ }+ if (/Chrome/.test(ua)) {+ if (navigator.userAgentData?.brands?.some(b => b.brand === "Chromium")) {+ return Browser.Chromium;+ }+ return Browser.Chrome;+ }+ if (/Safari/.test(ua)) {+ return Browser.Safari;+ }++ return Browser.Unknown;+ }, []);+};