Skip to content

Commit

Permalink
Merge pull request #233 from k0beLeenders/stake-mobile-temp
Browse files Browse the repository at this point in the history
feat(mfi-v2-ui): LST staking mobile design
  • Loading branch information
losman0s authored Sep 12, 2023
2 parents d125ee9 + d45b6dc commit c2edf8d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 44 deletions.
5 changes: 1 addition & 4 deletions apps/marginfi-v2-ui/src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,10 @@ const Navbar: FC = () => {
}}
badgeContent={"e"}
invisible={!showBadges}
className="hidden md:block"
>
<Link
href={"/stake"}
className={`${
router.pathname === "/stake" ? "hover-underline-static" : "hover-underline-animation"
} hidden md:block`}
className={router.pathname === "/stake" ? "hover-underline-static" : "hover-underline-animation"}
>
stake
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface StakingCardProps {}
export const StakingCard: FC<StakingCardProps> = ({}) => {
return (
<>
<div className="relative flex flex-col gap-2 rounded-xl bg-[#1C2023] px-8 py-6 w-[480px]">
<div className="relative flex flex-col gap-2 rounded-xl bg-[#1C2023] px-8 py-6 max-w-[480px] w-full">
<div className="flex flex-row justify-between w-full">
<Typography className="font-aeonik font-[400] text-lg">Deposit</Typography>
<div className="flex flex-row gap-2 my-auto">
Expand Down
74 changes: 36 additions & 38 deletions apps/marginfi-v2-ui/src/components/Staking/StakingStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,47 @@ interface StakingStatsProps {
export const StakingStats: FC<StakingStatsProps> = ({ tvl, projectedApy }) => {
return (
<div className="h-full rounded-xl font-[500] p-[10px]">
<div className="flex flex-row justify-center gap-8 w-full min-w-1/2 mt-[20px]">
<div className="h-full">
<div>
<Typography
color="#868E95"
className="font-aeonik font-[300] text-xs flex gap-1"
gutterBottom
component="div"
>
TVL
</Typography>
<Typography color="#fff" className="font-aeonik font-[500] text-lg md:text-xl" component="div">
{tvl ? (
`$${numeralFormatter(tvl)}`
) : (
<Skeleton variant="rectangular" animation="wave" className="w-1/3 rounded-md top-[4px]" />
)}
</Typography>
</div>
<div className="flex flex-col sm:flex-row justify-center gap-0 sm:gap-8 w-full min-w-1/2 mt-[20px] bg-[#171C1F] sm:bg-transparent rounded-xl">
<div className="flex flex-row sm:flex-col justify-between p-3 sm:p-0 gap-1">
<Typography
color="#868E95"
className="font-aeonik font-[400] text-base flex gap-1 my-auto"
gutterBottom
component="div"
>
TVL
</Typography>
<Typography color="#fff" className="font-aeonik font-[500] text-xl" component="div">
{tvl ? (
`$${numeralFormatter(tvl)}`
) : (
<Skeleton variant="rectangular" animation="wave" className="w-1/3 rounded-md top-[4px]" />
)}
</Typography>
</div>

<DividerLine />
<div className="h-full">
<div>
<Typography
color="#868E95"
className="font-aeonik font-[300] text-xs flex gap-1"
gutterBottom
component="div"
>
Projected APY
</Typography>
<Typography color="#fff" className="font-aeonik font-[500] text-lg md:text-xl" component="div">
{projectedApy ? (
percentFormatterDyn.format(projectedApy)
) : (
<Skeleton variant="rectangular" animation="wave" className="w-1/3 rounded-md top-[4px]" />
)}
</Typography>
</div>

<div className="flex flex-row sm:flex-col justify-between p-3 sm:p-0 gap-1">
<Typography
color="#868E95"
className="font-aeonik font-[400] text-base flex gap-1 my-auto"
gutterBottom
component="div"
>
Projected APY
</Typography>
<Typography color="#fff" className="font-aeonik font-[500] text-xl" component="div">
{projectedApy ? (
percentFormatterDyn.format(projectedApy)
) : (
<Skeleton variant="rectangular" animation="wave" className="w-1/3 rounded-md top-[4px]" />
)}
</Typography>
</div>
</div>
</div>
);
};

const DividerLine = () => <div style={{ width: "1px", borderLeft: "1px solid #555" }} />;
const DividerLine = () => <div className="hidden sm:block" style={{ width: "1px", borderLeft: "1px solid #555" }} />;
2 changes: 1 addition & 1 deletion apps/marginfi-v2-ui/src/pages/stake.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const StakePage = () => {
return (
<>
<PageHeader text={"$LST"} />
<div className="flex flex-col h-full justify-center content-center pt-[64px] sm:pt-[16px] gap-4">
<div className="flex flex-col h-full justify-center content-center pt-[64px] sm:pt-[16px] gap-4 mx-4">
<StakingStats tvl={1250} projectedApy={0.5215} />
<StakingCard />
</div>
Expand Down

0 comments on commit c2edf8d

Please sign in to comment.