diff --git a/client/src/ui/components/hyperstructures/CoOwners.tsx b/client/src/ui/components/hyperstructures/CoOwners.tsx index f776140fb..2987cd2b5 100644 --- a/client/src/ui/components/hyperstructures/CoOwners.tsx +++ b/client/src/ui/components/hyperstructures/CoOwners.tsx @@ -3,16 +3,14 @@ import { LeaderboardManager } from "@/dojo/modelManager/LeaderboardManager"; import { useDojo } from "@/hooks/context/DojoContext"; import { useRealm } from "@/hooks/helpers/useRealm"; import { getStructureByEntityId } from "@/hooks/helpers/useStructures"; +import useUIStore from "@/hooks/store/useUIStore"; import { AddressSelect } from "@/ui/elements/AddressSelect"; import Button from "@/ui/elements/Button"; - -import useUIStore from "@/hooks/store/useUIStore"; import { NumberInput } from "@/ui/elements/NumberInput"; -import { OrderIcon } from "@/ui/elements/OrderIcon"; import { SortButton, SortInterface } from "@/ui/elements/SortButton"; import { SortPanel } from "@/ui/elements/SortPanel"; import { displayAddress, formatTime, getEntityIdFromKeys } from "@/ui/utils/utils"; -import { ContractAddress, getOrderName, HYPERSTRUCTURE_CONFIG_ID, ID } from "@bibliothecadao/eternum"; +import { ContractAddress, HYPERSTRUCTURE_CONFIG_ID, ID } from "@bibliothecadao/eternum"; import { useComponentValue } from "@dojoengine/react"; import { getComponentValue } from "@dojoengine/recs"; import { Plus } from "lucide-react"; @@ -90,12 +88,11 @@ const CoOwnersRows = ({ const structure = getStructureByEntityId(hyperstructureEntityId); - const { getAddressName, getAddressOrder } = useRealm(); + const { getAddressName } = useRealm(); const sortingParams = useMemo(() => { return [ { label: "Name", sortKey: "name", className: "" }, - { label: "Order", sortKey: "order", className: "" }, { label: "Address", sortKey: "address", className: "" }, { label: "Percentage", sortKey: "percentage", className: "flex justify-end" }, ]; @@ -108,7 +105,7 @@ const CoOwnersRows = ({ return ( <> - + {sortingParams.map(({ label, sortKey, className }) => (
-
+
{playerName}
-
{displayAddress(coOwner.address.toString(16))}
{coOwner.percentage / 100}%
diff --git a/client/src/ui/components/hyperstructures/Leaderboard.tsx b/client/src/ui/components/hyperstructures/Leaderboard.tsx index 985b0f756..f39d27492 100644 --- a/client/src/ui/components/hyperstructures/Leaderboard.tsx +++ b/client/src/ui/components/hyperstructures/Leaderboard.tsx @@ -27,7 +27,7 @@ export const Leaderboard = ({ } = useDojo(); const nextBlockTimestamp = useUIStore((state) => state.nextBlockTimestamp); - const { getAddressName, getAddressOrder } = useRealm(); + const { getAddressName } = useRealm(); const playerPointsLeaderboard = useMemo(() => { return LeaderboardManager.instance().getPlayersByRank(nextBlockTimestamp || 0, hyperstructureEntityId); @@ -44,7 +44,6 @@ export const Leaderboard = ({ const sortingParams = useMemo(() => { return [ { label: "Name", sortKey: "name", className: "" }, - { label: "Order", sortKey: "order", className: "" }, { label: "Address", sortKey: "address", className: "" }, { label: "Points", sortKey: "points", className: "flex justify-end" }, ]; @@ -63,7 +62,7 @@ export const Leaderboard = ({ return update ? ( <> - + {sortingParams.map(({ label, sortKey, className }) => (
-
+
{playerName}
-
{displayAddress(address.toString(16))}
{currencyIntlFormat(points)}
diff --git a/client/src/ui/components/worldmap/leaderboard/PlayersLeaderboard.tsx b/client/src/ui/components/worldmap/leaderboard/PlayersLeaderboard.tsx index f3e95dfeb..8898c5926 100644 --- a/client/src/ui/components/worldmap/leaderboard/PlayersLeaderboard.tsx +++ b/client/src/ui/components/worldmap/leaderboard/PlayersLeaderboard.tsx @@ -2,14 +2,12 @@ import { LeaderboardManager } from "@/dojo/modelManager/LeaderboardManager"; import { useDojo } from "@/hooks/context/DojoContext"; import { useRealm } from "@/hooks/helpers/useRealm"; import useUIStore from "@/hooks/store/useUIStore"; -import { ContractAddress, getOrderName } from "@bibliothecadao/eternum"; +import { ContractAddress } from "@bibliothecadao/eternum"; import { useMemo, useState } from "react"; import { PlayerPointsLeaderboardInterface } from "../../../../hooks/store/useLeaderBoardStore"; -import { OrderIcon } from "../../../elements/OrderIcon"; import { SortButton, SortInterface } from "../../../elements/SortButton"; import { SortPanel } from "../../../elements/SortPanel"; import { currencyIntlFormat, displayAddress, sortItems } from "../../../utils/utils"; -import { ReactComponent as Cross } from "@/assets/icons/common/cross.svg"; type PlayerPointsLeaderboardKeys = keyof PlayerPointsLeaderboardInterface; @@ -24,7 +22,7 @@ export const PlayersLeaderboard = () => { account: { account }, } = useDojo(); - const { getAddressName, getAddressOrder } = useRealm(); + const { getAddressName } = useRealm(); const [activeSort, setActiveSort] = useState({ sortKey: "number", @@ -38,8 +36,7 @@ export const PlayersLeaderboard = () => { const sortingParams: SortingParamPlayerPointsLeaderboard[] = useMemo(() => { return [ { label: "Rank", sortKey: "rank", className: "col-span-1" }, - { label: "Name", sortKey: "addressName", className: "col-span-1" }, - { label: "Order", sortKey: "order", className: "col-span-1" }, + { label: "Name", sortKey: "addressName", className: "col-span-2" }, { label: "Address", sortKey: "address", className: "col-span-2" }, { label: "Points", sortKey: "totalPoints", className: "col-span-1" }, ]; @@ -70,21 +67,13 @@ export const PlayersLeaderboard = () => { const isOwner = address === ContractAddress(account.address); - const order = getAddressOrder(address) || 0; - const orderName = getOrderName(order); - return (
{`#${index + 1}`}
-
{playerName}
- {order ? ( - - ) : ( - - )} +
{playerName}
{displayAddress(address.toString(16))}
{currencyIntlFormat(points)}