diff --git a/components/item-act.js b/components/item-act.js
index 7c03e9db..27172d3b 100644
--- a/components/item-act.js
+++ b/components/item-act.js
@@ -13,7 +13,7 @@ import { ACT_MUTATION } from '@/fragments/paidAction'
import { meAnonSats } from '@/lib/apollo'
import { BoostItemInput } from './adv-post-form'
import { useSendWallets } from '@/wallets/index'
-import { useFireworks } from './fireworks'
+import { useAnimation } from '@/components/animation'
const defaultTips = [100, 1000, 10_000, 100_000]
@@ -96,7 +96,7 @@ export default function ItemAct ({ onClose, item, act = 'TIP', step, children, a
}, [onClose, item.id])
const actor = useAct()
- const strike = useFireworks()
+ const animate = useAnimation()
const onSubmit = useCallback(async ({ amount }) => {
if (abortSignal && zapUndoTrigger({ me, amount })) {
@@ -111,7 +111,7 @@ export default function ItemAct ({ onClose, item, act = 'TIP', step, children, a
}
const onPaid = () => {
- strike()
+ animate()
onClose?.()
if (!me) setItemMeAnonSats({ id: item.id, amount })
}
@@ -143,7 +143,7 @@ export default function ItemAct ({ onClose, item, act = 'TIP', step, children, a
})
if (error) throw error
addCustomTip(Number(amount))
- }, [me, actor, wallets.length, act, item.id, onClose, abortSignal, strike])
+ }, [me, actor, wallets.length, act, item.id, onClose, abortSignal, animate])
return act === 'BOOST'
?
{children}
@@ -300,7 +300,7 @@ export function useAct ({ query = ACT_MUTATION, ...options } = {}) {
export function useZap () {
const wallets = useSendWallets()
const act = useAct()
- const strike = useFireworks()
+ const animate = useAnimation()
const toaster = useToast()
return useCallback(async ({ item, me, abortSignal }) => {
@@ -314,7 +314,7 @@ export function useZap () {
try {
await abortSignal.pause({ me, amount: sats })
- strike()
+ animate()
// batch zaps if wallet is enabled or using fee credits so they can be executed serially in a single request
const { error } = await act({ variables, optimisticResponse, context: { batch: wallets.length > 0 || me?.privates?.sats > sats } })
if (error) throw error
@@ -327,7 +327,7 @@ export function useZap () {
// but right now this toast is noisy for optimistic zaps
console.error(error)
}
- }, [act, toaster, strike, wallets])
+ }, [act, toaster, animate, wallets])
}
export class ActCanceledError extends Error {
diff --git a/components/nav/common.js b/components/nav/common.js
index 0c6143fc..3f9bbb61 100644
--- a/components/nav/common.js
+++ b/components/nav/common.js
@@ -14,8 +14,6 @@ import { abbrNum } from '../../lib/format'
import { useServiceWorker } from '../serviceworker'
import { signOut } from 'next-auth/react'
import Badges from '../badge'
-import { randInRange } from '../../lib/rand'
-import { useFireworks } from '../fireworks'
import LightningIcon from '../../svgs/bolt.svg'
import SearchIcon from '../../svgs/search-line.svg'
import classNames from 'classnames'
@@ -400,20 +398,6 @@ export function LoginButtons ({ handleClose }) {
}
export function AnonDropdown ({ path }) {
- const strike = useFireworks()
-
- useEffect(() => {
- if (!window.localStorage.getItem('striked')) {
- const to = setTimeout(() => {
- const striked = strike()
- if (striked) {
- window.localStorage.setItem('striked', 'yep')
- }
- }, randInRange(3000, 10000))
- return () => clearTimeout(to)
- }
- }, [])
-
return (
diff --git a/components/pay-bounty.js b/components/pay-bounty.js
index e376c898..d960c316 100644
--- a/components/pay-bounty.js
+++ b/components/pay-bounty.js
@@ -6,7 +6,7 @@ import { numWithUnits } from '@/lib/format'
import { useShowModal } from './modal'
import { useRoot } from './root'
import { ActCanceledError, useAct } from './item-act'
-import { useFireworks } from './fireworks'
+import { useAnimation } from '@/components/animation'
import { useToast } from './toast'
import { useSendWallets } from '@/wallets/index'
import { Form, SubmitButton } from './form'
@@ -48,7 +48,7 @@ export default function PayBounty ({ children, item }) {
const { me } = useMe()
const showModal = useShowModal()
const root = useRoot()
- const strike = useFireworks()
+ const animate = useAnimation()
const toaster = useToast()
const wallets = useSendWallets()
@@ -61,7 +61,7 @@ export default function PayBounty ({ children, item }) {
const handlePayBounty = async onCompleted => {
try {
- strike()
+ animate()
const { error } = await act({ onCompleted })
if (error) throw error
} catch (error) {
diff --git a/pages/_app.js b/pages/_app.js
index efc15347..f9ede40c 100644
--- a/pages/_app.js
+++ b/pages/_app.js
@@ -10,7 +10,7 @@ import { useRouter } from 'next/dist/client/router'
import { useCallback, useEffect } from 'react'
import { ShowModalProvider } from '@/components/modal'
import ErrorBoundary from '@/components/error-boundary'
-import { FireworksProvider } from '@/components/fireworks'
+import { AnimationProvider } from '@/components/animation'
import { ToastProvider } from '@/components/toast'
import { ServiceWorkerProvider } from '@/components/serviceworker'
import { SSR } from '@/lib/constants'
@@ -116,7 +116,7 @@ export default function MyApp ({ Component, pageProps: { ...props } }) {
-
+
@@ -129,7 +129,7 @@ export default function MyApp ({ Component, pageProps: { ...props } }) {
-
+
diff --git a/pages/credits.js b/pages/credits.js
index c0b05983..27d85d90 100644
--- a/pages/credits.js
+++ b/pages/credits.js
@@ -2,7 +2,7 @@ import { getGetServerSideProps } from '@/api/ssrApollo'
import CCInfo from '@/components/info/cc'
import { Form, Input, SubmitButton } from '@/components/form'
import { CenterLayout } from '@/components/layout'
-import { useFireworks } from '@/components/fireworks'
+import { useAnimation } from '@/components/animation'
import { useMe } from '@/components/me'
import { useShowModal } from '@/components/modal'
import { usePaidMutation } from '@/components/use-paid-mutation'
@@ -76,7 +76,7 @@ function WithdrawButton ({ className }) {
export function BuyCreditsButton ({ className }) {
const showModal = useShowModal()
- const strike = useFireworks()
+ const animate = useAnimation()
const [buyCredits] = usePaidMutation(BUY_CREDITS)
return (
@@ -94,7 +94,7 @@ export function BuyCreditsButton ({ className }) {
credits: Number(amount)
},
onCompleted: () => {
- strike()
+ animate()
}
})
onClose()
diff --git a/pages/rewards/index.js b/pages/rewards/index.js
index b005f960..a8b654c1 100644
--- a/pages/rewards/index.js
+++ b/pages/rewards/index.js
@@ -13,7 +13,7 @@ import { useShowModal } from '@/components/modal'
import dynamic from 'next/dynamic'
import { FAST_POLL_INTERVAL, SSR } from '@/lib/constants'
import { useToast } from '@/components/toast'
-import { useFireworks } from '@/components/fireworks'
+import { useAnimation } from '@/components/animation'
import { Col, Row } from 'react-bootstrap'
import { useData } from '@/components/use-data'
import { GrowthPieChartSkeleton } from '@/components/charts-skeletons'
@@ -133,7 +133,7 @@ export default function Rewards ({ ssrData }) {
export function DonateButton () {
const showModal = useShowModal()
const toaster = useToast()
- const strike = useFireworks()
+ const animate = useAnimation()
const [donateToRewards] = usePaidMutation(DONATE)
return (
@@ -151,7 +151,7 @@ export function DonateButton () {
sats: Number(amount)
},
onCompleted: () => {
- strike()
+ animate()
toaster.success('donated')
}
})