Skip to content

Commit

Permalink
Merge pull request #241 from mrgnlabs/j/all-emissions-suppor
Browse files Browse the repository at this point in the history
J/all emissions support
  • Loading branch information
losman0s authored Sep 21, 2023
2 parents 8038701 + 73d7192 commit 615766f
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions apps/marginfi-v2-ui/src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ const Navbar: FC = () => {
badgeContent={"l"}
invisible={!showBadges}
>
<Link href={"/"} className={`${router.pathname === "/" ? "hover-underline-static" : "hover-underline-animation"} hidden md:block`}>
<Link
href={"/"}
className={`${
router.pathname === "/" ? "hover-underline-static" : "hover-underline-animation"
} hidden md:block`}
>
lend
</Link>
</Badge>
Expand All @@ -152,7 +157,10 @@ const Navbar: FC = () => {
badgeContent={"s"}
invisible={!showBadges}
>
<Link href={"/swap"} className={`${router.pathname === "/swap" ? "hover-underline-static" : "hover-underline-animation"}`}>
<Link
href={"/swap"}
className={`${router.pathname === "/swap" ? "hover-underline-static" : "hover-underline-animation"}`}
>
swap
</Link>
</Badge>
Expand All @@ -170,7 +178,10 @@ const Navbar: FC = () => {
badgeContent={"b"}
invisible={!showBadges}
>
<Link href={"/bridge"} className={`${router.pathname === "/bridge" ? "hover-underline-static" : "hover-underline-animation"}`}>
<Link
href={"/bridge"}
className={`${router.pathname === "/bridge" ? "hover-underline-static" : "hover-underline-animation"}`}
>
bridge
</Link>
</Badge>
Expand All @@ -190,7 +201,12 @@ const Navbar: FC = () => {
invisible={!showBadges}
className="hidden md:block"
>
<Link href={"/earn"} className={`${router.pathname === "/earn" ? "hover-underline-static" : "hover-underline-animation"} hidden md:block`}>
<Link
href={"/earn"}
className={`${
router.pathname === "/earn" ? "hover-underline-static" : "hover-underline-animation"
} hidden md:block`}
>
earn
</Link>
</Badge>
Expand Down Expand Up @@ -225,18 +241,23 @@ const Navbar: FC = () => {
extendedBankInfos.find((b) => b.meta.tokenSymbol === "UXD")!.address
);
}

if (selectedAccount && extendedBankInfos?.find((b) => b.meta.tokenSymbol === "bSOL")?.info.rawBank) {
selectedAccount!.withdrawEmissions(
extendedBankInfos.find((b) => b.meta.tokenSymbol === "bSOL")!.address
);
}
}}
>
{accountSummary.outstandingUxpEmissions === 0
? `Lend UXD to earn UXP`
: `Claim ${
accountSummary.outstandingUxpEmissions < 1
? accountSummary.outstandingUxpEmissions.toExponential(5)
: numeralFormatter(accountSummary.outstandingUxpEmissions)
} UXP`}
withdraw all rewards
</div>

<Link href={"/points"} className={`${router.pathname === "/points" ? "hover-underline-static" : "hover-underline-animation"} whitespace-nowrap`}>
<Link
href={"/points"}
className={`${
router.pathname === "/points" ? "hover-underline-static" : "hover-underline-animation"
} whitespace-nowrap`}
>
{connected && currentFirebaseUser
? `${groupedNumberFormatterDyn.format(Math.round(userPointsData.totalPoints))} points`
: "points"}
Expand Down

0 comments on commit 615766f

Please sign in to comment.