Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENG-0000 fix(portal): revert fix nftPoints math #823

Merged
merged 3 commits into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions apps/portal/app/routes/app+/quest+/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,9 @@ export default function Quests() {
useLoaderData<typeof loader>()

// TODO: Remove this relic hold/mint count and points calculation when it is stored in BE.
const mintedRelics = Math.min(
Number(relicMintCount) || 0,
Number(relicHoldCount) || 0,
)
const heldRelics = (Number(relicHoldCount) || 0) - mintedRelics
const nftPoints = mintedRelics * 2000000 + heldRelics * 250000

const nftMintPoints = relicMintCount ? relicMintCount * 2000000 : 0
const nftHoldPoints = relicHoldCount ? +relicHoldCount * 250000 : 0
const totalNftPoints = nftMintPoints + nftHoldPoints
return (
<div className="p-10 w-full max-w-7xl mx-auto flex flex-col gap-5 max-md:p-5 max-sm:p-2">
<ExploreHeader
Expand Down Expand Up @@ -148,7 +144,7 @@ export default function Quests() {
relicMintCount || relicHoldCount
? resolvedUserTotals.referral_points +
resolvedUserTotals.quest_points +
nftPoints +
totalNftPoints +
calculatePointsFromFees(
resolvedUserTotals.total_protocol_fee_paid,
)
Expand All @@ -171,7 +167,7 @@ export default function Quests() {
},
{
name: 'NFT',
points: nftPoints,
points: totalNftPoints,
},
{
name: 'Referrals',
Expand All @@ -191,7 +187,7 @@ export default function Quests() {
<RelicPointCard
relicsMintCount={relicMintCount ? relicMintCount : 0}
relicsHoldCount={relicHoldCount ? +relicHoldCount : 0}
relicsPoints={nftPoints}
relicsPoints={totalNftPoints}
/>
</div>
</div>
Expand Down
Loading