Skip to content

Commit

Permalink
add top ups
Browse files Browse the repository at this point in the history
  • Loading branch information
starknetdev committed Sep 21, 2023
1 parent fbf8efa commit 668fdeb
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion ui/src/app/components/ArcadeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export const ArcadeDialog = () => {
);
}, [available]);

console.log(arcadeConnectors());

if (!connectors) return <div></div>;

return (
Expand Down Expand Up @@ -69,6 +71,7 @@ export const ArcadeDialog = () => {
onClick={connect}
address={address!}
masterAccount={MasterAccount!}
arcadeConnectors={arcadeConnectors()}
/>
);
})}
Expand All @@ -91,13 +94,15 @@ interface ArcadeAccountCardProps {
onClick: (conn: Connector<any>) => void;
address: string;
masterAccount: AccountInterface;
arcadeConnectors: any[];
}

export const ArcadeAccountCard = ({
account,
onClick,
address,
masterAccount,
arcadeConnectors,
}: ArcadeAccountCardProps) => {
const { data } = useBalance({
address: account.name,
Expand Down Expand Up @@ -142,6 +147,12 @@ export const ArcadeAccountCard = ({
}
};

console.log(
arcadeConnectors.some(
(conn) => conn.options.options.id == masterAccount.address
)
);

return (
<div className="border border-terminal-green p-3 hover:bg-terminal-green hover:text-terminal-black items-center">
<div className="text-left flex flex-col text-sm sm:text-xl mb-0 sm:mb-4 items-center">
Expand All @@ -153,13 +164,23 @@ export const ArcadeAccountCard = ({
</span>
<span className="text-lg">{balance}ETH</span>{" "}
</div>
<div className="flex justify-center">
<div className="flex flex-row justify-center">
<Button
variant={connected ? "default" : "ghost"}
onClick={() => onClick(account)}
>
{connected ? "connected" : "connect"}
</Button>
{!arcadeConnectors.some(
(conn) => conn.options.options.id == masterAccount.address
) && (
<Button
variant={connected ? "default" : "ghost"}
onClick={() => transfer(account.name, masterAccount)}
>
Top Up 0.01Eth
</Button>
)}
</div>

{isCopied && <span>Copied!</span>}
Expand Down

1 comment on commit 668fdeb

@vercel
Copy link

@vercel vercel bot commented on 668fdeb Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.