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

J/all emissions support #241

Merged
merged 3 commits into from
Sep 21, 2023
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
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