@@ -50,7 +50,8 @@ import { useDirectAllocation } from "./hooks/useDirectAllocation";
50
50
import { getDirectAllocationPoolId } from "common/dist/allo/backends/allo-v2" ;
51
51
import { Address , getAddress , zeroAddress } from "viem" ;
52
52
import GenericModal from "../common/GenericModal" ;
53
- import { BoltIcon , InformationCircleIcon } from "@heroicons/react/24/outline" ;
53
+ import { InformationCircleIcon } from "@heroicons/react/24/outline" ;
54
+ import { BoltIcon } from "@heroicons/react/24/solid" ;
54
55
import { useConnectModal } from "@rainbow-me/rainbowkit" ;
55
56
import { getBalance } from "@wagmi/core" ;
56
57
import { config } from "../../app/wagmi" ;
@@ -361,32 +362,16 @@ export default function ViewProject() {
361
362
</ div >
362
363
< div className = "md:flex gap-4 flex-row-reverse" >
363
364
< div className = "mb-4" >
364
- < Sidebar projectApplications = { projectApplications } />
365
- { directAllocationPoolId && (
366
- < button
367
- type = "button"
368
- data-testid = "direct-allocation-button"
369
- className = "w-full block my-0 mx-1 bg-gitcoin-violet-100 py-2 text-center text-sm font-semibold rounded-lg leading-6 text-gitcoin-violet-400 shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
370
- onClick = { ( ) => {
371
- if ( ! isConnected ) {
372
- openConnectModal ?.( ) ;
373
- return ;
374
- }
375
- if ( project ?. chainId === undefined ) {
376
- console . error ( "project chainId is undefined" ) ;
377
- return ;
378
- }
379
- if ( chainId !== project ?. chainId ) {
380
- setShowSwitchNetworkModal ( true ) ;
381
- } else {
382
- setShowDirectAllocationModal ( true ) ;
383
- }
384
- } }
385
- >
386
- < BoltIcon className = "w-4 h-4 inline-block mr-1 mb-1" />
387
- Donate
388
- </ button >
389
- ) }
365
+ < Sidebar
366
+ projectApplications = { projectApplications }
367
+ directAllocationPoolId = { directAllocationPoolId }
368
+ isConnected = { isConnected }
369
+ chainId = { Number ( chainId ) }
370
+ project = { project }
371
+ setShowSwitchNetworkModal = { setShowSwitchNetworkModal }
372
+ setShowDirectAllocationModal = { setShowDirectAllocationModal }
373
+ openConnectModal = { openConnectModal }
374
+ />
390
375
</ div >
391
376
< div className = "flex-1" >
392
377
{ projectError === undefined ? (
@@ -573,9 +558,14 @@ export function DirectDonationModalComponent(props: {
573
558
return (
574
559
< >
575
560
< div >
576
- < p className = "mb-4" >
561
+ < p className = "mb-4 text-lg font-bold " >
577
562
< BoltIcon className = "w-4 h-4 mb-1 inline-block mr-2" />
578
- Donate now
563
+ Direct Donation
564
+ </ p >
565
+ < p className = "mb-2" >
566
+ This is a direct donation to the project. Please note that as the
567
+ donation is outside of a quadratic funding round it doesn't receive
568
+ any matching funds.
579
569
</ p >
580
570
</ div >
581
571
@@ -821,6 +811,13 @@ function ProjectLogo({ logoImg }: { logoImg?: string }) {
821
811
822
812
function Sidebar ( props : {
823
813
projectApplications ?: ProjectApplicationWithRoundAndProgram [ ] ;
814
+ directAllocationPoolId : number | undefined ;
815
+ isConnected : boolean ;
816
+ chainId : number ;
817
+ project ?: v2Project ;
818
+ setShowSwitchNetworkModal : ( value : boolean ) => void ;
819
+ setShowDirectAllocationModal : ( value : boolean ) => void ;
820
+ openConnectModal ?: ( ) => void ;
824
821
} ) {
825
822
const activeQFRoundApplications = props . projectApplications ?. filter (
826
823
( projectApplication ) =>
@@ -834,8 +831,40 @@ function Sidebar(props: {
834
831
< div className = "min-w-[320px] h-fit mb-6 rounded-3xl bg-gray-50" >
835
832
< ProjectStats projectApplications = { props . projectApplications } />
836
833
</ div >
834
+ { props . directAllocationPoolId && (
835
+ < button
836
+ type = "button"
837
+ data-testid = "direct-allocation-button"
838
+ className = "w-full block mb-8 mx-1 bg-gitcoin-violet-100 py-2 text-center text-sm font-semibold rounded-lg leading-6 text-gitcoin-violet-400 shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
839
+ onClick = { ( ) => {
840
+ if ( ! props . isConnected ) {
841
+ props . openConnectModal ?.( ) ;
842
+ return ;
843
+ }
844
+ if ( props . project ?. chainId === undefined ) {
845
+ console . error ( "project chainId is undefined" ) ;
846
+ return ;
847
+ }
848
+ if ( props . chainId !== props . project ?. chainId ) {
849
+ props . setShowSwitchNetworkModal ( true ) ;
850
+ } else {
851
+ props . setShowDirectAllocationModal ( true ) ;
852
+ }
853
+ } }
854
+ >
855
+ < BoltIcon className = "w-4 h-4 inline-block mr-1 mb-1" />
856
+ Donate
857
+ </ button >
858
+ ) }
837
859
{ activeQFRoundApplications && activeQFRoundApplications ?. length > 0 && (
838
- < h4 className = "text-xl font-medium" > Active rounds</ h4 >
860
+ < >
861
+ < h4 className = "text-xl font-medium" > Active rounds</ h4 >
862
+ < p className = "text-md mt-2 text-gray-500 max-w-[320px]" >
863
+ The project is currently participating in the below active rounds.
864
+ Donating to the project in these rounds will help it receive
865
+ matching funds.
866
+ </ p >
867
+ </ >
839
868
) }
840
869
< div className = "mt-4 max-w-[320px] h-fit rounded-3xl " >
841
870
{ activeQFRoundApplications ?. map ( ( projectApplication ) => (
@@ -1012,7 +1041,7 @@ export function ActiveRoundComponent(props: {
1012
1041
projectMetadata : props . projectApplication . metadata . application . project ,
1013
1042
grantApplicationFormAnswers : [ ] ,
1014
1043
status : props . projectApplication . status ,
1015
- applicationIndex : 0 ,
1044
+ applicationIndex : Number ( props . projectApplication . id ) ,
1016
1045
roundId : props . projectApplication . roundId ,
1017
1046
chainId : props . projectApplication . chainId ,
1018
1047
amount : "0" ,
0 commit comments