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

feat(mfi-v2-ui): new stake page #945

Merged
merged 26 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
94c7f75
feat: stake page redesign (wip)
chambaz Oct 26, 2024
ad8e924
feat: add arena link
chambaz Oct 26, 2024
fb7a998
feat: stake page layout mods
chambaz Oct 26, 2024
73c3150
chore: refactor stake components to new coding standards
chambaz Oct 26, 2024
d5be70d
chore: move mint utils to new stake component dir
chambaz Oct 26, 2024
9235000
chore: remove unused stake page utils
chambaz Oct 26, 2024
24b529e
chore: move stake page into new stake component
chambaz Oct 26, 2024
ffc517e
chore: new stake-calculator component in mrgn-ui / added to stake page
chambaz Oct 28, 2024
2470b63
feat: basic stake calculator charting logic complete
chambaz Oct 31, 2024
7f638cc
feat: add text explanation of stake yield
chambaz Oct 31, 2024
acabcda
chore: clean up formatters
chambaz Oct 31, 2024
f701e57
feat: add support for usd denomination / sol price prediction
chambaz Nov 1, 2024
503ad86
feat: round chart numbers for better tooltips styling
chambaz Nov 1, 2024
7fcae80
feat: updated copy
chambaz Nov 1, 2024
a064e55
chore: remove console logs
chambaz Nov 1, 2024
a7b0ca3
fix: only override usd denominated if price prediction manually set
chambaz Nov 2, 2024
27ecd67
feat: responsive styling
chambaz Nov 2, 2024
88a17bc
feat: updated home / stake page metadata
chambaz Nov 5, 2024
8face9e
fix: stakebox cta
chambaz Nov 5, 2024
2c5a2ca
feat: various stake page copy updates
chambaz Nov 6, 2024
fc5360a
feat: new stake calculator page
chambaz Nov 6, 2024
97b1cdb
fix: get token image url type checking
chambaz Nov 6, 2024
cffb449
feat: replace lst store with api data, pass dynamic mrgn validator ap…
chambaz Nov 7, 2024
dd1b19c
chore: restructure lst api to try both apis separately, allowing one …
chambaz Nov 7, 2024
f237e4a
fix: restructure lst api to try both apis separately, allowing one to…
chambaz Nov 7, 2024
d88c981
fix: missing useMemo dep
chambaz Nov 11, 2024
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
2 changes: 1 addition & 1 deletion apps/marginfi-v2-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"@mrgnlabs/marginfi-client-v2": "*",
"@mrgnlabs/marginfi-v2-ui-state": "*",
"@mrgnlabs/mrgn-common": "*",
"@mrgnlabs/mrgn-utils": "*",
"@mrgnlabs/mrgn-ui": "*",
"@mrgnlabs/mrgn-utils": "*",
"@mui/material": "^5.15.11",
"@next/bundle-analyzer": "^13.4.19",
"@next/font": "13.1.1",
Expand Down
34 changes: 19 additions & 15 deletions apps/marginfi-v2-ui/src/components/common/Meta/Meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,29 @@ type MrgnProps = {
};

export const Meta = ({ path }: MrgnProps) => {
const title = `marginfi ${path !== "/" ? ` - ${path.substring(1)}` : ""}`;
const customPages: Record<string, { title: string; description: string }> = {
"/": {
title: "High-Yield DeFi Borrowing & Lending | Earn More with marginfi",
description:
"Earn high yields with marginfi's DeFi lending and borrowing protocol using SOL, USDC, USDT, and more. Borrow assets, compound returns, and access instant liquidity in just a few clicks.",
},
"/stake": {
title: "Self-Custody Solana Staking | Hedge Against Inflation with marginfi",
description:
"Unlock high-yield Solana staking on marginfi. Stake your assets, hedge against inflation, and earn yield safely and securely.",
},
};
const title = customPages[path]
? customPages[path].title
: `marginfi ${path !== "/" ? ` - ${path.substring(1)}` : ""}`;
const description = customPages[path] ? customPages[path].description : null;
return (
<Head>
<title>{title}</title>

{path === "/" && (
<>
<meta name="description" content="marginfi is a decentralized lending and borrowing protocol on Solana." />
<meta
property="og:description"
content="marginfi is a decentralized lending and borrowing protocol on Solana."
/>
<meta
name="twitter:description"
content="marginfi is a decentralized lending and borrowing protocol on Solana."
/>
</>
)}
<meta property="og:title" content={title} />
{description && <meta name="description" content={description} />}
{description && <meta property="og:description" content={description} />}
{description && <meta name="twitter:description" content={description} />}
<meta property="og:url" content="https://app.marginfi.com" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://app.marginfi.com/marginfi-cover-1200x630.jpg" />
Expand Down
131 changes: 0 additions & 131 deletions apps/marginfi-v2-ui/src/components/common/Mint/MintCardWrapper.tsx

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions apps/marginfi-v2-ui/src/components/common/Mint/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Link from "next/link";
import { cn } from "@mrgnlabs/mrgn-utils";

interface PageHeadingProps {
heading: string | JSX.Element;
size?: "md" | "lg";
body?: JSX.Element;
links?: {
href: string;
Expand All @@ -10,11 +12,16 @@ interface PageHeadingProps {
button?: JSX.Element;
}

export const PageHeading = ({ heading, body, links, button }: PageHeadingProps) => {
export const PageHeading = ({ heading, body, links, button, size = "md" }: PageHeadingProps) => {
return (
<div className="text-muted-foreground text-base md:text-lg text-center px-2 pt-4 pb-12 md:pt-0 md:px-0 space-y-3">
<h1 className="text-4xl font-medium text-primary">{heading}</h1>
<div className="max-w-2xl w-full mx-auto">{body}</div>
<div
className={cn(
"text-muted-foreground text-center px-8 pt-4 pb-6 text-base space-y-4 md:pb-12 md:pt-0 md:px-0",
size === "lg" ? "md:text-xl md:space-y-6" : "md:text-lg"
)}
>
<h1 className={cn("font-medium text-primary text-4xl", size === "lg" && "md:text-5xl")}>{heading}</h1>
<div className={cn("w-full mx-auto leading-relaxed", size === "lg" ? "max-w-[51rem]" : "max-w-2xl")}>{body}</div>

{links && links.length > 0 && (
<ul className="flex items-center gap-4 justify-center pt-2">
Expand Down
Loading
Loading