From cb6b4544509e44549f76ce9843156bd4a9fe8c2b Mon Sep 17 00:00:00 2001 From: notV4l Date: Wed, 10 Apr 2024 02:41:27 +0200 Subject: [PATCH] analytics -> speedInsights --- Scarb.toml | 4 +-- web/package.json | 2 +- web/pnpm-lock.yaml | 38 +++++++++++++++------ web/src/components/layout/MobileMenu.tsx | 8 ++--- web/src/components/wallet/ConnectButton.tsx | 28 +++++++-------- web/src/dojo/hooks/useSystems.ts | 12 +++---- web/src/pages/_app.tsx | 4 +-- 7 files changed, 56 insertions(+), 40 deletions(-) diff --git a/Scarb.toml b/Scarb.toml index ab8746dd5..1d2b06b50 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -32,11 +32,11 @@ migrate_ryo421 = "sozo -P ryo421 build && sozo -P ryo421 migrate apply && scarb migrate_prod = "sozo -P prod migrate" # slot ryo420 -slot_ryo420_katana="slot d create ryo420 katana --seed 420 --version v0.6.0 --chain-id KATANA_SLOT_420" +slot_ryo420_katana="slot d create ryo420 katana --seed 420 --version v0.6.0 --chain-id KATANA_SLOT_420 --disable-fee true" slot_ryo420_torii="slot d create ryo420 torii --rpc https://api.cartridge.gg/x/ryo420/katana -s 0 --version v0.6.0 --world 0x3bf84ccc82282acd4c8afbb843c9e864bf1e0770fba607595104202b938b7a4" # slot ryo421 -slot_ryo421_katana="slot d create ryo421 katana --seed 421 --version v0.6.0 --chain-id KATANA_SLOT_421" +slot_ryo421_katana="slot d create ryo421 katana --seed 421 --version v0.6.0 --chain-id KATANA_SLOT_421 --disable-fee true" slot_ryo421_torii="slot d create ryo421 torii --rpc https://api.cartridge.gg/x/ryo421/katana -s 0 --version v0.6.0 --world 0x3bf84ccc82282acd4c8afbb843c9e864bf1e0770fba607595104202b938b7a4" diff --git a/web/package.json b/web/package.json index 43d7e72e5..df4a2012b 100644 --- a/web/package.json +++ b/web/package.json @@ -28,7 +28,7 @@ "@next/bundle-analyzer": "^14.1.4", "@starknet-react/chains": "^0.1.7", "@starknet-react/core": "^2.4.0", - "@vercel/analytics": "^1.0.2", + "@vercel/speed-insights": "^1.0.10", "eslint": "8.36.0", "eslint-config-next": "14.1.4", "framer-motion": "^10.5.0", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 0e846d741..837a10274 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -35,9 +35,9 @@ dependencies: '@starknet-react/core': specifier: ^2.4.0 version: 2.4.0(get-starknet-core@3.2.0)(react@18.2.0)(starknet@6.2.0) - '@vercel/analytics': - specifier: ^1.0.2 - version: 1.1.2 + '@vercel/speed-insights': + specifier: ^1.0.10 + version: 1.0.10(next@14.2.0-canary.63)(react@18.2.0) eslint: specifier: 8.36.0 version: 8.36.0 @@ -4714,10 +4714,32 @@ packages: eslint-visitor-keys: 3.4.3 dev: false - /@vercel/analytics@1.1.2: - resolution: {integrity: sha512-CodhkLCQ/EHzjX8k+Qg+OzTBY0UadykrcfolfSOJVZZY/ZJM5nbhztm9KdbYvMfqKlasAr1+OYy0ThZnDA/MYA==} + /@vercel/speed-insights@1.0.10(next@14.2.0-canary.63)(react@18.2.0): + resolution: {integrity: sha512-4uzdKB0RW6Ff2FkzshzjZ+RlJfLPxgm/00i0XXgxfMPhwnnsk92YgtqsxT9OcPLdJUyVU1DqFlSWWjIQMPkh0g==} + requiresBuild: true + peerDependencies: + '@sveltejs/kit': ^1 || ^2 + next: '>= 13' + react: ^18 || ^19 + svelte: ^4 + vue: ^3 + vue-router: ^4 + peerDependenciesMeta: + '@sveltejs/kit': + optional: true + next: + optional: true + react: + optional: true + svelte: + optional: true + vue: + optional: true + vue-router: + optional: true dependencies: - server-only: 0.0.1 + next: 14.2.0-canary.63(@babel/core@7.24.3)(react-dom@18.2.0)(react@18.2.0) + react: 18.2.0 dev: false /@webassemblyjs/ast@1.12.1: @@ -9341,10 +9363,6 @@ packages: randombytes: 2.1.0 dev: false - /server-only@0.0.1: - resolution: {integrity: sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==} - dev: false - /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} dev: true diff --git a/web/src/components/layout/MobileMenu.tsx b/web/src/components/layout/MobileMenu.tsx index e5d8c571b..db1981e2b 100644 --- a/web/src/components/layout/MobileMenu.tsx +++ b/web/src/components/layout/MobileMenu.tsx @@ -1,9 +1,7 @@ import { Menu, MenuItem, Popover, PopoverBody, PopoverContent, PopoverTrigger, StyleProps } from "@chakra-ui/react"; import { Dots } from "../icons"; import { ProfileLinkMobile } from "../pages/profile/Profile"; -import { ChainSelector, ConnectButtonMobile } from "../wallet"; -import { Burners } from "../wallet/Burners"; -import { Predeployed } from "../wallet/Predeployed"; +import { ConnectButtonMobile } from "../wallet"; import { HeaderButton } from "./HeaderButton"; import { MediaPlayer } from "./MediaPlayer"; @@ -24,11 +22,11 @@ export const MobileMenu = ({ ...props }: StyleProps) => { - + {/* - + */} diff --git a/web/src/components/wallet/ConnectButton.tsx b/web/src/components/wallet/ConnectButton.tsx index 6234b1946..9e3462c13 100644 --- a/web/src/components/wallet/ConnectButton.tsx +++ b/web/src/components/wallet/ConnectButton.tsx @@ -1,5 +1,5 @@ -import { useDojoContext } from "@/dojo/hooks"; -import { frenlyAddress } from "@/utils/ui"; +import { useDojoContext, useTokenBalance } from "@/dojo/hooks"; +import { formatEther, frenlyAddress } from "@/utils/ui"; import { Box, Button, HStack, Image, MenuItem, Text } from "@chakra-ui/react"; import { useAccount, /*useBalance,*/ useConnect, useDisconnect } from "@starknet-react/core"; @@ -9,10 +9,10 @@ export const ConnectButton = ({ ...props }) => { const { disconnect } = useDisconnect(); const { uiStore } = useDojoContext(); - // const { balance } = useTokenBalance({ - // address, - // token: "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - // }); + const { balance } = useTokenBalance({ + address, + token: "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + }); return ( <> @@ -35,10 +35,10 @@ export const ConnectButton = ({ ...props }) => { {connector && {connector.name}} {frenlyAddress(account.address || "")} - {/* + Ξ {formatEther(balance)} - */} + )} @@ -53,10 +53,10 @@ export const ConnectButtonMobile = ({ ...props }) => { const { disconnect } = useDisconnect(); const { uiStore } = useDojoContext(); - // const { balance } = useTokenBalance({ - // address, - // token: "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - // }); + const { balance } = useTokenBalance({ + address, + token: "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + }); return ( <> @@ -70,10 +70,10 @@ export const ConnectButtonMobile = ({ ...props }) => { {connector && {connector.name}} {frenlyAddress(account.address || "")} - {/* + Ξ {formatEther(balance)} - */} + )} diff --git a/web/src/dojo/hooks/useSystems.ts b/web/src/dojo/hooks/useSystems.ts index e246bbece..b153a2f38 100644 --- a/web/src/dojo/hooks/useSystems.ts +++ b/web/src/dojo/hooks/useSystems.ts @@ -122,14 +122,14 @@ export const useSystems = (): SystemsInterface => { isError: false }) - // - // TODO : remove later - // - await sleep(1_000); - // clearToasts() + // // + // // TODO : remove later + // // + // await sleep(1_000); + // // clearToasts() receipt = await account!.waitForTransaction(tx.transaction_hash, { - retryInterval: 200, + retryInterval: 500, }); } catch (e: any) { setIsPending(false) diff --git a/web/src/pages/_app.tsx b/web/src/pages/_app.tsx index b7a33cbc3..82ee4559c 100644 --- a/web/src/pages/_app.tsx +++ b/web/src/pages/_app.tsx @@ -6,7 +6,7 @@ import useKonamiCode, { starkpimpSequence } from "@/hooks/useKonamiCode"; import Fonts from "@/theme/fonts"; import GlobalStyles from "@/theme/global"; import { ChakraProvider } from "@chakra-ui/react"; -import { Analytics } from "@vercel/analytics/react"; +import { SpeedInsights } from '@vercel/speed-insights/next'; import type { AppProps } from "next/app"; import NextHead from "next/head"; import { useEffect } from "react"; @@ -43,7 +43,7 @@ export default function App({ Component, pageProps }: AppProps) { {isRightSequence && } - + {/* */} {/* Common modales */}