Skip to content

Commit 63fef7e

Browse files
committed
Move BalanceCheck to components/token
1 parent a9e4838 commit 63fef7e

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

packages/allo-app/components/registration/registration-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { Input } from "~/components/ui/input";
1818
import { Button } from "~/components/ui/button";
1919
import { Textarea } from "~/components/ui/textarea";
2020
import { useIpfsUpload } from "~/hooks/use-ipfs-upload";
21-
import { BalanceCheck } from "~/components/balance-check";
21+
import { BalanceCheck } from "~/components/token/balance-check";
2222
import { ImageUpload } from "~/components/image-upload";
2323
import { RegistrationSchema } from "./schemas";
2424
import { useRegister } from "./use-register";

packages/allo-app/components/balance-check.tsx renamed to packages/allo-app/components/token/balance-check.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import { PropsWithChildren } from "react";
22
import { useAccount, useBalance } from "wagmi";
3-
import { Button } from "./ui/button";
3+
import { Button } from "../ui/button";
44

5-
export function BalanceCheck({ children }: PropsWithChildren) {
5+
export function BalanceCheck({
6+
children,
7+
amount = 0n,
8+
}: PropsWithChildren<{ amount?: bigint }>) {
69
const { address } = useAccount();
7-
const { data: { value = 0 } = {}, isPending } = useBalance({
10+
const { data: { value = 0n } = {}, isPending } = useBalance({
811
address,
912
});
1013

1114
if (isPending) return <Button variant={"outline"} isLoading />;
1215

13-
if (value > 0) return <>{children}</>;
16+
if (value > amount) return <>{children}</>;
1417

1518
return (
1619
<Button disabled variant="ghost">

0 commit comments

Comments
 (0)