@@ -33,7 +33,8 @@ import {
33
33
ProjectLogo ,
34
34
StakingBannerAndModal ,
35
35
} from "./components" ;
36
-
36
+ import { useGetApplicationStakes } from "./hooks/useGetApplicationStakes" ;
37
+ import { useIsStakable } from "./components/StakingBannerAndModal/hooks/useIsStakable" ;
37
38
export default function ViewProjectDetails ( ) {
38
39
const [ selectedTab , setSelectedTab ] = useState ( 0 ) ;
39
40
@@ -58,6 +59,11 @@ export default function ViewProjectDetails() {
58
59
applicationId = paramApplicationId ;
59
60
}
60
61
62
+ const isStakableRound = useIsStakable ( {
63
+ chainId : Number ( chainId ) ,
64
+ roundId,
65
+ } ) ;
66
+
61
67
const {
62
68
data : application ,
63
69
error,
@@ -70,6 +76,13 @@ export default function ViewProjectDetails() {
70
76
} ,
71
77
dataLayer
72
78
) ;
79
+ const { data : totalStaked } = useGetApplicationStakes (
80
+ Number ( chainId ) ,
81
+ Number ( roundId ) ,
82
+ application ?. anchorAddress ?? "" ,
83
+ isStakableRound
84
+ ) ;
85
+
73
86
const { round : roundDetails } = useRoundById ( Number ( chainId ) , roundId ) ;
74
87
75
88
const projectToRender = application && mapApplicationToProject ( application ) ;
@@ -218,12 +231,15 @@ export default function ViewProjectDetails() {
218
231
</ div >
219
232
) }
220
233
</ div >
221
- < div className = "mb-4" >
234
+ < div className = "mb-4 relative " >
222
235
< ProjectBanner
223
236
bannerImgCid = { bannerImg ?? null }
224
237
classNameOverride = "h-32 w-full object-cover lg:h-80 rounded md:rounded-3xl"
225
238
resizeHeight = { 320 }
226
239
/>
240
+ { totalStaked && Number ( totalStaked ) > 0 && (
241
+ < StakedAmountCard totalStaked = { Number ( totalStaked ) } />
242
+ ) }
227
243
< div className = "pl-4 sm:pl-6 lg:pl-8" >
228
244
< div className = "sm:flex sm:items-end sm:space-x-5" >
229
245
< div className = "flex" >
@@ -275,3 +291,40 @@ export default function ViewProjectDetails() {
275
291
</ >
276
292
) ;
277
293
}
294
+
295
+ const StakedAmountCard = ( { totalStaked } : { totalStaked : number } ) => {
296
+ return (
297
+ < div className = "p-2 bg-white/80 rounded-2xl backdrop-blur-sm inline-flex justify-start items-center gap-2 absolute top-4 right-4" >
298
+ < div data-svg-wrapper className = "relative" >
299
+ < svg
300
+ width = "20"
301
+ height = "20"
302
+ viewBox = "0 0 20 20"
303
+ fill = "none"
304
+ xmlns = "http://www.w3.org/2000/svg"
305
+ >
306
+ < path
307
+ d = "M10.8334 8.33333V2.5L3.33337 11.6667H9.16671L9.16671 17.5L16.6667 8.33333L10.8334 8.33333Z"
308
+ stroke = "#7D67EB"
309
+ stroke-width = "2"
310
+ stroke-linecap = "round"
311
+ stroke-linejoin = "round"
312
+ />
313
+ </ svg >
314
+ </ div >
315
+ < div className = "inline-flex flex-col justify-start items-start" >
316
+ < div className = "self-stretch inline-flex justify-start items-center gap-1" >
317
+ < div className = "justify-start text-text-primary text-lg font-medium font-['DM_Mono'] leading-normal" >
318
+ { totalStaked }
319
+ </ div >
320
+ < div className = "justify-start text-text-primary text-lg font-medium font-['DM_Mono'] leading-normal" >
321
+ GTC
322
+ </ div >
323
+ </ div >
324
+ < div className = "self-stretch justify-start text-text-primary text-sm font-normal font-['DM_Mono'] leading-[14px]" >
325
+ Total staked
326
+ </ div >
327
+ </ div >
328
+ </ div >
329
+ ) ;
330
+ } ;
0 commit comments