From f2663a6c36cfc994c45e29f21e18c862b8cffeed Mon Sep 17 00:00:00 2001 From: starknetdev Date: Thu, 5 Oct 2023 17:43:50 +0100 Subject: [PATCH 1/4] - modify actions layout - set fixed height for all screens - make drop + swap buttons smaller in adventurer card - start mobile fixes --- ui/src/app/components/KeyboardControls.tsx | 8 +++++--- ui/src/app/components/adventurer/ItemDisplay.tsx | 6 +++--- ui/src/app/components/menu/ButtonMenu.tsx | 14 ++------------ ui/src/app/components/start/AdventurersList.tsx | 4 ++-- ui/src/app/containers/ActionsScreen.tsx | 4 ++-- ui/src/app/containers/AdventurerScreen.tsx | 4 ++-- ui/src/app/containers/BeastScreen.tsx | 6 +++--- ui/src/app/containers/GuideScreen.tsx | 2 +- ui/src/app/containers/InventoryScreen.tsx | 2 +- ui/src/app/containers/LeaderboardScreen.tsx | 2 +- ui/src/app/page.tsx | 6 +++--- 11 files changed, 25 insertions(+), 33 deletions(-) diff --git a/ui/src/app/components/KeyboardControls.tsx b/ui/src/app/components/KeyboardControls.tsx index 2e54fe3a9..53b9a670f 100644 --- a/ui/src/app/components/KeyboardControls.tsx +++ b/ui/src/app/components/KeyboardControls.tsx @@ -49,7 +49,9 @@ const KeyboardControl = ({ buttonsData, size, direction }: ButtonProps) => { return (
{buttonsData.map((buttonData, index) => ( )} {inventory && ( @@ -237,7 +237,7 @@ export const ItemDisplay = ({ {isDeploying && (
From 8a3faf5eb1758bd226caaf352cac4652f9df7cd9 Mon Sep 17 00:00:00 2001 From: starknetdev Date: Mon, 9 Oct 2023 15:24:26 +0100 Subject: [PATCH 4/4] temp AA fix --- ui/src/app/lib/utils/syscalls.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ui/src/app/lib/utils/syscalls.ts b/ui/src/app/lib/utils/syscalls.ts index ec7c16bd0..790134d9b 100644 --- a/ui/src/app/lib/utils/syscalls.ts +++ b/ui/src/app/lib/utils/syscalls.ts @@ -232,6 +232,16 @@ export function syscalls({ }; const spawn = async (formData: FormData) => { + const mintLords: Call = { + contractAddress: lordsContract?.address ?? "", + entrypoint: "mint", + calldata: [account?.address ?? "0x0", (250 * 10 ** 18).toString(), "0"], + }; + const approveLordsSpendingTx = { + contractAddress: lordsContract?.address ?? "", + entrypoint: "approve", + calldata: [gameContract?.address ?? "", (250 * 10 ** 18).toString(), "0"], + }; const mintAdventurerTx = { contractAddress: gameContract?.address ?? "", entrypoint: "new_game", @@ -244,7 +254,7 @@ export function syscalls({ addToCalls(mintAdventurerTx); const balanceEmpty = await checkArcadeBalance( - [...calls, mintAdventurerTx], + [...calls, mintLords, approveLordsSpendingTx, mintAdventurerTx], ethBalance, showTopUpDialog, setTopUpAccount, @@ -252,8 +262,6 @@ export function syscalls({ account ); - console.log(balanceEmpty); - if (!balanceEmpty) { startLoading( "Create", @@ -264,6 +272,8 @@ export function syscalls({ try { const tx = await handleSubmitCalls(account, [ ...calls, + mintLords, + approveLordsSpendingTx, mintAdventurerTx, ]); setTxHash(tx?.transaction_hash);