clickSound in app
This commit is contained in:
parent
bd0cc6c34d
commit
404a23b2e1
@ -10,6 +10,8 @@ import { Press_Start_2P, Texturina } from "next/font/google";
|
||||
import PlayerProvider from "../providers/PlayerProvider";
|
||||
import ModalProvider from "../providers/ModalProvider";
|
||||
import Script from "next/script";
|
||||
import { useEffect } from "react";
|
||||
import { clickSound } from "../utils/soundsEffect";
|
||||
|
||||
const client = new QueryClient();
|
||||
const font = Texturina({ weight: ["400"], subsets: ["latin"] });
|
||||
@ -18,6 +20,18 @@ const font = Texturina({ weight: ["400"], subsets: ["latin"] });
|
||||
const fontPixel = Press_Start_2P({ weight: ["400"], subsets: ["latin"] });
|
||||
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
useEffect(() => {
|
||||
window.addEventListener("click", () => {
|
||||
clickSound();
|
||||
});
|
||||
|
||||
return () => {
|
||||
window.removeEventListener("click", () => {
|
||||
clickSound();
|
||||
});
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<WagmiProvider config={config}>
|
||||
<QueryClientProvider client={client}>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user