Skip to content

Commit

Permalink
chore: add const
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushtom committed Jan 12, 2024
1 parent 766de4e commit b9d4d69
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/quest-boost/claim/[boostId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default function Page({ params }: BoostQuestPageProps) {
const [transactionHash, setTransactionHash] = useState<string>("");
const [winnerList, setWinnerList] = useState<string[]>([]);
const { updateBoostClaimStatus } = useBoost();
const [displayAmount, setDisplayAmount] = useState<number>(0);

const fetchPageData = async () => {
try {
Expand Down Expand Up @@ -74,6 +75,7 @@ export default function Page({ params }: BoostQuestPageProps) {
// convert values in winner array from hex to decimal
if (!boost.winner) return false;

setDisplayAmount(parseInt(String(boost?.amount / boost?.num_of_winners)));
return winnerList.includes(hexToDecimal(address));
}, [boost, address, winnerList]);

Expand Down Expand Up @@ -147,11 +149,7 @@ export default function Page({ params }: BoostQuestPageProps) {
</div>
<div className={styles.claim_button_text}>
<p className={styles.claim_amount}>
{boost
? parseInt(
String(boost?.amount / boost?.num_of_winners)
)
: 0}
{boost ? displayAmount : 0}
</p>
</div>
<div className={styles.token_symbol_container}>
Expand Down

0 comments on commit b9d4d69

Please sign in to comment.