From 55b92976424022a8f38ebbc61584d7dcf2b35548 Mon Sep 17 00:00:00 2001 From: starknetdev Date: Wed, 4 Oct 2023 12:17:46 +0100 Subject: [PATCH] house keeping --- .../components/actions/DiscoveryDisplay.tsx | 11 -------- .../app/components/actions/KillAdventurer.tsx | 2 -- .../app/components/adventurer/DeathDialog.tsx | 3 +-- ui/src/app/components/adventurer/Info.tsx | 17 +++--------- ui/src/app/components/adventurer/TopInfo.tsx | 5 ---- ui/src/app/components/beast/BattleDisplay.tsx | 5 ++-- ui/src/app/components/beast/BeastDisplay.tsx | 16 +++++------ ui/src/app/components/intro/WalletSelect.tsx | 4 +-- .../app/components/inventory/InventoryRow.tsx | 5 ++-- ui/src/app/components/leaderboard/LiveRow.tsx | 4 --- .../app/components/leaderboard/LiveTable.tsx | 2 -- .../app/components/leaderboard/ScoreRow.tsx | 2 -- .../app/components/leaderboard/ScoreTable.tsx | 4 --- .../components/marketplace/MarketplaceRow.tsx | 14 ---------- .../marketplace/MarketplaceTable.tsx | 1 - ui/src/app/containers/AdventurerScreen.tsx | 27 +------------------ ui/src/app/containers/BeastScreen.tsx | 15 +++++------ ui/src/app/containers/EncountersScreen.tsx | 21 +-------------- ui/src/app/containers/InventoryScreen.tsx | 24 ----------------- ui/src/app/containers/MarketplaceScreen.tsx | 14 ++-------- ui/src/app/containers/ProfileScreen.tsx | 8 +----- ui/src/app/containers/UpgradeScreen.tsx | 10 +------ ui/src/app/hooks/useCustomQuery.ts | 3 +-- ui/src/app/hooks/useLoadingStore.ts | 1 - ui/src/app/hooks/useQueryStore.ts | 1 - ui/src/app/lib/burner.tsx | 1 - ui/src/app/lib/utils/processData.ts | 1 - 27 files changed, 30 insertions(+), 191 deletions(-) diff --git a/ui/src/app/components/actions/DiscoveryDisplay.tsx b/ui/src/app/components/actions/DiscoveryDisplay.tsx index baf4dd186..e82a5cb0f 100644 --- a/ui/src/app/components/actions/DiscoveryDisplay.tsx +++ b/ui/src/app/components/actions/DiscoveryDisplay.tsx @@ -1,7 +1,5 @@ -import useAdventurerStore from "../../hooks/useAdventurerStore"; import { processBeastName } from "../../lib/utils"; import { - HeartIcon, CoinIcon, GiBruteIcon, SkullCrossedBonesIcon, @@ -143,15 +141,6 @@ export const DiscoveryDisplay = ({ discoveryData }: DiscoveryProps) => { ); } - - if (discoveryData?.subDiscoveryType === "XP") { - return ( - -

NICE! Discovered {discoveryData.outputAmount} XP!

- -
- ); - } } return null; diff --git a/ui/src/app/components/actions/KillAdventurer.tsx b/ui/src/app/components/actions/KillAdventurer.tsx index 8edb21960..c2d4984f2 100644 --- a/ui/src/app/components/actions/KillAdventurer.tsx +++ b/ui/src/app/components/actions/KillAdventurer.tsx @@ -5,7 +5,6 @@ import useTransactionCartStore from "@/app/hooks/useTransactionCartStore"; import { useUiSounds, soundSelector } from "../../hooks/useUiSound"; import useCustomQuery from "@/app/hooks/useCustomQuery"; import { getAdventurerById } from "../../hooks/graphql/queries"; -import useLoadingStore from "@/app/hooks/useLoadingStore"; import TopInfo from "../adventurer/TopInfo"; import { useQueriesStore } from "@/app/hooks/useQueryStore"; import { useBlock } from "@starknet-react/core"; @@ -17,7 +16,6 @@ export default function KillAdventurer() { const [adventurerTarget, setAdventurerTarget] = useState(""); const addToCalls = useTransactionCartStore((s) => s.addToCalls); const { play: clickPlay } = useUiSounds(soundSelector.click); - const txAccepted = useLoadingStore((state) => state.txAccepted); const { data: blockData } = useBlock({ refetchInterval: false, }); diff --git a/ui/src/app/components/adventurer/DeathDialog.tsx b/ui/src/app/components/adventurer/DeathDialog.tsx index e1eb07999..f0190127d 100644 --- a/ui/src/app/components/adventurer/DeathDialog.tsx +++ b/ui/src/app/components/adventurer/DeathDialog.tsx @@ -13,7 +13,6 @@ import { useQueriesStore } from "@/app/hooks/useQueryStore"; import GlitchEffect from "../animations/GlitchEffect"; import PixelatedImage from "../animations/PixelatedImage"; import { getDeathMessageByRank } from "../../lib/utils"; -import Image from "next/image"; export const DeathDialog = () => { const messageRef = useRef(null); @@ -25,7 +24,7 @@ export const DeathDialog = () => { const showDeathDialog = useUIStore((state) => state.showDeathDialog); const [imageLoading, setImageLoading] = useState(false); - const { data, refetch, setData } = useQueriesStore(); + const { refetch, setData } = useQueriesStore(); useCustomQuery("adventurersByXPQuery", getAdventurerByXP, undefined); diff --git a/ui/src/app/components/adventurer/Info.tsx b/ui/src/app/components/adventurer/Info.tsx index c91a79e50..92555e2b0 100644 --- a/ui/src/app/components/adventurer/Info.tsx +++ b/ui/src/app/components/adventurer/Info.tsx @@ -1,19 +1,10 @@ -import { useMemo } from "react"; import { Adventurer, NullAdventurer, NullItem } from "../../types"; -import { getItemsByAdventurer } from "../../hooks/graphql/queries"; -import { HeartIcon, CoinIcon, BagIcon, QuestionMarkIcon } from "../icons/Icons"; +import { HeartIcon, CoinIcon, QuestionMarkIcon } from "../icons/Icons"; import { ItemDisplay } from "./ItemDisplay"; import LevelBar from "./LevelBar"; -import { - calculateLevel, - getRealmNameById, - getKeyFromValue, - countOccurrences, -} from "../../lib/utils"; +import { getRealmNameById, getKeyFromValue } from "../../lib/utils"; import { useQueriesStore } from "../../hooks/useQueryStore"; -import useCustomQuery from "../../hooks/useCustomQuery"; import useUIStore from "../../hooks/useUIStore"; -import useLoadingStore from "../../hooks/useLoadingStore"; import { Item } from "@/app/types"; import { HealthCountDown } from "../CountDown"; import { GameData } from "../GameData"; @@ -32,9 +23,7 @@ export default function Info({ upgradeCost, }: InfoProps) { const formatAdventurer = adventurer ? adventurer : NullAdventurer; - const profile = useUIStore((state) => state.profile); - const { data, isLoading, data: storeData } = useQueriesStore(); - const txAccepted = useLoadingStore((state) => state.txAccepted); + const { data } = useQueriesStore(); const dropItems = useUIStore((state) => state.dropItems); const setDropItems = useUIStore((state) => state.setDropItems); const potionAmount = useUIStore((state) => state.potionAmount); diff --git a/ui/src/app/components/adventurer/TopInfo.tsx b/ui/src/app/components/adventurer/TopInfo.tsx index d59559fed..aacac2f62 100644 --- a/ui/src/app/components/adventurer/TopInfo.tsx +++ b/ui/src/app/components/adventurer/TopInfo.tsx @@ -49,11 +49,6 @@ export default function TopInfo({ adventurer }: InfoProps) { - {/* {0 === 0 && ( -
-

DEAD

-
- )} */} ) : ( diff --git a/ui/src/app/components/beast/BattleDisplay.tsx b/ui/src/app/components/beast/BattleDisplay.tsx index e596cf563..54833ee9f 100644 --- a/ui/src/app/components/beast/BattleDisplay.tsx +++ b/ui/src/app/components/beast/BattleDisplay.tsx @@ -3,19 +3,18 @@ import useAdventurerStore from "../../hooks/useAdventurerStore"; import { useQueriesStore } from "../../hooks/useQueryStore"; import { getRankFromList, getOrdinalSuffix } from "../../lib/utils"; import { processBeastName, getBeastData } from "../../lib/utils"; -import { Adventurer, Battle, Discovery } from "@/app/types"; +import { Battle } from "@/app/types"; import Head from "../../../../public/icons/loot/head.svg"; import Hand from "../../../../public/icons/loot/hand.svg"; import Chest from "../../../../public/icons/loot/chest.svg"; import Waist from "../../../../public/icons/loot/waist.svg"; import Foot from "../../../../public/icons/loot/foot.svg"; -import { appUrl, battle } from "@/app/lib/constants"; +import { appUrl } from "@/app/lib/constants"; import { GiWalkingBootIcon, GiFootTripIcon, GiBattleGearIcon, SkullCrossedBonesIcon, - GiSandsOfTimeIcon, } from "../icons/Icons"; interface BattleDisplayProps { diff --git a/ui/src/app/components/beast/BeastDisplay.tsx b/ui/src/app/components/beast/BeastDisplay.tsx index d944b7dbf..a2e44859f 100644 --- a/ui/src/app/components/beast/BeastDisplay.tsx +++ b/ui/src/app/components/beast/BeastDisplay.tsx @@ -3,8 +3,7 @@ import { getBeastData } from "../../lib/utils"; import { HeartIcon } from "../icons/Icons"; import EfficacyIcon from "../icons/EfficacyIcon"; import { processBeastName } from "../../lib/utils"; -import { Battle, Beast, Adventurer } from "@/app/types"; -import { useQueriesStore } from "@/app/hooks/useQueryStore"; +import { Beast } from "@/app/types"; import { HealthCountDown } from "../CountDown"; @@ -26,8 +25,9 @@ export const BeastDisplay = ({ beastData }: BeastDisplayProps) => {
{beastName}
{" "}
@@ -36,12 +36,8 @@ export const BeastDisplay = ({ beastData }: BeastDisplayProps) => {
-

- Level {beastData?.level} -

-

- Tier {tier} -

+

Level {beastData?.level}

+

Tier {tier}

diff --git a/ui/src/app/components/intro/WalletSelect.tsx b/ui/src/app/components/intro/WalletSelect.tsx index 919c16bdb..ff022ba0b 100644 --- a/ui/src/app/components/intro/WalletSelect.tsx +++ b/ui/src/app/components/intro/WalletSelect.tsx @@ -1,6 +1,6 @@ -import { useState, useEffect } from "react"; +import { useState } from "react"; import { Button } from "../buttons/Button"; -import { useConnectors, useAccount } from "@starknet-react/core"; +import { useConnectors } from "@starknet-react/core"; import useUIStore from "../../hooks/useUIStore"; import Image from "next/image"; import { WalletTutorial } from "../tutorial/WalletTutorial"; diff --git a/ui/src/app/components/inventory/InventoryRow.tsx b/ui/src/app/components/inventory/InventoryRow.tsx index f26d48bd2..43e325f58 100644 --- a/ui/src/app/components/inventory/InventoryRow.tsx +++ b/ui/src/app/components/inventory/InventoryRow.tsx @@ -1,10 +1,9 @@ -import { useEffect, useState, useRef, ReactElement, useCallback } from "react"; +import { useEffect, useState, ReactElement, useCallback } from "react"; import { useContracts } from "../../hooks/useContracts"; import { Button } from "../buttons/Button"; import useAdventurerStore from "../../hooks/useAdventurerStore"; import useTransactionCartStore from "../../hooks/useTransactionCartStore"; -import { useMediaQuery } from "react-responsive"; -import { Item, Menu, Metadata } from "@/app/types"; +import { Item } from "@/app/types"; import { GameData } from "../GameData"; import { getKeyFromValue } from "@/app/lib/utils"; diff --git a/ui/src/app/components/leaderboard/LiveRow.tsx b/ui/src/app/components/leaderboard/LiveRow.tsx index 656906de4..a7683fce0 100644 --- a/ui/src/app/components/leaderboard/LiveRow.tsx +++ b/ui/src/app/components/leaderboard/LiveRow.tsx @@ -11,16 +11,12 @@ import useUIStore from "@/app/hooks/useUIStore"; import { chunkArray, calculateLevel } from "@/app/lib/utils"; interface LiveLeaderboardRowProps { - index: number; adventurer: Adventurer; - rank: number; handleRowSelected: (id: number) => void; } const LiveLeaderboardRow = ({ - index, adventurer, - rank, handleRowSelected, }: LiveLeaderboardRowProps) => { const { gameContract } = useContracts(); diff --git a/ui/src/app/components/leaderboard/LiveTable.tsx b/ui/src/app/components/leaderboard/LiveTable.tsx index d218aab14..2a51a25cb 100644 --- a/ui/src/app/components/leaderboard/LiveTable.tsx +++ b/ui/src/app/components/leaderboard/LiveTable.tsx @@ -84,9 +84,7 @@ const LiveLeaderboardTable = ({ (adventurer: Adventurer, index: number) => ( ) diff --git a/ui/src/app/components/leaderboard/ScoreRow.tsx b/ui/src/app/components/leaderboard/ScoreRow.tsx index 5ee63bce2..e75d96eb7 100644 --- a/ui/src/app/components/leaderboard/ScoreRow.tsx +++ b/ui/src/app/components/leaderboard/ScoreRow.tsx @@ -3,14 +3,12 @@ import { useUiSounds, soundSelector } from "@/app/hooks/useUiSound"; import { formatNumber } from "@/app/lib/utils"; interface ScoreLeaderboardRowProps { - index: number; adventurer: any; rank: number; handleRowSelected: (id: number) => void; } const ScoreRow = ({ - index, adventurer, rank, handleRowSelected, diff --git a/ui/src/app/components/leaderboard/ScoreTable.tsx b/ui/src/app/components/leaderboard/ScoreTable.tsx index 119ecd8b9..7bdb15e9c 100644 --- a/ui/src/app/components/leaderboard/ScoreTable.tsx +++ b/ui/src/app/components/leaderboard/ScoreTable.tsx @@ -51,9 +51,6 @@ const ScoreLeaderboardTable = ({ const scoresWithLords = mergedScores; - console.log(scoresWithLords); - console.log(scoresData); - const totalPages = Math.ceil(scores.length / itemsPerPage); let previousXp = -1; @@ -108,7 +105,6 @@ const ScoreLeaderboardTable = ({ {scoresWithLords.map((adventurer: any, index: number) => ( void; calculatedNewGold: number; @@ -45,7 +42,6 @@ const MarketplaceRow = ({ item, index, selectedIndex, - adventurers, activeMenu, setActiveMenu, calculatedNewGold, @@ -56,25 +52,15 @@ const MarketplaceRow = ({ totalCharisma, }: MarketplaceRowProps) => { const [selectedButton, setSelectedButton] = useState(0); - const { gameContract } = useContracts(); const adventurer = useAdventurerStore((state) => state.adventurer); - const calls = useTransactionCartStore((state) => state.calls); - const addToCalls = useTransactionCartStore((state) => state.addToCalls); const { hashes, transactions } = useTransactionManager(); const { data: txData } = useWaitForTransaction({ hash: hashes[0] }); - // const setPurchasedItem = useUIStore((state) => state.setPurchasedItem); const transactingMarketIds = (transactions[0]?.metadata as Metadata)?.items; const gameData = new GameData(); const singlePurchaseExists = (item: string) => { - // return calls.some( - // (call: Call) => - // call.entrypoint == "buy_items_and_upgrade_stats" && - // Array.isArray(call.calldata) && - // call.calldata[2] == getKeyFromValue(gameData.ITEMS, item)?.toString() - // ); return purchaseItems.some( (purchasingItem: ItemPurchase) => purchasingItem.item == item ); diff --git a/ui/src/app/components/marketplace/MarketplaceTable.tsx b/ui/src/app/components/marketplace/MarketplaceTable.tsx index b2279fd00..ffff6473d 100644 --- a/ui/src/app/components/marketplace/MarketplaceTable.tsx +++ b/ui/src/app/components/marketplace/MarketplaceTable.tsx @@ -128,7 +128,6 @@ const MarketplaceTable = ({ item={item} index={index} selectedIndex={selectedIndex} - adventurers={adventurers} activeMenu={showEquipQ} setActiveMenu={setShowEquipQ} calculatedNewGold={calculatedNewGold} diff --git a/ui/src/app/containers/AdventurerScreen.tsx b/ui/src/app/containers/AdventurerScreen.tsx index c45b37ac8..59f8e3fe8 100644 --- a/ui/src/app/containers/AdventurerScreen.tsx +++ b/ui/src/app/containers/AdventurerScreen.tsx @@ -1,6 +1,5 @@ -import { useEffect, useState, useMemo } from "react"; +import { useEffect, useState } from "react"; import { useAccount } from "@starknet-react/core"; -// import { getAdventurersByOwner } from "../hooks/graphql/queries"; import { AdventurersList } from "../components/start/AdventurersList"; import { CreateAdventurer } from "../components/start/CreateAdventurer"; import ButtonMenu from "../components/menu/ButtonMenu"; @@ -26,38 +25,14 @@ export default function AdventurerScreen({ }: AdventurerScreenProps) { const [activeMenu, setActiveMenu] = useState(0); const [loading, setLoading] = useState(false); - const { account } = useAccount(); - const adventurer = useAdventurerStore((state) => state.adventurer); - const setAdventurer = useAdventurerStore((state) => state.setAdventurer); - const txAccepted = useLoadingStore((state) => state.txAccepted); - const { data } = useQueriesStore(); const adventurers = useQueriesStore( (state) => state.data.adventurersByOwnerQuery?.adventurers || [] ); - const queryAdventurer = useQueriesStore( - (state) => state.data.adventurerByIdQuery?.adventurers[0] || NullAdventurer - ); const resetData = useQueriesStore((state) => state.resetData); const startOption = useUIStore((state) => state.startOption); const setStartOption = useUIStore((state) => state.setStartOption); - console.log(startOption); - - // const owner = account?.address ? padAddress(account.address) : ""; - - // const ownerVariables = useMemo(() => { - // return { - // owner: owner, - // }; - // }, [owner]); - - // useCustomQuery( - // "adventurersByOwnerQuery", - // getAdventurersByOwner, - // ownerVariables - // ); - const menu = [ { id: 1, diff --git a/ui/src/app/containers/BeastScreen.tsx b/ui/src/app/containers/BeastScreen.tsx index 7c51b16de..f5dde5ba1 100644 --- a/ui/src/app/containers/BeastScreen.tsx +++ b/ui/src/app/containers/BeastScreen.tsx @@ -6,7 +6,7 @@ import useAdventurerStore from "../hooks/useAdventurerStore"; import { useQueriesStore } from "../hooks/useQueryStore"; import React, { useState } from "react"; import { processBeastName } from "../lib/utils"; -import { Battle, NullDiscovery, NullBeast } from "../types"; +import { Battle, NullBeast } from "../types"; import { Button } from "../components/buttons/Button"; import useUIStore from "../hooks/useUIStore"; @@ -28,9 +28,6 @@ export default function BeastScreen({ attack, flee }: BeastScreenProps) { const hasBeast = useAdventurerStore((state) => state.computed.hasBeast); const isAlive = useAdventurerStore((state) => state.computed.isAlive); - const lastBeast = useQueriesStore( - (state) => state.data.lastBeastQuery?.discoveries[0] || NullDiscovery - ); const beastData = useQueriesStore( (state) => state.data.beastQuery?.beasts[0] || NullBeast ); @@ -38,14 +35,14 @@ export default function BeastScreen({ attack, flee }: BeastScreenProps) { (state) => state.data.battlesByBeastQuery?.battles || [] ); - const [buttonText, setButtonText] = useState("Flee!"); + const [buttonText, setButtonText] = useState("Flee"); const handleMouseEnter = () => { - setButtonText("you coward!"); + setButtonText("You Coward!"); }; const handleMouseLeave = () => { - setButtonText("Flee!"); + setButtonText("Flee"); }; const attackButtonsData: ButtonData[] = [ @@ -196,7 +193,9 @@ export default function BeastScreen({ attack, flee }: BeastScreenProps) { />
-

Flee

+

+ {buttonText} +

( [] ); - const txAccepted = useLoadingStore((state) => state.txAccepted); - const queryData = useQueriesStore((state) => state.data); const discoveriesData = useCustomQuery("discoveriesQuery", getDiscoveries, { id: profile ? profile : adventurer?.id ?? 0, @@ -47,14 +44,6 @@ export default function EncountersScreen({ profile }: EncountersProps) { } ); - // useEffect(() => { - // if (adventurersByXPdata) { - // setIsLoading(); - // setData("adventurersByXPQuery", adventurersByXPdata); - // setNotLoading(); - // } - // }, [adventurersByXPdata]); - useEffect(() => { if (data) { setLoadingData(true); @@ -90,14 +79,6 @@ export default function EncountersScreen({ profile }: EncountersProps) { currentPage * encountersPerPage ); - // if (!discoveriesByAdventurerData || !battlesByAdventurerData) { - // return ( - //
- // - //
- // ); - // } - return (
{adventurer?.id || profile ? ( diff --git a/ui/src/app/containers/InventoryScreen.tsx b/ui/src/app/containers/InventoryScreen.tsx index f02c1b017..c59e38142 100644 --- a/ui/src/app/containers/InventoryScreen.tsx +++ b/ui/src/app/containers/InventoryScreen.tsx @@ -9,17 +9,13 @@ import { getKeyFromValue, groupBySlot } from "../lib/utils"; import { InventoryRow } from "../components/inventory/InventoryRow"; import Info from "../components/adventurer/Info"; import { ItemDisplay } from "../components/adventurer/ItemDisplay"; -import { Button } from "../components/buttons/Button"; import useAdventurerStore from "../hooks/useAdventurerStore"; import useTransactionCartStore from "../hooks/useTransactionCartStore"; import { useQueriesStore } from "../hooks/useQueryStore"; -import useLoadingStore from "../hooks/useLoadingStore"; import LootIcon from "../components/icons/LootIcon"; import { InfoIcon, BagIcon } from "../components/icons/Icons"; import { Call, Item, Metadata } from "../types"; import { GameData } from "../components/GameData"; -import useCustomQuery from "../hooks/useCustomQuery"; -import { getAdventurerById } from "../hooks/graphql/queries"; import useUIStore from "../hooks/useUIStore"; /** @@ -103,15 +99,6 @@ export default function InventoryScreen() { const gameData = new GameData(); - const singleEquipExists = (item: string) => { - return calls.some( - (call: Call) => - call.entrypoint == "equip" && - Array.isArray(call.calldata) && - call.calldata[2] == getKeyFromValue(gameData.ITEMS, item)?.toString() - ); - }; - const checkTransacting = (item: string) => { if (txData?.status == "RECEIVED") { return transactingItemIds?.includes(item); @@ -340,17 +327,6 @@ export default function InventoryScreen() { } handleDrop={handleDropItems} /> - {/* */}
); }) diff --git a/ui/src/app/containers/MarketplaceScreen.tsx b/ui/src/app/containers/MarketplaceScreen.tsx index 39a98fd6d..da074b4fd 100644 --- a/ui/src/app/containers/MarketplaceScreen.tsx +++ b/ui/src/app/containers/MarketplaceScreen.tsx @@ -1,18 +1,8 @@ -import { useState, useEffect, useRef, useMemo, useCallback } from "react"; -import { getLatestMarketItems } from "../hooks/graphql/queries"; -import MarketplaceRow from "../components/marketplace/MarketplaceRow"; +import { useState, useEffect, useRef, useCallback } from "react"; import useAdventurerStore from "../hooks/useAdventurerStore"; import LootIconLoader from "../components/icons/Loader"; -import useCustomQuery from "../hooks/useCustomQuery"; import { useQueriesStore } from "../hooks/useQueryStore"; -import { Item, ItemPurchase, NullItem, UpgradeStats } from "../types"; -import { getItemData, getItemPrice, getKeyFromValue } from "../lib/utils"; -import PurchaseHealth from "../components/actions/PurchaseHealth"; -import { useMediaQuery } from "react-responsive"; -import { Button } from "../components/buttons/Button"; -import { useContracts } from "../hooks/useContracts"; -import { GameData } from "../components/GameData"; -import useTransactionCartStore from "../hooks/useTransactionCartStore"; +import { ItemPurchase, UpgradeStats } from "../types"; import MarketplaceTable from "../components/marketplace/MarketplaceTable"; export interface MarketplaceScreenProps { diff --git a/ui/src/app/containers/ProfileScreen.tsx b/ui/src/app/containers/ProfileScreen.tsx index 508bd82b7..54c2fc08e 100644 --- a/ui/src/app/containers/ProfileScreen.tsx +++ b/ui/src/app/containers/ProfileScreen.tsx @@ -2,14 +2,8 @@ import Info from "../components/adventurer/Info"; import { useQueriesStore } from "../hooks/useQueryStore"; import { Button } from "../components/buttons/Button"; import useUIStore from "../hooks/useUIStore"; -import useCustomQuery from "../hooks/useCustomQuery"; -import { - getAdventurerById, - getItemsByAdventurer, -} from "../hooks/graphql/queries"; -import { useEffect, useState } from "react"; +import { useState } from "react"; import EncountersScreen from "./EncountersScreen"; -import { useMediaQuery } from "react-responsive"; import { NullAdventurer } from "../types"; export default function Profile() { diff --git a/ui/src/app/containers/UpgradeScreen.tsx b/ui/src/app/containers/UpgradeScreen.tsx index 397fef900..3ace6ee2e 100644 --- a/ui/src/app/containers/UpgradeScreen.tsx +++ b/ui/src/app/containers/UpgradeScreen.tsx @@ -21,7 +21,6 @@ import { HeartVitalityIcon, LightbulbIcon, ScrollIcon, - HealthPotionIcon, HeartIcon, } from "../components/icons/Icons"; import PurchaseHealth from "../components/actions/PurchaseHealth"; @@ -42,11 +41,10 @@ interface UpgradeScreenProps { * @description Provides the upgrade screen for the adventurer. */ export default function UpgradeScreen({ upgrade }: UpgradeScreenProps) { - const { gameContract, lordsContract } = useContracts(); + const { gameContract } = useContracts(); const adventurer = useAdventurerStore((state) => state.adventurer); const loading = useLoadingStore((state) => state.loading); const estimatingFee = useUIStore((state) => state.estimatingFee); - const txAccepted = useLoadingStore((state) => state.txAccepted); const resetNotification = useLoadingStore((state) => state.resetNotification); const addToCalls = useTransactionCartStore((state) => state.addToCalls); const removeEntrypointFromCalls = useTransactionCartStore( @@ -64,7 +62,6 @@ export default function UpgradeScreen({ upgrade }: UpgradeScreenProps) { const setUpgrades = useUIStore((state) => state.setUpgrades); const purchaseItems = useUIStore((state) => state.purchaseItems); const setPurchaseItems = useUIStore((state) => state.setPurchaseItems); - const setScreen = useUIStore((state) => state.setScreen); const pendingMessage = useLoadingStore((state) => state.pendingMessage); const [summary, setSummary] = useState({ Stats: { ...ZeroUpgrade }, @@ -74,11 +71,6 @@ export default function UpgradeScreen({ upgrade }: UpgradeScreenProps) { const gameData = new GameData(); - // useCustomQuery("latestMarketItemsQuery", getLatestMarketItems, { - // adventurerId: adventurer?.id, - // limit: 20 * (adventurer?.statUpgrades ?? 0), - // }); - const checkTransacting = typeof pendingMessage === "string" && (pendingMessage as string).startsWith("Upgrading"); diff --git a/ui/src/app/hooks/useCustomQuery.ts b/ui/src/app/hooks/useCustomQuery.ts index 26fa01bc2..3c77a9d7e 100644 --- a/ui/src/app/hooks/useCustomQuery.ts +++ b/ui/src/app/hooks/useCustomQuery.ts @@ -1,7 +1,6 @@ -import { useEffect, useRef, useCallback } from "react"; +import { useEffect, useCallback } from "react"; import { useQuery } from "@apollo/client"; import { useQueriesStore, QueryKey } from "./useQueryStore"; -import { isEqual } from "lodash"; type Variables = Record< string, diff --git a/ui/src/app/hooks/useLoadingStore.ts b/ui/src/app/hooks/useLoadingStore.ts index 4724d3bf3..7640b3163 100644 --- a/ui/src/app/hooks/useLoadingStore.ts +++ b/ui/src/app/hooks/useLoadingStore.ts @@ -1,5 +1,4 @@ import { create } from "zustand"; -import { QueryKey } from "./useQueryStore"; // TODO: Notification Data type diff --git a/ui/src/app/hooks/useQueryStore.ts b/ui/src/app/hooks/useQueryStore.ts index dc80d9ac7..5c0fbdaa0 100644 --- a/ui/src/app/hooks/useQueryStore.ts +++ b/ui/src/app/hooks/useQueryStore.ts @@ -1,5 +1,4 @@ import { create } from "zustand"; -import { isEqual } from "lodash"; import { Battle, Beast, Item, Adventurer, Discovery, Score } from "../types"; import { GameData } from "../components/GameData"; diff --git a/ui/src/app/lib/burner.tsx b/ui/src/app/lib/burner.tsx index 5f80b7feb..5c77b6f56 100644 --- a/ui/src/app/lib/burner.tsx +++ b/ui/src/app/lib/burner.tsx @@ -7,7 +7,6 @@ import { hash, Provider, stark, - TransactionFinalityStatus, Call, selector, } from "starknet"; diff --git a/ui/src/app/lib/utils/processData.ts b/ui/src/app/lib/utils/processData.ts index 7b5372bd8..c3840a7c8 100644 --- a/ui/src/app/lib/utils/processData.ts +++ b/ui/src/app/lib/utils/processData.ts @@ -25,7 +25,6 @@ import { UpgradesAvailableEvent, IdleDeathPenaltyEvent, AdventurerUpgradedEvent, - AdventurerState, } from "../../types/events"; import { Adventurer } from "@/app/types"; import { feltToString } from ".";