File tree Expand file tree Collapse file tree
packages/allo-app/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import { Input } from "~/components/ui/input";
1818import { Button } from "~/components/ui/button" ;
1919import { Textarea } from "~/components/ui/textarea" ;
2020import { useIpfsUpload } from "~/hooks/use-ipfs-upload" ;
21- import { BalanceCheck } from "~/components/balance-check" ;
21+ import { BalanceCheck } from "~/components/token/ balance-check" ;
2222import { ImageUpload } from "~/components/image-upload" ;
2323import { RegistrationSchema } from "./schemas" ;
2424import { useRegister } from "./use-register" ;
Original file line number Diff line number Diff line change 11import { PropsWithChildren } from "react" ;
22import { 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" >
You can’t perform that action at this time.
0 commit comments