Skip to content

Commit

Permalink
fix #1255 (#1270)
Browse files Browse the repository at this point in the history
  • Loading branch information
aymericdelab authored Aug 15, 2024
1 parent c3aff36 commit c072fb8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions client/src/ui/components/bank/BankList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import { useMemo, useState } from "react";
import AddLiquidity from "./AddLiquidity";
import { LiquidityTable } from "./LiquidityTable";
import { ResourceSwap } from "./Swap";
import { ID } from "@bibliothecadao/eternum";

type BankListProps = {
entity: any;
entityId: ID;
};

export const BankPanel = ({ entity }: BankListProps) => {
export const BankPanel = ({ entityId }: BankListProps) => {
const {
setup: {
components: { Position, Owner },
components: { Position },
},
} = useDojo();

Expand All @@ -24,8 +25,7 @@ export const BankPanel = ({ entity }: BankListProps) => {
const { playerRealms } = useEntities();

const realmEntityId = playerRealms()[0].entity_id!;
const owner = getComponentValue(Owner, getEntityIdFromKeys([entity.id]));
const position = getComponentValue(Position, getEntityIdFromKeys([entity.id]));
const position = getComponentValue(Position, getEntityIdFromKeys([BigInt(entityId)]));

const tabs = useMemo(
() => [
Expand All @@ -36,7 +36,7 @@ export const BankPanel = ({ entity }: BankListProps) => {
<div>Swap</div>
</div>
),
component: <ResourceSwap bankEntityId={entity.id} entityId={realmEntityId} />,
component: <ResourceSwap bankEntityId={entityId} entityId={realmEntityId} />,
},
{
key: "all",
Expand All @@ -47,7 +47,7 @@ export const BankPanel = ({ entity }: BankListProps) => {
),
component: (
<div className="w-1/2 mx-auto">
<AddLiquidity bank_entity_id={entity.id} entityId={realmEntityId!} />
<AddLiquidity bank_entity_id={entityId} entityId={realmEntityId!} />
</div>
),
},
Expand All @@ -58,10 +58,10 @@ export const BankPanel = ({ entity }: BankListProps) => {
const liquidityTable = useMemo(() => {
return (
<div className="mt-4">
<LiquidityTable bank_entity_id={entity.id} entity_id={realmEntityId} />
<LiquidityTable bank_entity_id={entityId} entity_id={realmEntityId} />
</div>
);
}, [entity.id, realmEntityId]);
}, [entityId, realmEntityId]);

return (
<div className="m-4">
Expand Down
2 changes: 1 addition & 1 deletion client/src/ui/components/trading/MarketModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const MarketModal = () => {
<div>AMM</div>
</div>
),
component: bank && <BankPanel entity={{ id: bank.entityId }} />,
component: bank && <BankPanel entityId={bank.entityId} />,
},
{
key: "all",
Expand Down

0 comments on commit c072fb8

Please sign in to comment.