Skip to content

Commit 4f62ae0

Browse files
authored
Merge pull request #1905 from cprussin/staking-app-landing-page
feat(staking) implement new landing page designs
2 parents 524de7e + c7d72f9 commit 4f62ae0

File tree

14 files changed

+392
-39
lines changed

14 files changed

+392
-39
lines changed

apps/staking/src/components/AccountSummary/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ export const AccountSummary = ({
4949
availableRewards,
5050
expiringRewards,
5151
}: Props) => (
52-
<section className="relative w-full overflow-hidden border border-neutral-600/50 bg-pythpurple-800">
52+
<section className="relative w-full overflow-hidden sm:border sm:border-neutral-600/50 sm:bg-pythpurple-800">
5353
<Image
5454
src={background}
5555
alt=""
5656
className="absolute -right-40 hidden h-full object-cover object-right [mask-image:linear-gradient(to_right,_transparent,_black_50%)] md:block"
5757
/>
58-
<div className="relative flex flex-col items-start justify-between gap-8 px-6 py-10 sm:gap-16 sm:px-12 sm:py-20 lg:flex-row lg:items-center">
58+
<div className="relative flex flex-col items-start justify-between gap-8 sm:px-6 sm:py-10 md:gap-16 md:px-12 md:py-20 xl:flex-row xl:items-center">
5959
<div>
6060
<div className="mb-2 inline-block border border-neutral-600/50 bg-neutral-900 px-4 py-1 text-xs text-neutral-400 sm:mb-4">
6161
Total Balance
@@ -121,7 +121,7 @@ export const AccountSummary = ({
121121
/>
122122
</div>
123123
</div>
124-
<div className="flex w-full flex-col items-stretch gap-4 lg:w-auto xl:flex-row">
124+
<div className="flex w-full flex-row items-stretch gap-4 xl:w-auto">
125125
<BalanceCategory
126126
name="Unlocked & Unstaked"
127127
amount={availableToWithdraw}
@@ -182,7 +182,7 @@ const BalanceCategory = ({
182182
action,
183183
warning,
184184
}: BalanceCategoryProps) => (
185-
<div className="flex w-full flex-col justify-between border border-neutral-600/50 bg-pythpurple-800/60 p-6 backdrop-blur lg:w-96">
185+
<div className="flex w-full flex-col justify-between border border-neutral-600/50 bg-pythpurple-800/60 p-6 backdrop-blur xl:w-96">
186186
<div>
187187
<div className="mb-4 inline-block border border-neutral-600/50 bg-neutral-900 px-4 py-1 text-xs text-neutral-400">
188188
{name}

apps/staking/src/components/Button/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const LinkButton = ({
5353

5454
const baseClassName = (props: VariantProps) =>
5555
clsx(
56-
"border border-pythpurple-600 hover:bg-pythpurple-600/60 focus:outline-none focus-visible:ring-1 focus-visible:ring-pythpurple-400",
56+
"border border-pythpurple-600 transition duration-100 hover:bg-pythpurple-600/60 focus:outline-none focus-visible:ring-1 focus-visible:ring-pythpurple-400",
5757
variantClassName(props.variant),
5858
sizeClassName(props.size),
5959
);
@@ -75,7 +75,7 @@ const sizeClassName = (size: VariantProps["size"]) => {
7575
return "text-sm px-2 sm:px-3 py-1";
7676
}
7777
case "nopad": {
78-
return "px-0 py-0";
78+
return "";
7979
}
8080
case "noshrink": {
8181
return "px-8 py-2";

apps/staking/src/components/Footer/index.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import LinkedIn from "./linkedin.svg";
77
import Telegram from "./telegram.svg";
88
import X from "./x.svg";
99
import Youtube from "./youtube.svg";
10+
import Logo from "../Header/logo.svg";
1011
import { Link } from "../Link";
1112
import { MaxWidth } from "../MaxWidth";
1213

@@ -37,21 +38,26 @@ export const Footer = ({
3738
}: Omit<HTMLAttributes<HTMLElement>, "children">) => (
3839
<footer
3940
className={clsx(
40-
"sticky bottom-0 mt-4 text-xs font-light text-neutral-400 sm:px-4",
41+
"mt-4 text-xs font-light sm:sticky sm:bottom-0 sm:px-4",
4142
className,
4243
)}
4344
{...props}
4445
>
4546
<div className="border-t border-neutral-600/50 bg-pythpurple-800 sm:border-x">
46-
<MaxWidth className="flex h-16 items-center justify-between sm:-mx-4">
47-
<div>© 2024 Pyth Data Association</div>
48-
<div className="relative -right-3 flex h-full items-center">
47+
<MaxWidth className="flex flex-col items-center gap-10 py-8 sm:-mx-4 sm:h-16 sm:flex-row sm:justify-between">
48+
<div className="flex flex-col items-center gap-2 sm:flex-row sm:gap-4 md:gap-8">
49+
<Link href="https://www.pyth.network" target="_blank">
50+
<Logo className="h-10 sm:h-8" />
51+
</Link>
52+
<div>© 2024 Pyth Data Association</div>
53+
</div>
54+
<div className="relative flex h-full items-center sm:-right-3">
4955
{SOCIAL_LINKS.map(({ name, icon: Icon, href }) => (
5056
<Link
5157
target="_blank"
5258
href={href}
5359
key={name}
54-
className="grid h-full place-content-center px-2 hover:text-pythpurple-400 sm:px-3"
60+
className="grid h-full place-content-center px-3 hover:text-pythpurple-400"
5561
rel="noreferrer"
5662
>
5763
<Icon className="size-4" />

apps/staking/src/components/Home/index.tsx

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"use client";
22

3-
import { useWalletModal } from "@solana/wallet-adapter-react-ui";
4-
import { useCallback } from "react";
53
import { useIsSSR } from "react-aria";
64

75
import {
@@ -13,10 +11,10 @@ import {
1311
StateType as DashboardDataStateType,
1412
useData,
1513
} from "../../hooks/use-data";
16-
import { Button } from "../Button";
1714
import { Dashboard } from "../Dashboard";
1815
import { Error as ErrorPage } from "../Error";
1916
import { Loading } from "../Loading";
17+
import { NoWalletHome } from "../NoWalletHome";
2018

2119
export const Home = () => {
2220
const isSSR = useIsSSR();
@@ -45,29 +43,6 @@ const MountedHome = () => {
4543
}
4644
};
4745

48-
const NoWalletHome = () => {
49-
const modal = useWalletModal();
50-
const showModal = useCallback(() => {
51-
modal.setVisible(true);
52-
}, [modal]);
53-
54-
return (
55-
<main className="my-20">
56-
<h1 className="mb-8 mt-16 text-center text-4xl font-semibold text-pythpurple-400">
57-
Staking & Delegating
58-
</h1>
59-
<p className="mx-auto mb-8 max-w-prose text-center">
60-
The Pyth staking program allows you to stake tokens to participate in
61-
governance, or to earn yield and protect DeFi by delegating to
62-
publishers.
63-
</p>
64-
<div className="grid w-full place-content-center">
65-
<Button onPress={showModal}>Connect your wallet to participate</Button>
66-
</div>
67-
</main>
68-
);
69-
};
70-
7146
type StakeAccountLoadedHomeProps = {
7247
api: States[ApiStateType.Loaded] | States[ApiStateType.LoadedNoStakeAccount];
7348
};
764 KB
Loading

0 commit comments

Comments
 (0)