Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
jefedcreator committed Sep 10, 2022
1 parent 081917c commit a95b05c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/pages/Home/Card.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.home__bottomCard{
background: #203A62;
border-radius: 21px;
width: 350px;
height: 500px;
width: 345px;
height: 419px;
display: flex;
flex-direction: column;
align-items: center;
Expand Down
16 changes: 1 addition & 15 deletions src/pages/Home/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ function Card({
}
}


const checkApproved = async() => {
let userAddress = await signer.getAddress()
const isApproved = await token.allowance(userAddress, value.stakingAddress);
Expand Down Expand Up @@ -300,23 +299,10 @@ function Card({
<div className='home__descTitle'>Available Balance</div>
<div className='home__descValue'>{mystakebalance}</div>
</div>
<div className='home__descOption'>
<div className='home__descTitle'>Max Contrubution</div>
<div className='home__descValue'>{Number(maxContribution).toLocaleString('en-US')}</div>
</div>
<div className='home__descOption'>
<div className='home__descTitle'>Lock days</div>
<div className='home__descValue'>{Number(lockDays)} days</div>
</div>
<div className='home__descOption'>
<div className='home__descTitle'>My Reward</div>
<div className='home__descValue'>${Number(reward)}<img className='home__descGift' src={gift} alt='gift'/> </div>
</div>
<div className='home__descOption'>
<div className='home__descTitle'>Pool Type</div>
<div className='home__descValue'>{poolType.toString()}</div>
<div className='home__descValue'>$0 <img className='home__descGift' src={gift} alt='gift'/> </div>
</div>

</div>
<div className={'home__cardButton '+(Active ? '' : 'home--ended')} onClick={() => setIsOpen(true)}>
{ Active ? "Stake" : "Ended"}
Expand Down
16 changes: 14 additions & 2 deletions src/pages/Home/HomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ function HomePage() {
function refreshData (signer) {
if(signer){
signer.getAddress().then((res)=>{setMyaddress(res)})
// getUserInfo()
// getUserLockTime()
// // getPoolInfo()
// getTokenBalance()
// getWhiteListAddresses()
// checkApproved()
// getClaimableTokens()
// getPoolLength()
getPoolArray()
}
}
Expand All @@ -71,9 +79,11 @@ function HomePage() {
for (let i = 0; i < await getPoolLength(); i++) {
poolDetails[i] = await getPoolInfo(i);
}
console.log("pool details:", poolDetails);
console.log("array:",poolDetails);
}

console.log("array again:",poolDetails);

async function getPoolInfo(poolId){
try{
let _poolInfo = await staking.poolInfo(poolId);
Expand Down Expand Up @@ -107,7 +117,9 @@ function HomePage() {
const length = await staking.poolLength()
return (Number(length))
}


// console.log("length is",getPoolLength());

useEffect( ()=>{
refreshData(signer)
},[signer])
Expand Down

0 comments on commit a95b05c

Please sign in to comment.