File tree Expand file tree Collapse file tree 4 files changed +10
-2
lines changed
Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ type RewardProps = {
1010 stakedQuantity : number ;
1111 badge ?: string ;
1212 hideText ?: boolean ;
13+ shouldDivide ?: boolean ;
1314} ;
1415
1516function Reward ( {
@@ -20,13 +21,15 @@ function Reward({
2021 stakedQuantity,
2122 badge,
2223 hideText,
24+ shouldDivide,
2325} : RewardProps ) {
2426 function formattedBalance ( balance : string , decimals : number ) {
2527 const decimalsBig = new Big ( 10 ) . pow ( decimals ?? 0 ) ;
2628 const balanceBig = new Big ( balance ?? 0 ) ;
2729 const stakedBig = new Big ( stakedQuantity === 0 ? 1 : stakedQuantity ) ;
28-
29- return balanceBig . div ( decimalsBig ) . div ( stakedBig ) . toFixed ( 2 ) ;
30+ if ( shouldDivide )
31+ return balanceBig . div ( decimalsBig ) . div ( stakedBig ) . toFixed ( 2 ) ;
32+ else return balanceBig . div ( decimalsBig ) . toFixed ( 2 ) ;
3033 }
3134
3235 function renderImage ( ) {
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ type NFTStakingCardProps = HTMLAttributes<HTMLButtonElement> & {
1818 logoless ?: boolean ;
1919 wallet ?: string ;
2020 collection ?: string | undefined ;
21+ shouldDivide ?: boolean ;
2122} ;
2223
2324export function NFTStakingCard ( props : NFTStakingCardProps ) {
@@ -99,6 +100,7 @@ export function NFTStakingCard(props: NFTStakingCardProps) {
99100 stakedQuantity = { nftQuantity }
100101 badge = { props . wallet }
101102 hideText = { props . logoless }
103+ shouldDivide = { props . shouldDivide }
102104 />
103105 ) ;
104106 } ;
Original file line number Diff line number Diff line change @@ -426,6 +426,7 @@ export function NFTStakingProjectComponent(props: NFTStakingProjectProps) {
426426 wallet = { accountId ? undefined : "Connect Wallet" }
427427 onClick = { accountId ? undefined : connectWallet }
428428 collection = { collection . id }
429+ shouldDivide = { false }
429430 />
430431
431432 < div className = "rounded-lg bg-white-600 p-6" >
@@ -506,6 +507,7 @@ export function NFTStakingProjectComponent(props: NFTStakingProjectProps) {
506507 name = { collection . name }
507508 rewards = { collection . rewards }
508509 collection = { collection . id }
510+ shouldDivide = { true }
509511 />
510512 < Tutorial items = { stepItems as [ ] } />
511513 </ div >
Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ export const NFTStaking = () => {
165165 name = { staking ?. collection_meta ?. name }
166166 rewards = { staking ?. rewards }
167167 collection = { staking ?. collection_id }
168+ shouldDivide = { true }
168169 />
169170 ) ;
170171 } ;
You can’t perform that action at this time.
0 commit comments