From 598ab8b7184bac6c7d486e884e879606909d4e33 Mon Sep 17 00:00:00 2001 From: Starknet Dev Date: Tue, 17 Sep 2024 15:30:19 -0400 Subject: [PATCH] remove xp to next level when item greatness 20 --- .../app/components/adventurer/ItemDisplay.tsx | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/ui/src/app/components/adventurer/ItemDisplay.tsx b/ui/src/app/components/adventurer/ItemDisplay.tsx index d536dc297..5693f4088 100644 --- a/ui/src/app/components/adventurer/ItemDisplay.tsx +++ b/ui/src/app/components/adventurer/ItemDisplay.tsx @@ -1,16 +1,21 @@ -import React, { useEffect, useState } from "react"; -import { Contract } from "starknet"; -import { Item } from "@/app/types"; -import LootIcon from "@/app/components/icons/LootIcon"; -import Efficacyicon from "@/app/components/icons/EfficacyIcon"; -import { processItemName, calculateLevel, getItemData } from "@/app/lib/utils"; -import { GameData } from "@/app/lib/data/GameData"; -import { getKeyFromValue, getValueFromKey } from "@/app/lib/utils"; -import { SwapIcon, DownArrowIcon } from "@/app/components/icons/Icons"; -import { Button } from "@/app/components/buttons/Button"; -import useUIStore from "@/app/hooks/useUIStore"; import { InventoryDisplay } from "@/app/components/adventurer/InventoryDisplay"; +import { Button } from "@/app/components/buttons/Button"; +import Efficacyicon from "@/app/components/icons/EfficacyIcon"; +import { DownArrowIcon, SwapIcon } from "@/app/components/icons/Icons"; +import LootIcon from "@/app/components/icons/LootIcon"; import { useQueriesStore } from "@/app/hooks/useQueryStore"; +import useUIStore from "@/app/hooks/useUIStore"; +import { GameData } from "@/app/lib/data/GameData"; +import { + calculateLevel, + getItemData, + getKeyFromValue, + getValueFromKey, + processItemName, +} from "@/app/lib/utils"; +import { Item } from "@/app/types"; +import React, { useEffect, useState } from "react"; +import { Contract } from "starknet"; interface ItemDisplayProps { item: Item; @@ -190,7 +195,8 @@ export const ItemDisplay = ({ */} {item && - ` XP to Next Lvl: ${ + calculateLevel(item.xp ?? 0) !== 20 && + `XP to Next Lvl: ${ Math.floor(calculateLevel(item.xp ?? 0) + 1) ** 2 - (item.xp ?? 0) }`}