Skip to content

Commit

Permalink
fix input and update base gas limit
Browse files Browse the repository at this point in the history
  • Loading branch information
juliancwirko committed Apr 30, 2024
1 parent c041811 commit dd498ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ NEXT_PUBLIC_NFT_SMART_CONTRACT = erd1qqqqqqqqqqqqqpgqufmyqvy3kvda2uywqgx809lglxf
NEXT_PUBLIC_MINT_FUNCTION_NAME = 'mint'

# The Elven Tools NFT minter base gas limit for the 'mint' endpoint (adjust it for a modified smart contract)
NEXT_PUBLIC_MINT_BASE_GAS_LIMIT = 13000000
NEXT_PUBLIC_MINT_BASE_GAS_LIMIT = 14000000

# =============================================
# Private variables (used on backend)
Expand Down
9 changes: 6 additions & 3 deletions components/MintForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,20 @@ interface MintFormProps {
}

export const MintForm: FC<MintFormProps> = ({ leftToMintForUser, cb }) => {
const [amount, setAmount] = useState(1);
const [amount, setAmount] = useState<number | ''>(1);
const { mint, pending, transaction, txResult, error } =
useMintTransaction(cb);
const { loginMethod } = useLoginInfo();

const handleMint = useCallback(() => {
mint(amount);
if (amount) {
mint(amount);
}
}, [amount, mint]);

const setAmountHandler = useCallback(
(valueAsString: string, valueAsNumber: number) => setAmount(valueAsNumber),
(valueAsString: string, valueAsNumber: number) =>
setAmount(valueAsString !== '' ? valueAsNumber : ''),
[]
);

Expand Down

0 comments on commit dd498ec

Please sign in to comment.