Skip to content

Commit

Permalink
fix bid
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Sep 11, 2024
1 parent a2aefd9 commit 6111876
Showing 1 changed file with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ import {
import { useToast } from "@ark-market/ui/use-toast";

import type { Token, TokenMarketData } from "~/types";
import LordsInput from "~/components/lords-input";
import { ETH } from "~/constants/tokens";

Check failure on line 40 in apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/token-actions-make-bid.tsx

View workflow job for this annotation

GitHub Actions / lint

'ETH' is defined but never used. Allowed unused vars must match /^_/u
import { env } from "~/env";
import useBalance from "~/hooks/useBalance";

Check failure on line 42 in apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/token-actions-make-bid.tsx

View workflow job for this annotation

GitHub Actions / lint

'useBalance' is defined but never used. Allowed unused vars must match /^_/u
import useConnectWallet from "~/hooks/useConnectWallet";
import { useTokenBalance } from "~/hooks/useTokenBalance";
import formatAmount from "~/lib/formatAmount";
import ToastExecutedTransactionContent from "./toast-executed-transaction-content";
import ToastRejectedTransactionContent from "./toast-rejected-transaction-content";
Expand All @@ -62,7 +64,10 @@ export default function TokenActionsMakeBid({
const config = useConfig();
const { createOffer, status } = useCreateOffer();
const { toast } = useToast();
const { data: ethBalance } = useBalance({ address, token: ETH });
const { data: lordsBalance } = useTokenBalance({
token: env.NEXT_PUBLIC_LORDS_TOKEN_ADDRESS,
});
// const { data: lordsBalance } = useBalance({ address, token: ETH });
const { ensureConnect } = useConnectWallet({
account,
onConnect: () => {
Expand All @@ -86,7 +91,7 @@ export default function TokenActionsMakeBid({
(val) => {
const num = parseEther(val);

return ethBalance && ethBalance.value >= num;
return lordsBalance && lordsBalance.value >= num;
},
{
message: "You don't have enough funds in your wallet",
Expand Down Expand Up @@ -145,7 +150,7 @@ export default function TokenActionsMakeBid({
if (!account || !config) {
return;
}
setModalEnabled(false)
setModalEnabled(false);

const tokenIdNumber = parseInt(token.token_id, 10);

Expand All @@ -166,7 +171,7 @@ export default function TokenActionsMakeBid({
starknetAccount: account,
...processedValues,
});
setModalEnabled(true)
setModalEnabled(true);
}

const isLoading = status === "loading";
Expand Down Expand Up @@ -226,7 +231,7 @@ export default function TokenActionsMakeBid({
<FormItem>
<FormLabel>Set Price</FormLabel>
<FormControl>
<EthInput
<LordsInput
value={field.value}
onChange={field.onChange}
status={
Expand All @@ -236,6 +241,16 @@ export default function TokenActionsMakeBid({
: "default"
}
/>
{/* <EthInput
value={field.value}
onChange={field.onChange}
status={
formattedStartAmount !== "-" &&
fieldState.error?.message
? "error"
: "default"
}
/> */}
</FormControl>
<FormMessage />
</FormItem>
Expand Down

0 comments on commit 6111876

Please sign in to comment.