@@ -461,119 +461,97 @@ export default function FundContract(props: {
461
461
< p className = "text-sm" > { props . round . roundFeePercentage ?? 0 } %</ p >
462
462
</ div >
463
463
< hr className = "mt-6 mb-6" />
464
- { ! props . round . payoutStrategy . isReadyForPayout ? (
465
- < >
466
- < div className = "flex flex-row justify-start mt-6" >
467
- < p className = "text-sm w-1/3" > Amount funded:</ p >
468
- < p className = "text-sm" >
469
- { amountFundedInUnits } { matchingFundPayoutToken ?. code } { " " }
470
- { tokenBalanceInUSD && Number ( tokenBalanceInUSD ) > 0 ? (
471
- < span className = "text-sm text-slate-400 ml-2" >
472
- ${ tokenBalanceInUSD . toFixed ( 2 ) } USD
473
- </ span >
474
- ) : null }
475
- </ p >
476
- </ div >
477
- < div className = "flex flex-row justify-start mt-6" >
478
- < p className = "text-sm w-1/3" > Amount left to fund:</ p >
479
- < p className = "text-sm" >
480
- { " " }
481
- { totalAmountLeftToFund
482
- ?. toLocaleString ( undefined , {
483
- minimumFractionDigits : 5 ,
484
- } )
485
- . replace ( / \. ? 0 + $ / , "" ) } { " " }
486
- { matchingFundPayoutToken ?. code } { " " }
487
- { amountLeftToFundInUSD !== undefined &&
488
- amountLeftToFundInUSD > 0 ? (
489
- < span className = "text-sm text-slate-400 ml-2" >
490
- ${ amountLeftToFundInUSD . toFixed ( 2 ) } USD
491
- </ span >
492
- ) : null }
493
- </ p >
494
- </ div >
495
- < div className = "flex flex-row justify-start mt-6" >
496
- < p className = "text-sm w-1/3 py-3" > Amount to fund:</ p >
497
- { /* todo: update input with a max selector at right of input */ }
498
- < input
499
- disabled = { fundContractDisabled }
500
- className = "border border-gray-300 rounded-md p-2 w-1/2"
501
- placeholder = { `${
502
- fundContractDisabled
503
- ? "Contract is fully funded"
504
- : "Enter the amount you wish to fund"
505
- } `}
506
- value = { amountToFund }
507
- onChange = { ( e ) => setAmountToFund ( e . target . value ) }
508
- />
509
- </ div >
510
- < div className = "flex flex-row justify-start mt-6" >
511
- < button
512
- disabled = { fundContractDisabled }
513
- className = { classNames (
514
- `bg-violet-400 hover:bg-violet-700 text-white py-2 px-4 rounded ${
515
- fundContractDisabled
516
- ? "cursor-not-allowed"
517
- : "cursor-pointer"
518
- } `
519
- ) }
520
- data-testid = "fund-contract-btn"
521
- onClick = { ( ) => handleFundContract ( ) }
522
- >
523
- Fund Contract
524
- </ button >
525
- { props . round . tags ?. includes ( "allo-v1" ) && (
526
- < button
527
- className = "bg-white hover:text-violet-700 hover:border-violet-700 text-gray py-2 px-4 rounded border border-gray ml-4"
528
- data-testid = "view-contract-btn"
529
- onClick = { ( ) =>
530
- window . open (
531
- getTxExplorerForContract (
532
- chainId ! ,
533
- props . roundId as string
534
- ) ,
535
- "_blank"
536
- )
537
- }
538
- >
539
- View Contract
540
- </ button >
541
- ) }
542
- </ div >
543
- { insufficientBalance && (
544
- < div
545
- data-testid = "insufficientBalance"
546
- className = "rounded-md bg-red-50 py-2 text-pink-500 flex justify-center my-4 text-sm"
547
- >
548
- < InformationCircleIcon className = "w-4 h-4 mr-1 mt-0.5" />
549
- < span >
550
- You do not have enough funds for funding the matching pool.
464
+ < >
465
+ < div className = "flex flex-row justify-start mt-6" >
466
+ < p className = "text-sm w-1/3" > Amount funded:</ p >
467
+ < p className = "text-sm" >
468
+ { amountFundedInUnits } { matchingFundPayoutToken ?. code } { " " }
469
+ { tokenBalanceInUSD && Number ( tokenBalanceInUSD ) > 0 ? (
470
+ < span className = "text-sm text-slate-400 ml-2" >
471
+ ${ tokenBalanceInUSD . toFixed ( 2 ) } USD
551
472
</ span >
552
- </ div >
553
- ) }
554
- < FundContractModals />
555
- </ >
556
- ) : (
557
- < div >
558
- < p className = "text-sm text-grey-400 mb-4" >
473
+ ) : null }
474
+ </ p >
475
+ </ div >
476
+ < div className = "flex flex-row justify-start mt-6" >
477
+ < p className = "text-sm w-1/3" > Amount left to fund:</ p >
478
+ < p className = "text-sm" >
559
479
{ " " }
560
- Round has been finalized and funds have been moved to the payout
561
- contract.
480
+ { totalAmountLeftToFund
481
+ ?. toLocaleString ( undefined , {
482
+ minimumFractionDigits : 5 ,
483
+ } )
484
+ . replace ( / \. ? 0 + $ / , "" ) } { " " }
485
+ { matchingFundPayoutToken ?. code } { " " }
486
+ { amountLeftToFundInUSD !== undefined &&
487
+ amountLeftToFundInUSD > 0 ? (
488
+ < span className = "text-sm text-slate-400 ml-2" >
489
+ ${ amountLeftToFundInUSD . toFixed ( 2 ) } USD
490
+ </ span >
491
+ ) : null }
562
492
</ p >
493
+ </ div >
494
+ < div className = "flex flex-row justify-start mt-6" >
495
+ < p className = "text-sm w-1/3 py-3" > Amount to fund:</ p >
496
+ { /* todo: update input with a max selector at right of input */ }
497
+ < input
498
+ disabled = { fundContractDisabled }
499
+ className = "border border-gray-300 rounded-md p-2 w-1/2"
500
+ placeholder = { `${
501
+ fundContractDisabled
502
+ ? "Contract is fully funded"
503
+ : "Enter the amount you wish to fund"
504
+ } `}
505
+ value = { amountToFund }
506
+ onChange = { ( e ) => setAmountToFund ( e . target . value ) }
507
+ />
508
+ </ div >
509
+ < div className = "flex flex-row justify-start mt-6" >
563
510
< button
564
511
disabled = { fundContractDisabled }
565
512
className = { classNames (
566
- `${
567
- fundContractDisabled ? "bg-violet-400" : "bg-violet-200"
568
- } text-white py-2 px-4 rounded`
513
+ `bg-violet-400 hover:bg-violet-700 text-white py-2 px-4 rounded ${
514
+ fundContractDisabled
515
+ ? "cursor-not-allowed"
516
+ : "cursor-pointer"
517
+ } `
569
518
) }
570
519
data-testid = "fund-contract-btn"
571
520
onClick = { ( ) => handleFundContract ( ) }
572
521
>
573
522
Fund Contract
574
523
</ button >
524
+ { props . round . tags ?. includes ( "allo-v1" ) && (
525
+ < button
526
+ className = "bg-white hover:text-violet-700 hover:border-violet-700 text-gray py-2 px-4 rounded border border-gray ml-4"
527
+ data-testid = "view-contract-btn"
528
+ onClick = { ( ) =>
529
+ window . open (
530
+ getTxExplorerForContract (
531
+ chainId ! ,
532
+ props . roundId as string
533
+ ) ,
534
+ "_blank"
535
+ )
536
+ }
537
+ >
538
+ View Contract
539
+ </ button >
540
+ ) }
575
541
</ div >
576
- ) }
542
+ { insufficientBalance && (
543
+ < div
544
+ data-testid = "insufficientBalance"
545
+ className = "rounded-md bg-red-50 py-2 text-pink-500 flex justify-center my-4 text-sm"
546
+ >
547
+ < InformationCircleIcon className = "w-4 h-4 mr-1 mt-0.5" />
548
+ < span >
549
+ You do not have enough funds for funding the matching pool.
550
+ </ span >
551
+ </ div >
552
+ ) }
553
+ < FundContractModals />
554
+ </ >
577
555
</ div >
578
556
</ div >
579
557
) ;
0 commit comments